diff --git a/charts/trino/templates/configmap-catalog.yaml b/charts/trino/templates/configmap-catalog.yaml index 74ef1b16..0a148ca8 100644 --- a/charts/trino/templates/configmap-catalog.yaml +++ b/charts/trino/templates/configmap-catalog.yaml @@ -1,4 +1,4 @@ -{{- if or .Values.catalogs .Values.additionalCatalogs }} +{{- if or .Values.additionalCatalogs (and (.Values.catalogs) (gt (len .Values.catalogs) 0)) }} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/trino/templates/deployment-coordinator.yaml b/charts/trino/templates/deployment-coordinator.yaml index b8008b1e..f1789552 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -28,7 +28,7 @@ spec: {{- if and (eq .Values.accessControl.type "configmap") (not .Values.accessControl.refreshPeriod) }} checksum/access-control-config: {{ include (print $.Template.BasePath "/configmap-access-control-coordinator.yaml") . | sha256sum }} {{- end }} - {{- if or .Values.catalogs .Values.additionalCatalogs }} + {{- if or .Values.additionalCatalogs (and (.Values.catalogs) (gt (len .Values.catalogs) 0)) }} checksum/catalog-config: {{ include (print $.Template.BasePath "/configmap-catalog.yaml") . | sha256sum }} {{- end }} checksum/coordinator-config: {{ include (print $.Template.BasePath "/configmap-coordinator.yaml") . | sha256sum }} @@ -56,7 +56,7 @@ spec: - name: config-volume configMap: name: {{ template "trino.coordinator" . }} - {{- if or .Values.catalogs .Values.additionalCatalogs }} + {{- if or .Values.additionalCatalogs (and (.Values.catalogs) (gt (len .Values.catalogs) 0)) }} - name: catalog-volume configMap: name: {{ template "trino.catalog" . }} @@ -140,7 +140,7 @@ spec: volumeMounts: - mountPath: {{ .Values.server.config.path }} name: config-volume - {{- if or .Values.catalogs .Values.additionalCatalogs }} + {{- if or .Values.additionalCatalogs (and (.Values.catalogs) (gt (len .Values.catalogs) 0)) }} - mountPath: {{ .Values.server.config.path }}/catalog name: catalog-volume {{- end }} diff --git a/charts/trino/templates/deployment-worker.yaml b/charts/trino/templates/deployment-worker.yaml index 4b0ad81e..b4cdf7f5 100644 --- a/charts/trino/templates/deployment-worker.yaml +++ b/charts/trino/templates/deployment-worker.yaml @@ -29,7 +29,7 @@ spec: template: metadata: annotations: - {{- if or .Values.catalogs .Values.additionalCatalogs }} + {{- if or .Values.additionalCatalogs (and (.Values.catalogs) (gt (len .Values.catalogs) 0)) }} checksum/catalog-config: {{ include (print $.Template.BasePath "/configmap-catalog.yaml") . | sha256sum }} {{- end }} checksum/worker-config: {{ include (print $.Template.BasePath "/configmap-worker.yaml") . | sha256sum }} @@ -59,7 +59,7 @@ spec: - name: config-volume configMap: name: {{ template "trino.worker" . }} - {{- if or .Values.catalogs .Values.additionalCatalogs }} + {{- if or .Values.additionalCatalogs (and (.Values.catalogs) (gt (len .Values.catalogs) 0)) }} - name: catalog-volume configMap: name: {{ template "trino.catalog" . }} @@ -126,7 +126,7 @@ spec: volumeMounts: - mountPath: {{ .Values.server.config.path }} name: config-volume - {{- if or .Values.catalogs .Values.additionalCatalogs }} + {{- if or .Values.additionalCatalogs (and (.Values.catalogs) (gt (len .Values.catalogs) 0)) }} - mountPath: {{ .Values.server.config.path }}/catalog name: catalog-volume {{- end }}