-
Notifications
You must be signed in to change notification settings - Fork 57
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
Globally injected variables do not work in subcharts/dependencies #1066
Comments
We likely need to go around here:
And
Other useful references: |
FYI we actually set |
Hi, I believe a workaround for this could be, something like this in the Jenkinsfile: odsComponentPipeline(
imageStreamTag: 'ods/jenkins-agent-golang:4.x',
branchToEnvironmentMapping: [
'master': 'dev',
// 'release/': 'test'
],
resourceRequestMemory: '2Gi',
resourceLimitMemory: '16Gi'
) { context ->
// [...] typical pipeline code [...]
odsComponentStageRolloutOpenShiftDeployment(context, [
'selector': "app.kubernetes.io/instance=${context.componentId}",
'helmValues': [
'global.imageTag': context.shortGitCommit,
]
])
} Given the following source: (this lives in a subchart under
this leads to a resource like that:
|
@dvvanessastoiber did you get a chance to give this a try? |
@serverhorror Thank you for providing this workaround and apologies for the delayed response! I have tested it and have a few open questions: Prerequisites: We edited our base helm chart that now uses the global imageTag if it is set. To my understanding, the DEV environment does not have any generated tags in the ImageStream and the actual version of the application image can be used. In contrast to that, QA and PROD only have ODS generated tags in the ImageStream (see screenshot below).
Please let me know what you think regarding those points and kindly let me know if we should have a call to discuss this in detail! Thank you! |
@serverhorror Did you have time to look into this yet? Thank you for your support! |
Describe the bug
In the MRO pipeline, Jenkins sets the parameter imageTag during the helm install. If the deployment.yaml is located in a dependent chart (charts/ folder) and contains
image: "{{ .Values.image.repository }}:{{ .Values.imageTag }}"
, helm cannot overwrite imageTag. This can only be achieved by accessing and setting the global parameterimage: "{{ .Values.image.repository }}:{{ .Values.global.imageTag }}"
;--set global.imageTag=x.x.x
To Reproduce
Steps to reproduce the behavior:
helm template . -f values.yaml -f values.dev.yaml -f secrets.dev.yaml --set registry=image-registry.openshift-image-registry.svc:5000 --set componentId=<componentId> --set imageNamespace=<project>-dev --set imageTag=abc
helm template . -f values.yaml -f values.dev.yaml -f secrets.dev.yaml --set registry=image-registry.openshift-image-registry.svc:5000 --set componentId=<componentId> --set imageNamespace=<project>-dev --set global.imageTag=abc
Expected behavior
imageTag should be set by MRO pipeline
Screenshots
Affected version:
The text was updated successfully, but these errors were encountered: