diff --git a/charts/cluster/templates/_barman_object_store.tpl b/charts/cluster/templates/_barman_object_store.tpl index b7b8981f30..4fdb368698 100644 --- a/charts/cluster/templates/_barman_object_store.tpl +++ b/charts/cluster/templates/_barman_object_store.tpl @@ -5,9 +5,11 @@ {{- end }} {{- if or (.scope.endpointCA.create) (.scope.endpointCA.name) }} + {{- $endpointCAName := coalesce .scope.endpointCA.name (printf "%s-ca-bundle" .chartFullname) }} + {{- $endpointCAKey := default "ca-bundle.crt" .scope.endpointCA.key }} endpointCA: - name: {{ .scope.endpointCA.name }} - key: {{ .scope.endpointCA.key }} + name: {{ $endpointCAName }} + key: {{ $endpointCAKey }} {{- end }} {{- if .scope.destinationPath }} diff --git a/charts/cluster/templates/databases.yaml b/charts/cluster/templates/databases.yaml index d701b7bed7..b65f2069b3 100644 --- a/charts/cluster/templates/databases.yaml +++ b/charts/cluster/templates/databases.yaml @@ -1,4 +1,5 @@ {{- range .Values.databases }} +{{- $dbOwner := default .name .owner }} --- apiVersion: postgresql.cnpg.io/v1 kind: Database @@ -19,18 +20,18 @@ spec: cluster: name: {{ include "cluster.fullname" $ }} ensure: {{ .ensure | default "present" }} - owner: {{ .owner }} + owner: {{ $dbOwner }} template: {{ .template | default "template1" }} encoding: {{ .encoding | default "UTF8" }} databaseReclaimPolicy: {{ .databaseReclaimPolicy | default "retain" }} - {{- with .isTemplate }} - isTemplate: {{ . }} + {{- if hasKey . "isTemplate" }} + isTemplate: {{ .isTemplate }} {{- end }} - {{- with .allowConnections }} - allowConnections: {{ . }} + {{- if hasKey . "allowConnections" }} + allowConnections: {{ .allowConnections }} {{- end }} - {{- with .connectionLimit }} - connectionLimit: {{ . }} + {{- if hasKey . "connectionLimit" }} + connectionLimit: {{ .connectionLimit }} {{- end }} {{- with .tablespace }} tablespace: {{ . }} @@ -63,7 +64,7 @@ spec: schemas: {{- range . }} - name: {{ .name }} - owner: {{ .owner }} + owner: {{ default $dbOwner .owner }} ensure: {{ .ensure | default "present" }} {{- end }} {{- end }}