diff --git a/scripts/commands/helm.sh b/scripts/commands/helm.sh index 91b581bc..fa23d8fa 100644 --- a/scripts/commands/helm.sh +++ b/scripts/commands/helm.sh @@ -84,7 +84,12 @@ helm_wrapper() { _literal="" fi - opt_prefix="${literal%%=*}=" + opt_prefix="${literal%%=*}" + + if [ "$opt_prefix" != "" ]; then + opt_prefix="${opt_prefix}=" + fi + literal="${literal#*=}" # Force secret backend diff --git a/tests/http.yaml b/tests/http.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/unit/template.bats b/tests/unit/template.bats index 0ebca5c7..a4bc3ebb 100755 --- a/tests/unit/template.bats +++ b/tests/unit/template.bats @@ -2136,3 +2136,29 @@ key2: value" 2>&1 assert_success assert_file_not_exists "${VALUES_PATH}.dec" } + +@test "template: helm template w/ chart + --set imagePullSecrets={fr,en,de,zh,ko}" { + create_chart "${TEST_TEMP_DIR}" + + run "${HELM_BIN}" secrets template --set "imagePullSecrets={fr,en,de,zh,ko}" "${TEST_TEMP_DIR}/chart" 2>&1 + + assert_output --partial "- fr" + assert_output --partial "- en" + assert_output --partial "- de" + assert_output --partial "- zh" + assert_output --partial "- ko" + assert_success +} + +@test "template: helm template w/ chart + --set imagePullSecrets={fr,en,de,zh,ko} with quoted values" { + create_chart "${TEST_TEMP_DIR}" + + run "${HELM_BIN}" secrets template --set "imagePullSecrets={"fr","en","de","zh","ko"}" "${TEST_TEMP_DIR}/chart" 2>&1 + + assert_output --partial "- fr" + assert_output --partial "- en" + assert_output --partial "- de" + assert_output --partial "- zh" + assert_output --partial "- ko" + assert_success +} \ No newline at end of file