[COMMON][OTHERS] Fix dependency conditions 72/133972/5
authorAndreas Geissler <andreas-geissler@telekom.de>
Fri, 31 Mar 2023 10:07:23 +0000 (12:07 +0200)
committerAndreas Geissler <andreas-geissler@telekom.de>
Fri, 7 Apr 2023 11:04:23 +0000 (11:04 +0000)
In case of local DB the "init" dependency is activated
as the "not" condition is not working

Issue-ID: OOM-3152

Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Change-Id: I27dba69a644bbcc2b61245c22784976ba7c66173

15 files changed:
kubernetes/common/network-name-gen/Chart.yaml
kubernetes/common/network-name-gen/values.yaml
kubernetes/contrib/components/ejbca/Chart.yaml
kubernetes/contrib/components/ejbca/values.yaml
kubernetes/holmes/Chart.yaml
kubernetes/holmes/components/holmes-engine-mgmt/templates/deployment.yaml
kubernetes/holmes/components/holmes-engine-mgmt/values.yaml
kubernetes/holmes/components/holmes-rule-mgmt/templates/deployment.yaml
kubernetes/holmes/components/holmes-rule-mgmt/values.yaml
kubernetes/holmes/values.yaml
kubernetes/modeling/components/modeling-etsicatalog/Chart.yaml
kubernetes/modeling/components/modeling-etsicatalog/templates/deployment.yaml
kubernetes/modeling/components/modeling-etsicatalog/values.yaml
kubernetes/nbi/Chart.yaml
kubernetes/nbi/values.yaml

index 17eaa68..08d5014 100644 (file)
@@ -33,4 +33,4 @@ dependencies:
   - name: mariadb-init\r
     version: ~12.x-0\r
     repository: 'file://../mariadb-init'\r
-    condition: not global.mariadbGalera.localCluster
\ No newline at end of file
+    condition: global.mariadbGalera.globalCluster
\ No newline at end of file
index dcf85fe..8b8848b 100644 (file)
@@ -26,7 +26,10 @@ global:
 
   mariadbGalera: &mariadbGalera
     #This flag allows SO to instantiate its own mariadb-galera cluster
+    #When changing it to "true", also set "globalCluster: false"
+    #as the dependency check will not work otherwise (Chart.yaml)
     localCluster: false
+    globalCluster: true
     service: mariadb-galera
     internalPort: 3306
     nameOverride: mariadb-galera
index e8a0134..5c7ec25 100644 (file)
@@ -30,7 +30,7 @@ dependencies:
   - name: mariadb-init
     version: ~12.x-0
     repository: '@local'
-    condition: not global.mariadbGalera.localCluster
+    condition: global.mariadbGalera.globalCluster
   - name: repositoryGenerator
     version: ~12.x-0
     repository: '@local'
index b777a7d..c223f41 100644 (file)
 # limitations under the License.
 global:
   mariadbGalera: &mariadbGalera
-    #This flag allows EJBCA to instantiate its own mariadb-galera cluster
+    #This flag allows SO to instantiate its own mariadb-galera cluster
+    #When changing it to "true", also set "globalCluster: false"
+    #as the dependency check will not work otherwise (Chart.yaml)
     localCluster: false
+    globalCluster: true
     service: mariadb-galera
     internalPort: 3306
     nameOverride: mariadb-galera
index 971d81c..8f8e91d 100644 (file)
@@ -34,7 +34,7 @@ dependencies:
   - name: postgres-init
     version: ~12.x-0
     repository: '@local'
-    condition: not global.postgres.localCluster
+    condition: global.postgres.globalCluster
   - name: holmes-rule-mgmt
     version: ~12.x-0
     repository: 'file://components/holmes-rule-mgmt'
index cdf5327..fdbca09 100644 (file)
@@ -34,8 +34,10 @@ spec:
     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
       initContainers:
-      {{- if not .Values.global.postgres.localCluster }}
-      {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }}
+      {{- if .Values.global.postgres.localCluster }}
+      {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local ) | indent 6 | trim }}
+      {{ else }}
+      {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global ) | indent 6 | trim }}
       {{- end }}
       - name: {{ include "common.name" . }}-env-config
         image: {{ include "repositoryGenerator.image.envsubst" . }}
