This commit is contained in:
Stavros kois
2023-01-29 11:39:00 +02:00
parent 69fed00cc5
commit 8fd634cb38
4 changed files with 17 additions and 6 deletions
@@ -79,9 +79,8 @@ tests:
path: spec.jobTemplate.spec.template.spec.imagePullSecrets
- isNull:
path: spec.jobTemplate.spec.template.spec.runtimeClassName
- equal:
- isNull:
path: spec.jobTemplate.spec.template.spec.terminationGracePeriodSeconds
value: 10
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].name
value: RELEASE-NAME-common-test-job-main
+13
View File
@@ -3,3 +3,16 @@ service:
ports:
main:
port: 65535
controllers:
main:
type: CronJob
schedule: "* * * * *"
pod:
containers:
main:
securityContext:
runAsUser: 1000
runAsGroup: 1000
capabilities:
add:
- something
@@ -189,7 +189,7 @@
{{- end -}}
{{- end -}}
{{- else -}} {{/* Otherwise use the job's podSecCont values (if empty, will use the global defaults) */}}
{{- with (include "ix.v1.common.container.podSecurityContext" (dict "podSecCont" $values.podSecurityContext "root" $root "isJob" true) | trim) -}}
{{- with (include "ix.v1.common.container.podSecurityContext" (dict "podSecCont" $root.Values.podSecurityContext "root" $root "isJob" true) | trim) -}}
{{- $secCont = . -}}
{{- end -}}
{{- end -}}
@@ -18,9 +18,9 @@
{{/* Add the .Values as the main container and as pod */}}
{{/* This needs some redesign tbh */}}
{{- $_ := set $jobValues "podSpec" (mustDeepCopy $.Values) -}}
{{- $_ := set $jobValues "podSpec" (mustDeepCopy $.Values.controllers.main) -}}
{{- $_ := set $jobValues.podSpec "containers" dict -}}
{{- $_ := set $jobValues.podSpec.containers "main" .Values -}}
{{- $_ := set $jobValues.podSpec.containers "main" .Values.controllers.main.pod.containers.main -}}
{{- $_ := set $jobValues.podSpec.containers.main "enabled" "true" -}}
{{/* Add labels/annotations if any. */}}
@@ -46,7 +46,6 @@
{{- end -}}
{{/* Add $jobValues to a "main" $job, now the spawner has the "usual" format */}}
{{- $_ := set $jobs "main" $jobValues -}}
{{- else -}}
{{/* If it's not "standalone" Use the jobs dict */}}