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

OpenShift switchToDeployment flag #630

Closed
manusa opened this issue Mar 26, 2021 · 3 comments · Fixed by #686
Closed

OpenShift switchToDeployment flag #630

manusa opened this issue Mar 26, 2021 · 3 comments · Fixed by #686
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation
Milestone

Comments

@manusa
Copy link
Member

manusa commented Mar 26, 2021

Description

Document the usage of the flag jkube.build.switchToDeployment

See why <jkube.enricher.jkube-controller.type>Deployment</jkube.enricher.jkube-controller.type> is not working as expected with OpenShift Maven Plugin.

See how these flags interact

@manusa manusa added the documentation Improvements or additions to documentation label Apr 13, 2021
@manusa manusa added this to the 1.3.0 milestone Apr 13, 2021
@manusa manusa added the bug Something isn't working label Apr 13, 2021
@rohanKanojia rohanKanojia self-assigned this Apr 14, 2021
@rohanKanojia
Copy link
Member

<jkube.enricher.jkube-controller.type>Deployment</jkube.enricher.jkube-controller.type> is not working in openshift mode since OpenShift mode also depends on an additional condition platformMode == PlatformMode.openshift && useDeploymentForOpenShift()
https://github.com/eclipse/jkube/blob/a2205dc2e90716cd6d715bcacd9fcc569d2dee59/jkube-kit/enricher/generic/src/main/java/org/eclipse/jkube/enricher/generic/DefaultControllerEnricher.java#L121

https://github.com/eclipse/jkube/blob/a2205dc2e90716cd6d715bcacd9fcc569d2dee59/jkube-kit/enricher/api/src/main/java/org/eclipse/jkube/kit/enricher/api/BaseEnricher.java#L218-L220

rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Apr 15, 2021
+ Added documentation for `jkube.build.switchToDeployment` flag
@manusa
Copy link
Member Author

manusa commented Apr 15, 2021

Both configurations should be independent of each other.

This means that if I state <jkube.enricher.jkube-controller.type>Deployment</jkube.enricher.jkube-controller.type> the switchToDeployment flag shouldn't be required/needed to be provided in addition to.

The switchToDeployment flag seems to be very specific, so probably can be used in specific deployment scenarios where I want to override the standard configuration in a quick way. So IMO, this should take precedence over any other configuration (not so sure about fragments).

@rohanKanojia
Copy link
Member

If I refactor DefaultControllerEnricher to remove switchToDeployment specific code, I'm still not able to see Deployment being generated. Looks like DeploymentConfigEnricher forcibly converts Deployment to DeploymentConfig on platform mode OpenShift. I'm not sure how one enricher can check how other enricher is configured(without checking property value).

However, if I manually disable DeploymentConfig enricher like this. I'm able to see Deployment getting generated with <jkube.enricher.jkube-controller.type>Deployment</jkube.enricher.jkube-controller.type>:

            <configuration>
              <enricher>
                <excludes>
                  <exclude>jkube-openshift-deploymentconfig</exclude>
                </excludes>
              </enricher>
            </configuration>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants