Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

property jkube.enricher.jkube-controller.pullPolicy is not taken into account if a deployment resource fragment is defined #1619

Closed
sunix opened this issue Jun 16, 2022 · 2 comments · Fixed by #1624
Assignees
Labels
bug Something isn't working demoable Issues which can be demoed during the Sprint review meeting
Milestone

Comments

@sunix
Copy link
Member

sunix commented Jun 16, 2022

Describe the bug

Trying to use jkube.enricher.jkube-controller.pullPolicy to set the image pull policy to Always. It works. However, once I added a deployment resource fragment, even not related, it stopped working.

Eclipse JKube version

1.8.0

Component

Kubernetes Maven Plugin

Apache Maven version

No response

Gradle version

No response

Steps to reproduce

  1. Create a spring boot app from
  2. Add the kubernetes maven plugin
  3. Add in the pom.xml properties <jkube.enricher.jkube-controller.pullPolicy>Always</jkube.enricher.jkube-controller.pullPolicy>
  4. mvn k8s:resource, the generated configuration with a pullpolicy to Always for the container image.
  5. Add the file src/main/jkube/deployment.yml
spec:
  replicas: 2
  1. mvn k8s:resource, the generated configuration with a pullpolicy to IfNotPresent for the container image.

Expected behavior

it should keep the pull policy to Always

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

other (please specify in additional context)

Environment

Linux

Eclipse JKube Logs

No response

Sample Reproducer Project

No response

Additional context

No response

@sunix sunix added the bug Something isn't working label Jun 16, 2022
@sunix sunix added the demoable Issues which can be demoed during the Sprint review meeting label Jun 20, 2022
@rohanKanojia rohanKanojia self-assigned this Jun 20, 2022
@rohanKanojia
Copy link
Member

rohanKanojia commented Jun 20, 2022

I think it's not working because a different enricher ControllerViaPluginConfigurationEnricher gets executed when the user provides controller fragment.

I think it should work if you use this property instead:

jkube.enricher.jkube-controller-from-configuration.pullPolicy=Always

Related to fabric8io/fabric8-maven-plugin#401

@manusa
Copy link
Member

manusa commented Jun 21, 2022

So apparently we have at least 4 ways to control the pull policy (fragment, XML configuration, and 2 enricher peroperties).

We need to centralize where this configuration is computed and make sure it just works. (IIRC we did something similar for at least one other property).

rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jun 21, 2022
…r's properties in account (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding logic in
ControllerViaPluginConfigurationEnricher to also consider
DefaultControllerEnricher's configuration while generating resources.
This requires adding a utility method in BaseEnricher to read other
enricher's configuration by name and then using it in
DefaultControllerEnricher and ControllerViaPluginConfigurationEnricher.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jun 22, 2022
…r's properties in account (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding logic in
ControllerViaPluginConfigurationEnricher to also consider
DefaultControllerEnricher's configuration while generating resources.
This requires adding a utility method in BaseEnricher to read other
enricher's configuration by name and then using it in
DefaultControllerEnricher and ControllerViaPluginConfigurationEnricher.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jun 22, 2022
…r's properties in account (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding logic in
ControllerViaPluginConfigurationEnricher to also consider
DefaultControllerEnricher's configuration while generating resources.
This requires adding a utility method in BaseEnricher to read other
enricher's configuration by name and then using it in
DefaultControllerEnricher and ControllerViaPluginConfigurationEnricher.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jun 22, 2022
…r's properties in account (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding logic in
ControllerViaPluginConfigurationEnricher to also consider
DefaultControllerEnricher's configuration while generating resources.
This requires adding a utility method in BaseEnricher to read other
enricher's configuration by name and then using it in
DefaultControllerEnricher and ControllerViaPluginConfigurationEnricher.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jun 22, 2022
… for configuring container image pull policies (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding a new property
`jkube.imagePullPolicy` which can be used for configuring pull policy

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jun 22, 2022
… for configuring container image pull policies (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding a new property
`jkube.imagePullPolicy` which can be used for configuring pull policy

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jun 22, 2022
… for configuring container image pull policies (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding a new property
`jkube.imagePullPolicy` which can be used for configuring pull policy

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jul 12, 2022
… for configuring container image pull policies (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding a new property
`jkube.imagePullPolicy` which can be used for configuring pull policy

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
@manusa manusa added this to the 1.9.0 milestone Jul 12, 2022
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jul 12, 2022
… for configuring container image pull policies (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding a new property
`jkube.imagePullPolicy` which can be used for configuring pull policy

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jul 14, 2022
… for configuring container image pull policies (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding a new property
`jkube.imagePullPolicy` which can be used for configuring pull policy

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jul 15, 2022
… for configuring container image pull policies (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding a new property
`jkube.imagePullPolicy` which can be used for configuring pull policy

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jul 19, 2022
… for configuring container image pull policies (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding a new property
`jkube.imagePullPolicy` which can be used for configuring pull policy

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit that referenced this issue Jul 20, 2022
… for configuring container image pull policies (#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding a new property
`jkube.imagePullPolicy` which can be used for configuring pull policy

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jul 22, 2022
Related to eclipse-jkube#1619

Update CHANGELOG entry for issue in order to clarify the fix and
deprecations of old properties.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit to rohanKanojia/jkube that referenced this issue Jul 22, 2022
Related to eclipse-jkube#1619

Update CHANGELOG entry for issue in order to clarify the fix and
deprecations of old properties.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit that referenced this issue Jul 22, 2022
Related to #1619

Update CHANGELOG entry for issue in order to clarify the fix and
deprecations of old properties.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
baruKreddy pushed a commit to baruKreddy/jkube that referenced this issue Aug 11, 2022
… for configuring container image pull policies (eclipse-jkube#1619)

When a fragment is used, ControllerViaPluginConfigurationEnricher is
used. In this case `jkube.enricher.jkube-controller.*` configuration
won't work since we're not using DefaultControllerEnricher (used in zero
configuration) anymore.

This might be confusing for user. Adding a new property
`jkube.imagePullPolicy` which can be used for configuring pull policy

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
baruKreddy pushed a commit to baruKreddy/jkube that referenced this issue Aug 11, 2022
Related to eclipse-jkube#1619

Update CHANGELOG entry for issue in order to clarify the fix and
deprecations of old properties.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working demoable Issues which can be demoed during the Sprint review meeting
Projects
None yet
3 participants