From e79af169b99aad739e07cb71f64584285ec42194 Mon Sep 17 00:00:00 2001 From: alexlebens Date: Thu, 18 Apr 2024 01:35:19 -0600 Subject: [PATCH] calculate length of array separately --- charts/postgres-cluster/Chart.yaml | 2 +- charts/postgres-cluster/templates/_bootstrap.tpl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index 1d2657d..7d267f2 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 2.3.2 +version: 2.3.3 description: Chart for cloudnative-pg cluster keywords: - database diff --git a/charts/postgres-cluster/templates/_bootstrap.tpl b/charts/postgres-cluster/templates/_bootstrap.tpl index 75e0626..12455e2 100644 --- a/charts/postgres-cluster/templates/_bootstrap.tpl +++ b/charts/postgres-cluster/templates/_bootstrap.tpl @@ -26,7 +26,8 @@ bootstrap: import: type: {{ .Values.replica.importType }} databases: - {{- if and ((len .Values.replica.importDatabases) gt 1) (.Values.replica.importType eq "microservice") }} + {{ $length := len .Values.replica.importDatabases | int }} + {{- if and ($length gt 1) (.Values.replica.importType eq "microservice") }} {{ fail "Too many databases in import type of microservice!" }} {{- else}} {{- with .Values.replica.importDatabases }}