-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix(argo-workflows): container and mainContainer imagePullPolicy #3126
base: main
Are you sure you want to change the base?
Conversation
@@ -31,7 +31,7 @@ data: | |||
{{- with .Values.controller.initialDelay }} | |||
initialDelay: {{ . }} | |||
{{- end }} | |||
{{- if or .Values.mainContainer.resources .Values.mainContainer.env .Values.mainContainer.envFrom .Values.mainContainer.securityContext}} | |||
{{- if or .Values.images.pullPolicy .Values.mainContainer}} | |||
mainContainer: | |||
imagePullPolicy: {{ default (.Values.images.pullPolicy) .Values.mainContainer.imagePullPolicy }} | |||
{{- with .Values.mainContainer.resources }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this will work any more will it?
You need to add the if .Values.mainContainer.resources
back in here for example. repeat for all the other things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I re-read my MR description, and it seems it was unclear my bad. I updated it so please, take a look
With this modification, I expect the config map to contains a "mainContainer" in any case with :
a. if they are no "mainContainer.imagePullPolicy" in the values files, I expect it to be the same as "Values.images.pullPolicy"
b. if they are a "mainContainer.imagePullPolicy" in the values file, I want the according values to match
(and same with executor)
The issue with the current release is this test :
{{- if or .Values.mainContainer.resources .Values.mainContainer.env .Values.mainContainer.envFrom .Values.mainContainer.securityContext}}
It don't work if we only set "mainContainer.imagePullPolicy" value. But if we trick the chart with a dummy resources for example, the test is triggered and we got a correct pull policy (the one specified by the user, and the images.pullPolicy as a fallback)
I run the followings tests, and it seems to work as described bellow :
With an empty values.yaml
With the current release (0.45.4) we obtain this config-map :
data:
config: |
nodeEvents:
enabled: true
workflowEvents:
enabled: true
And with this chart, this one :
data:
config: |
mainContainer:
imagePullPolicy: Always
executor:
imagePullPolicy: Always
nodeEvents:
enabled: true
workflowEvents:
enabled: true
With a pullPolicy set
With the following values.yaml :
mainContainer:
imagePullPolicy: "IfNotPresent"
With the current release, we obtain the same config-map as before. And with this chart we obtain :
data:
config: |
mainContainer:
imagePullPolicy: IfNotPresent
executor:
imagePullPolicy: Always
nodeEvents:
enabled: true
workflowEvents:
enabled: true
I made those tests with a freshly installed minikube.
@@ -31,7 +31,7 @@ data: | |||
{{- with .Values.controller.initialDelay }} | |||
initialDelay: {{ . }} | |||
{{- end }} | |||
{{- if or .Values.mainContainer.resources .Values.mainContainer.env .Values.mainContainer.envFrom .Values.mainContainer.securityContext}} | |||
{{- if or .Values.images.pullPolicy .Values.mainContainer}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would also cause errors now if there's data missing. .Values.mainContainer
is too broad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this chart, Argo Workflow runs with an empty values.yaml (or with wrong keys) and is able to run workflows (tested with minikube, latest release and this dummy workflow).
But I understand that we want something more predictable, so I can rollback to the more specific test (with mainContainer.resources
, mainContainer.securityContext
etc...)
Checklist:
I found a strange behavior with the mainContainer "imagePullPolicy" (and the same with executor since they work similary).
With the current release, if I apply the chart with the following values.yaml
My controller config-map does not have the expecting output :
When we only set imagePullPolicy option for the mainContainer or the executor, it’s not applied.
Plus, the doc specifies that the default value for those fields are "Values.images.pullPolicy". So, I expect the config map to contains according pull policy for executor and main container when I apply the chart with an empty values.yaml, but it's not the case, I obtain the same config map mentioned earlier.
It’s my first contribution, I have read the CONTRIBUTING.md but any feedback is welcome !