This commit is contained in:
amarrtech 2026-11-05 19:58:20 +00:00 • committed by GitHub
commit 6eb5a2e238
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 38 additions and 2 deletions

View file

@ -28,12 +28,13 @@ spec:
metadata:
labels:
{{- include "litellm.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- with omit (default dict .Values.podLabels) "app.kubernetes.io/component" }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.migrationJob.podLabels }}
{{- with omit (default dict .Values.migrationJob.podLabels) "app.kubernetes.io/component" }}
{{- toYaml . | nindent 8 }}
{{- end }}
app.kubernetes.io/component: migration
annotations:
{{- with .Values.migrationJob.annotations }}
{{- toYaml . | nindent 8 }}

View file

@ -22,6 +22,11 @@ spec:
matchLabels:
{{- /* Match the Deployment selector to target the same pod set */ -}}
{{- include "litellm.selectorLabels" . | nindent 6 }}
matchExpressions:
- key: app.kubernetes.io/component
operator: NotIn
values:
- migration
{{- if .Values.pdb.minAvailable }}
minAvailable: {{ .Values.pdb.minAvailable }}
{{- else if .Values.pdb.maxUnavailable }}

View file

@ -21,6 +21,25 @@ tests:
content:
name: ANOTHER_VAR
value: "another_value"
- equal:
path: spec.template.metadata.labels['app.kubernetes.io/component']
value: migration
- it: should keep migration component when shared pod labels conflict
template: migrations-job.yaml
set:
podLabels:
app.kubernetes.io/component: proxy
environment: test
migrationJob:
enabled: true
asserts:
- equal:
path: spec.template.metadata.labels['app.kubernetes.io/component']
value: migration
- equal:
path: spec.template.metadata.labels.environment
value: test
- it: should work with extraEnvVars
template: migrations-job.yaml
@ -389,10 +408,14 @@ tests:
enabled: true
podLabels:
custom.io/pod-role: migration
app.kubernetes.io/component: proxy
asserts:
- equal:
path: spec.template.metadata.labels['custom.io/pod-role']
value: migration
- equal:
path: spec.template.metadata.labels['app.kubernetes.io/component']
value: migration
- it: should override container command and args
template: migrations-job.yaml

View file

@ -16,6 +16,13 @@ tests:
value:
app.kubernetes.io/name: litellm
app.kubernetes.io/instance: RELEASE-NAME
- equal:
path: spec.selector.matchExpressions
value:
- key: app.kubernetes.io/component
operator: NotIn
values:
- migration
---
suite: "pdb disabled"