fix(helm): wire envFrom secrets and configmaps into migrations job (closes #30311)

This commit is contained in:
tsushanth 2026-08-08 06:05:41 -07:00
parent e24a9146e3
commit 66c930a230
2 changed files with 64 additions and 0 deletions

View file

@ -89,6 +89,15 @@ spec:
{{- end }}
- name: DISABLE_SCHEMA_UPDATE
value: "false" # always run the migration from the Helm PreSync hook, override the value set
envFrom:
{{- range .Values.environmentSecrets }}
- secretRef:
name: {{ . }}
{{- end }}
{{- range .Values.environmentConfigMaps }}
- configMapRef:
name: {{ . }}
{{- end }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}

View file

@ -223,6 +223,61 @@ tests:
name: init-tpl
image: "ghcr.io/berriai/litellm-database:test"
command: ["echo", "hello"]
- it: should work with environmentSecrets
template: migrations-job.yaml
set:
migrationJob:
enabled: true
environmentSecrets:
- litellm-env-secret
- litellm-extra-secret
asserts:
- contains:
path: spec.template.spec.containers[0].envFrom
content:
secretRef:
name: litellm-env-secret
- contains:
path: spec.template.spec.containers[0].envFrom
content:
secretRef:
name: litellm-extra-secret
- it: should work with environmentConfigMaps
template: migrations-job.yaml
set:
migrationJob:
enabled: true
environmentConfigMaps:
- litellm-env-configmap
asserts:
- contains:
path: spec.template.spec.containers[0].envFrom
content:
configMapRef:
name: litellm-env-configmap
- it: should work with both environmentSecrets and environmentConfigMaps
template: migrations-job.yaml
set:
migrationJob:
enabled: true
environmentSecrets:
- litellm-env-secret
environmentConfigMaps:
- litellm-env-configmap
asserts:
- contains:
path: spec.template.spec.containers[0].envFrom
content:
secretRef:
name: litellm-env-secret
- contains:
path: spec.template.spec.containers[0].envFrom
content:
configMapRef:
name: litellm-env-configmap
- it: should work with extraContainers
template: migrations-job.yaml
set: