Use a regex to match --state-values-set-string arguments (#1902)

Signed-off-by: Guillaume Le Blanc <gleblanc@proton.me>
This commit is contained in:
Guillaume Le Blanc
2025-02-04 07:59:31 +08:00
committed by GitHub
parent 8e188960eb
commit 09c9ceb075
4 changed files with 15 additions and 9 deletions
@@ -11,7 +11,7 @@ if [[ ${HELMFILE_V1MODE} = true ]]; then
info "Comparing ${case_title} for v1 output ${cli_overwrite_environment_values_reverse} with ${cli_overwrite_environment_values_output_dir}/overwritten.yaml"
for i in $(seq 10); do
info "Comparing build/cli-overwrite-environment-values #$i"
${helmfile} -f ${cli_overwrite_environment_values_input_dir}/input_v1.yaml.gotmpl template --state-values-set ns=test3 > ${cli_overwrite_environment_values_reverse} || fail "\"helmfile template\" shouldn't fail"
${helmfile} -f ${cli_overwrite_environment_values_input_dir}/input_v1.yaml.gotmpl template --state-values-set ns=test3 --state-values-set-string imageTag=1.23.3,zone="zone1,zone2" > ${cli_overwrite_environment_values_reverse} || fail "\"helmfile template\" shouldn't fail"
diff -u ${cli_overwrite_environment_values_output_dir}/output_v1.yaml ${cli_overwrite_environment_values_reverse} || fail "\"helmfile template\" should be consistent"
echo code=$?
done
@@ -21,9 +21,9 @@ else
info "Comparing ${case_title} output ${cli_overwrite_environment_values_reverse} with ${cli_overwrite_environment_values_output_dir}/overwritten.yaml"
for i in $(seq 10); do
info "Comparing build/cli-overwrite-environment-values #$i"
${helmfile} -f ${cli_overwrite_environment_values_input_dir}/input_v1.yaml.gotmpl template --state-values-set ns=test3 > ${cli_overwrite_environment_values_reverse} || fail "\"helmfile template\" shouldn't fail"
${helmfile} -f ${cli_overwrite_environment_values_input_dir}/input_v1.yaml.gotmpl template --state-values-set ns=test3 --state-values-set-string imageTag=1.23.3,zone="zone1,zone2" > ${cli_overwrite_environment_values_reverse} || fail "\"helmfile template\" shouldn't fail"
diff -u ${cli_overwrite_environment_values_output_dir}/output_v1.yaml ${cli_overwrite_environment_values_reverse} || fail "\"helmfile template\" should be consistent"
echo code=$?
done
test_pass "${case_title}"
fi
fi
@@ -1,2 +1,5 @@
image:
tag: {{ .Values.ns }}
tag: {{ .Values.imageTag }}
podAnnotations:
zone: {{ .Values.zone }}
@@ -51,6 +51,7 @@ spec:
app.kubernetes.io/instance: test
app.kubernetes.io/managed-by: Helm
annotations:
zone: "zone1,zone2"
spec:
automountServiceAccountToken: false
@@ -75,7 +76,7 @@ spec:
initContainers:
containers:
- name: nginx
image: docker.io/bitnami/nginx:test3
image: docker.io/bitnami/nginx:1.23.3
imagePullPolicy: "IfNotPresent"
env:
- name: BITNAMI_DEBUG