X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2FreadinessCheck%2Ftemplates%2F_readinessCheck.tpl;h=51791fec13d0b657dc1beea488994504b453f5db;hb=d518f733756ef9d9b1b7015d509906152d6a1288;hp=879be1288f4001dcc9e9b871ca2f7398829f61ca;hpb=148634b5a6d0d0a8abaee04f416dbae6d6814e38;p=oom.git diff --git a/kubernetes/common/readinessCheck/templates/_readinessCheck.tpl b/kubernetes/common/readinessCheck/templates/_readinessCheck.tpl index 879be1288f..51791fec13 100644 --- a/kubernetes/common/readinessCheck/templates/_readinessCheck.tpl +++ b/kubernetes/common/readinessCheck/templates/_readinessCheck.tpl @@ -42,6 +42,14 @@ pods: - test-pod + the powerful one allows also to wait for a service to be + available, which means all pods are deployed, which are + selected by the service definition: + wait_for: + name: myservice + services: + - mariadb-galera-service + the powerful one allows also to wait for pods with the given "app" label: wait_for: @@ -62,8 +70,8 @@ - .dot : environment (.) - .initRoot : the root dictionary of readinessCheck submodule (default to .Values.readinessCheck) - - .wait_for : list of containers / pods /apps / jobs to wait for (default to - .Values.wait_for) + - .wait_for : list of service / containers / pods /apps / jobs to wait for + (default to .Values.wait_for) Example calls: {{ include "common.readinessCheck.waitFor" . }} @@ -76,6 +84,7 @@ {{- $subchartDot := fromJson (include "common.subChartDot" (dict "dot" $dot "initRoot" $initRoot)) }} {{- $wait_for := default $initRoot.wait_for .wait_for -}} {{- $containers := index (ternary (dict "containers" $wait_for) $wait_for (kindIs "slice" $wait_for)) "containers" -}} +{{- $services := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "services" -}} {{- $pods := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "pods" -}} {{- $apps := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "apps" -}} {{- $namePart := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "name" -}} @@ -97,6 +106,10 @@ - --pod-name - {{ tpl $pod $dot }} {{- end }} + {{- range $service := default (list) $services }} + - --service-name + - {{ tpl $service $dot }} + {{- end }} {{- range $app := default (list) $apps }} - --app-name - {{ tpl $app $dot }}