[COMMON] Use readinessCheck template inside certInitializer
[oom.git] / kubernetes / common / certInitializer / templates / _certInitializer.yaml
index 7ac360b..1250c12 100644 (file)
 {{-   $dot := default . .dot -}}
 {{-   $initRoot := default $dot.Values.certInitializer .initRoot -}}
 {{-   $initName := default "certInitializer" -}}
-{{/* Our version of helm doesn't support deepCopy so we need this nasty trick */}}
-{{- $subchartDot := mergeOverwrite (deepCopy (omit $dot "Values")) (dict "Chart" (set (fromJson (toJson $dot.Chart)) "Name" $initRoot.nameOverride) "Values" (mergeOverwrite (deepCopy $initRoot) (dict "global" $dot.Values.global))) }}
-- name: {{ include "common.name" $dot }}-aaf-readiness
-  image: "{{ $subchartDot.Values.global.readinessRepository }}/{{ $subchartDot.Values.global.readinessImage }}"
-  imagePullPolicy: {{ $subchartDot.Values.global.pullPolicy | default $subchartDot.Values.pullPolicy }}
-  command:
-  - /root/ready.py
-  args:
-  - --container-name
-  - aaf-locate
-  - --container-name
-  - aaf-cm
-  - --container-name
-  - aaf-service
-  env:
-  - name: NAMESPACE
-    valueFrom:
-      fieldRef:
-        apiVersion: v1
-        fieldPath: metadata.namespace
+{{- $subchartDot := fromJson (include "common.subChartDot" (dict "dot" $dot "initRoot" $initRoot)) }}
+{{ include "common.readinessCheck.waitFor" $subchartDot }}
 - name: {{ include "common.name" $dot }}-aaf-config
-  image: {{ (default $subchartDot.Values.repository $subchartDot.Values.global.repository) }}/{{ $subchartDot.Values.global.aafAgentImage }}
+  image: {{ include "common.repository" $subchartDot }}/{{ $subchartDot.Values.global.aafAgentImage }}
   imagePullPolicy: {{ $subchartDot.Values.global.pullPolicy | default $subchartDot.Values.pullPolicy }}
   volumeMounts:
   - mountPath: {{ $initRoot.mountPath }}