Skip to content

Commit

Permalink
Merge pull request #398 from petqa/change-helm-template-imagepullsecrets
Browse files Browse the repository at this point in the history
init new template for exists secrets
  • Loading branch information
ese committed Aug 30, 2022
2 parents 08b820d + 0a024e3 commit 585dee2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
10 changes: 7 additions & 3 deletions charts/redisoperator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ spec:
{{- include "chart.selectorLabels" $data | nindent 8 }}
spec:
serviceAccountName: {{ template "chart.serviceAccountName" . }}
{{- if .Values.imageCredentials.create }}
imagePullSecrets:
{{- if (and .Values.imageCredentials.create (not .Values.imageCredentials.existsSecrets)) }}
imagePullSecrets:
- name: {{ $fullName }}-{{ $name }}
{{- else if (and .Values.imageCredentials.create .Values.imageCredentials.existsSecrets) }}
{{- range .Values.imageCredentials.existsSecrets }}
imagePullSecrets:
{{ printf "- name: %s" . }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
Expand Down Expand Up @@ -70,4 +75,3 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}

2 changes: 1 addition & 1 deletion charts/redisoperator/templates/private-registry.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.imageCredentials.create -}}
{{- if (and .Values.imageCredentials.create (not .Values.imageCredentials.existsSecrets)) -}}
{{- $fullName := include "chart.fullname" . -}}
{{- $name := "registry" -}}
{{- $data := dict "name" $name "Chart" .Chart "Release" .Release "Values" .Values -}}
Expand Down
7 changes: 5 additions & 2 deletions charts/redisoperator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ imageCredentials:
username: someone
password: somepassword
email: [email protected]
# Use exists secrets in namespace
existsSecrets:
- registrysecret

updateStrategy:
updateStrategy:
type: RollingUpdate

# A name in place of the chart name for `app:` labels.
nameOverride: ""

Expand Down

0 comments on commit 585dee2

Please sign in to comment.