Skip to content

Commit e439ee0

Browse files
committed
fix: add nil-safety guards for global imagePullSecrets
Guard against nil values when .Values.global or .Values.global.imagePullSecrets is undefined by checking .Values.global exists before accessing its keys and using default empty lists in concat to prevent template errors when used as a subchart.
1 parent 55c3ac9 commit e439ee0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

charts/chromadb-chart/templates/statefulset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ spec:
2727
spec:
2828
securityContext: {{ toYaml .Values.podSpec.securityContext | nindent 8 }}
2929
terminationGracePeriodSeconds: {{ .Values.podSpec.terminationGracePeriodSeconds }}
30-
{{- if or .Values.imagePullSecrets .Values.global.imagePullSecrets }}
30+
{{- if or .Values.imagePullSecrets (and .Values.global .Values.global.imagePullSecrets) }}
3131
imagePullSecrets:
32-
{{- toYaml (concat .Values.global.imagePullSecrets .Values.imagePullSecrets) | nindent 8 }}
32+
{{- toYaml (concat (default list .Values.global.imagePullSecrets) (default list .Values.imagePullSecrets)) | nindent 8 }}
3333
{{- end }}
3434
{{- with .Values.nodeSelector }}
3535
nodeSelector:

0 commit comments

Comments
 (0)