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

fix: add imagePullSecrets for deployment resource #716

Merged
merged 1 commit into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/descheduler/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ spec:
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
serviceAccountName: {{ template "descheduler.serviceAccountName" . }}
{{- with .Values.imagePullSecrets }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert on the helm chart syntax, how does with handle empty values? Everywhere else we have been using if, but if the behavior is the same then it's probably fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't play with the helm much but I used it the same way as in cronjob.yaml. It is basically like an if. Also, I already tested locally for the below cases, it worked as expected.

imagePullSecrets:
imagePullSecrets: []
imagePullSecrets:
  - name: container-registry-secret

Ref:

imagePullSecrets:
{{- toYaml . | nindent 10 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}"
Expand Down
3 changes: 2 additions & 1 deletion charts/descheduler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ image:
tag: ""
pullPolicy: IfNotPresent

imagePullSecrets: []
imagePullSecrets:
# - name: container-registry-secret

resources:
requests:
Expand Down