Skip to content

Commit fa31bef

Browse files
committed
fix: plugin configuration passthrough
Signed-off-by: Itay Grudev <itay@verito.digital>
1 parent f9f7d53 commit fa31bef

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

charts/cluster/templates/cluster.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,23 @@ spec:
153153
{{ include "cluster.externalClusters" . | nindent 2 -}}
154154
{{ include "cluster.backup" . | nindent 2 -}}
155155

156-
{{- if gt (len .Values.cluster.plugins) 0 }}
156+
{{- if or (gt (len .Values.cluster.plugins) 0) (eq (include "cluster.barmanPluginRequired" .) "true") }}
157157
plugins:
158158
{{ $pluginsWithoutBarman := include "helpers.omitKeyValue" (list .Values.cluster.plugins (list (list "name" "barman-cloud.cloudnative-pg.io"))) | fromYamlArray }}
159159
{{- range $pluginsWithoutBarman -}}
160160
- {{ toYaml . | indent 6 | trim }}
161161
{{- end }}
162162
{{- if or (eq (include "cluster.barmanPluginEnabled" .) "true") (eq (include "cluster.barmanPluginRequired" .) "true") }}
163-
{{- $barmanPlugin := include "helpers.fetchKeyValue" (list .Values.cluster.plugins (list (list "name" "barman-cloud.cloudnative-pg.io"))) | fromYaml -}}
163+
{{- $barmanPlugin := include "helpers.fetchKeyValue" (list .Values.cluster.plugins (list (list "name" "barman-cloud.cloudnative-pg.io"))) | fromYaml }}
164164
- name: barman-cloud.cloudnative-pg.io
165-
enabled: {{ eq (include "cluster.barmanPluginRequired" .) "true" | default $barmanPlugin.enabled }}
166-
isWALArchiver: {{ eq (include "cluster.barmanPluginRequired" .) "true" | default $barmanPlugin.isWALArchiver }}
165+
enabled: {{ eq $barmanPlugin.enabled nil | ternary (eq (include "cluster.barmanPluginRequired" .) "true") $barmanPlugin.enabled }}
166+
isWALArchiver: {{ eq $barmanPlugin.isWALArchiver nil | ternary (eq (include "cluster.barmanPluginRequired" .) "true") $barmanPlugin.isWALArchiver }}
167167
parameters:
168-
{{- $parameters := (omit (coalesce $barmanPlugin.parameters dict) "barmanObjectName") -}}
169-
{{ with $parameters }}
170-
{{ toYaml . | indent 8 | trim }}
168+
{{- $parameters := (coalesce $barmanPlugin.parameters dict) -}}
169+
{{- $parametersWithoutObjectName := (omit $parameters "barmanObjectName") }}
170+
{{ with $parametersWithoutObjectName }}
171+
{{- toYaml . | indent 8 | trim }}
171172
{{- end }}
172-
barmanObjectName: {{ printf "%s-backups" (include "cluster.fullname" .) | default $barmanPlugin.barmanObjectName }}-backups
173+
barmanObjectName: {{ $parameters.barmanObjectName | default (printf "%s-backups" (include "cluster.fullname" .)) }}
173174
{{- end }}
174175
{{- end }}

0 commit comments

Comments
 (0)