mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-06 02:09:04 +00:00
63 lines
1.9 KiB
YAML
63 lines
1.9 KiB
YAML
suite: test migrations Job hook annotations
|
|
templates:
|
|
- migrations-job.yaml
|
|
values:
|
|
- ./values/required.yaml
|
|
tests:
|
|
- it: runs as a Helm pre-install / pre-upgrade hook by default
|
|
asserts:
|
|
- equal:
|
|
path: metadata.annotations["helm.sh/hook"]
|
|
value: pre-install,pre-upgrade
|
|
- equal:
|
|
path: metadata.annotations["helm.sh/hook-delete-policy"]
|
|
value: before-hook-creation
|
|
- equal:
|
|
path: metadata.annotations["helm.sh/hook-weight"]
|
|
value: "0"
|
|
- notExists:
|
|
path: metadata.annotations["argocd.argoproj.io/hook"]
|
|
|
|
- it: adds the Argo CD PreSync hook when asked
|
|
set:
|
|
migrationJob.hooks.argocd.enabled: true
|
|
asserts:
|
|
- equal:
|
|
path: metadata.annotations["argocd.argoproj.io/hook"]
|
|
value: PreSync
|
|
- equal:
|
|
path: metadata.annotations["argocd.argoproj.io/hook-delete-policy"]
|
|
value: BeforeHookCreation
|
|
|
|
- it: drops the Helm hook so Argo CD owns the Job
|
|
set:
|
|
migrationJob.hooks.argocd.enabled: true
|
|
migrationJob.hooks.helm.enabled: false
|
|
asserts:
|
|
- equal:
|
|
path: metadata.annotations["argocd.argoproj.io/hook"]
|
|
value: PreSync
|
|
- notExists:
|
|
path: metadata.annotations["helm.sh/hook"]
|
|
- notExists:
|
|
path: metadata.annotations["helm.sh/hook-delete-policy"]
|
|
- notExists:
|
|
path: metadata.annotations["helm.sh/hook-weight"]
|
|
|
|
- it: renders an ordinary Job when both hooks are disabled
|
|
set:
|
|
migrationJob.hooks.helm.enabled: false
|
|
asserts:
|
|
- notExists:
|
|
path: metadata.annotations
|
|
- equal:
|
|
path: kind
|
|
value: Job
|
|
|
|
- it: honours a custom Helm hook weight
|
|
set:
|
|
migrationJob.hooks.helm.weight: "-5"
|
|
asserts:
|
|
- equal:
|
|
path: metadata.annotations["helm.sh/hook-weight"]
|
|
value: "-5"
|