Skip to content

Commit

Permalink
chore: fix config.yaml template condition (#159)
Browse files Browse the repository at this point in the history
Signed-off-by: Niccolò Fei <[email protected]>
  • Loading branch information
NiccoloFei authored Jun 10, 2024
1 parent ec68241 commit 77ee732
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ metadata:
{{- end }}
data:
{{- toYaml .Values.config.data | nindent 2 }}
{{- end }}
{{- else -}}
{{- else }}
apiVersion: v1
kind: Secret
type: Opaque
Expand All @@ -42,3 +41,4 @@ metadata:
stringData:
{{- toYaml .Values.config.data | nindent 2 }}
{{- end }}
{{- end }}
12 changes: 9 additions & 3 deletions charts/edb-postgres-for-kubernetes/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
{{- if .Values.config.clusterWide -}}
{{- if .Values.config.clusterWide -}}
{{- toYaml .Values.config.data | nindent 2 }}
{{- else -}}
{{- $watchNamespaceMap := dict "WATCH_NAMESPACE" .Release.Namespace -}}
{{- $fullConfiguration := merge .Values.config.data $watchNamespaceMap -}}
{{- toYaml $fullConfiguration | nindent 2 }}
{{- end -}}
{{- end }}
{{- else -}}
{{- else }}
apiVersion: v1
kind: Secret
type: Opaque
Expand All @@ -46,5 +45,12 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
stringData:
{{- if .Values.config.clusterWide -}}
{{- toYaml .Values.config.data | nindent 2 }}
{{- else -}}
{{- $watchNamespaceMap := dict "WATCH_NAMESPACE" .Release.Namespace -}}
{{- $fullConfiguration := merge .Values.config.data $watchNamespaceMap -}}
{{- toYaml $fullConfiguration | nindent 2 }}
{{- end -}}
{{- end }}
{{- end }}

0 comments on commit 77ee732

Please sign in to comment.