index c9c62e7..028ca8d 100644 (file)
@@ -123,9 +123,11 @@ resources:
   unlimited: {}
 
 readinessCheck:
-  wait_for:
+  wait_for_global:
     jobs:
       - '{{ include "common.release" . }}-holmes-postgres-init-config-job'
+  wait_for_local:
+    - '{{ .Values.global.postgres.container.name }}'
 
 #Pods Service Account
 serviceAccount:
index 05def92..db0eb16 100644 (file)
@@ -33,8 +33,10 @@ spec:
     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
       initContainers:
-      {{- if not .Values.global.postgres.localCluster }}
-      {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }}
+      {{- if .Values.global.postgres.localCluster }}
+      {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local ) | indent 6 | trim }}
+      {{ else }}
+      {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global ) | indent 6 | trim }}
       {{- end }}
       - name: {{ include "common.name" . }}-env-config
         image: {{ include "repositoryGenerator.image.envsubst" . }}
index bc6639f..543b7aa 100644 (file)
@@ -135,9 +135,11 @@ resources:
   unlimited: {}
 
 readinessCheck:
-  wait_for:
+  wait_for_global:
     jobs:
       - '{{ include "common.release" . }}-holmes-postgres-init-config-job'
+  wait_for_local:
+    - '{{ .Values.global.postgres.container.name }}'
 
 #Pods Service Account
 serviceAccount:
index e8eb53d..40c3d87 100644 (file)
@@ -22,7 +22,11 @@ global:
   #Service Names of the postgres db to connect to.
   #Override it to dbc-pg if localCluster is enabled.
   postgres:
+    #This flag allows SO to instantiate its own mariadb-galera cluster
+    #When changing it to "true", also set "globalCluster: false"
+    #as the dependency check will not work otherwise (Chart.yaml)
     localCluster: false
+    globalCluster: true
     service:
       name: pgset
       name2: &postgres tcp-pgset-primary
index a90c700..b1f6c41 100644 (file)
@@ -30,7 +30,7 @@ dependencies:
   - name: mariadb-init
     version: ~12.x-0
     repository: '@local'
-    condition: not global.mariadbGalera.localCluster
+    condition: global.mariadbGalera.globalCluster
   - name: readinessCheck
     version: ~12.x-0
     repository: '@local'
index dd9c020..bfbff21 100644 (file)
@@ -41,8 +41,13 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - -j
-        - "{{ include "common.release" . }}-{{ include "common.name" . }}-config-job"
+{{- if .Values.global.mariadbGalera.localCluster }}
+        - --container-name
+        - {{ index .Values "mariadb-galera" "nameOverride" }}
+{{- else }}
+        - --job-name
+        - {{ include "common.release" . }}-{{ include "common.name" . }}-config-job
+{{- end }}
         env:
         - name: NAMESPACE
           valueFrom:
index 21abce3..c2b0dcf 100644 (file)
@@ -22,8 +22,11 @@ global:
     mountPath: /dockerdata-nfs
 
   mariadbGalera:
-    #This flag allows Modeling to instantiate its own mariadb-galera cluster
+    #This flag allows SO to instantiate its own mariadb-galera cluster
+    #When changing it to "true", also set "globalCluster: false"
+    #as the dependency check will not work otherwise (Chart.yaml)
     localCluster: false
+    globalCluster: true
     service: mariadb-galera
     internalPort: 3306
     nameOverride: mariadb-galera
index 5f27787..5365075 100644 (file)
@@ -36,7 +36,7 @@ dependencies:
   - name: mariadb-init
     version: ~12.x-0
     repository: '@local'
-    condition: not global.mariadbGalera.localCluster
+    condition: global.mariadbGalera.globalCluster
   - name: repositoryGenerator
     version: ~12.x-0
     repository: '@local'
index e2b7341..fbdf1fe 100644 (file)
@@ -20,7 +20,10 @@ global:
   nodePortPrefix: 302
   mariadbGalera: &mariadbGalera
     #This flag allows SO to instantiate its own mariadb-galera cluster
+    #When changing it to "true", also set "globalCluster: false"
+    #as the dependency check will not work otherwise (Chart.yaml)
     localCluster: false
+    globalCluster: true
     service: mariadb-galera
     internalPort: 3306
     nameOverride: mariadb-galera