Skip to content

Commit 8053637

Browse files
committed
conditionals for templates and error messages
1 parent efd1bed commit 8053637

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

charts/backstage/templates/network-policies.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.orchestrator.serverlessLogicOperator.enabled }}
1+
{{- if and .Values.orchestrator.enabled .Values.orchestrator.serverlessLogicOperator.enabled }}
22
apiVersion: networking.k8s.io/v1
33
kind: NetworkPolicy
44
metadata:
@@ -52,7 +52,7 @@ spec:
5252

5353
{{- end }}
5454
---
55-
{{- if .Values.orchestrator.sonataflowPlatform.monitoring.enabled }}
55+
{{- if and .Values.orchestrator.enabled .Values.orchestrator.sonataflowPlatform.monitoring.enabled }}
5656
# NetworkPolicy to allow openshift-user-workload-monitoring pods to access all pods within the workflow's namespace
5757
apiVersion: networking.k8s.io/v1
5858
kind: NetworkPolicy

charts/backstage/templates/sonataflows.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- if and (default false .Values.orchestrator.enabled) (default false .Values.orchestrator.serverlessLogicOperator.enabled) }}
22
{{- $sonataflowplatformExists := lookup "sonataflow.org/v1alpha08" "SonataFlowPlatform" .Release.Namespace "sonataflow-platform" }}
3-
{{- if $sonataflowplatformExists }}
3+
{{- if and .Release.IsInstall $sonataflowplatformExists }}
44
{{- fail "Cannot create multiple sonataflowplatform in the same namespace, one already exists." }}
55
{{- end }}
66

@@ -113,14 +113,14 @@ spec:
113113
key: password
114114
command: [ "sh", "-c" ]
115115
args:
116-
- "psql -h {{ .Release.Name }}-postgresql -U postgres -c 'CREATE DATABASE sonataflow;'"
116+
- "psql -h {{ .Release.Name }}-postgresql -U postgres -c 'CREATE DATABASE sonataflow;' || echo WARNING: Could not create database"
117117
{{- else }}
118118
secretKeyRef:
119119
name: {{ .Values.orchestrator.sonataflowPlatform.externalDBsecretRef}}
120120
key: POSTGRES_PASSWORD
121121
command: [ "sh", "-c" ]
122122
args:
123-
- "psql -h {{ .Values.upstream.backstage.appConfig.backend.database.connection.host }} -U {{ .Values.upstream.backstage.appConfig.backend.database.connection.user }} -d {{ .Values.orchestrator.sonataflowPlatform.externalDBName }} -c 'CREATE DATABASE sonataflow;'"
123+
- "psql -h {{ .Values.upstream.backstage.appConfig.backend.database.connection.host }} -U {{ .Values.upstream.backstage.appConfig.backend.database.connection.user }} -d {{ .Values.orchestrator.sonataflowPlatform.externalDBName }} -c 'CREATE DATABASE sonataflow;' || echo WARNING: Could not create database"
124124
{{- end }}
125125
restartPolicy: Never
126126
backoffLimit: 2

0 commit comments

Comments
 (0)