remove helm v2 code in tests (#648)
Signed-off-by: yxxhero <aiopsclub@163.com> Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
parent
ec60ac815b
commit
b44aaf90f7
|
|
@ -68,15 +68,6 @@ function cleanup() {
|
||||||
set -e
|
set -e
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
info "Using namespace: ${test_ns}"
|
info "Using namespace: ${test_ns}"
|
||||||
# helm v2
|
|
||||||
if helm version --client 2>/dev/null | grep '"v2\.'; then
|
|
||||||
helm_major_version=2
|
|
||||||
info "Using Helm version: $(helm version --short --client | grep -o v.*$)"
|
|
||||||
${helm} init --stable-repo-url https://charts.helm.sh/stable --wait --override spec.template.spec.automountServiceAccountToken=true
|
|
||||||
else # helm v3
|
|
||||||
helm_major_version=3
|
|
||||||
info "Using Helm version: $(helm version --short | grep -o v.*$)"
|
|
||||||
fi
|
|
||||||
${helm} plugin ls | grep diff || ${helm} plugin install https://github.com/databus23/helm-diff --version v${HELM_DIFF_VERSION}
|
${helm} plugin ls | grep diff || ${helm} plugin install https://github.com/databus23/helm-diff --version v${HELM_DIFF_VERSION}
|
||||||
info "Using Kustomize version: $(kustomize version --short | grep -o 'v[0-9.]\+')"
|
info "Using Kustomize version: $(kustomize version --short | grep -o 'v[0-9.]\+')"
|
||||||
${kubectl} get namespace ${test_ns} &> /dev/null && warn "Namespace ${test_ns} exists, from a previous test run?"
|
${kubectl} get namespace ${test_ns} &> /dev/null && warn "Namespace ${test_ns} exists, from a previous test run?"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
if [[ helm_major_version -eq 3 ]]; then
|
|
||||||
chart_need_case_input_dir="${cases_dir}/chart-needs/input"
|
chart_need_case_input_dir="${cases_dir}/chart-needs/input"
|
||||||
chart_need_case_output_dir="${cases_dir}/chart-needs/output"
|
chart_need_case_output_dir="${cases_dir}/chart-needs/output"
|
||||||
|
|
||||||
|
|
@ -72,4 +71,3 @@ if [[ helm_major_version -eq 3 ]]; then
|
||||||
[ ${code} -eq 0 ] || fail "unexpected exit code returned by helmfile destroy: want 0, got ${code}"
|
[ ${code} -eq 0 ] || fail "unexpected exit code returned by helmfile destroy: want 0, got ${code}"
|
||||||
|
|
||||||
test_pass "chart prepare when helmfile template with needs"
|
test_pass "chart prepare when helmfile template with needs"
|
||||||
fi
|
|
||||||
|
|
@ -32,7 +32,7 @@ for output in $(ls -d ${dir}/tmp/*); do
|
||||||
# e.g. test/integration/tmp/happypath-877c0dd4-helmx/helmx
|
# e.g. test/integration/tmp/happypath-877c0dd4-helmx/helmx
|
||||||
for release_dir in $(ls -d ${output}/*); do
|
for release_dir in $(ls -d ${output}/*); do
|
||||||
release_name=$(basename ${release_dir})
|
release_name=$(basename ${release_dir})
|
||||||
golden_dir=${happypath_case_output_dir}/v${helm_major_version}/${release_name}
|
golden_dir=${happypath_case_output_dir}/v3/${release_name}
|
||||||
info "Comparing template output ${release_dir}/templates with ${golden_dir}"
|
info "Comparing template output ${release_dir}/templates with ${golden_dir}"
|
||||||
./diff-yamls ${golden_dir} ${release_dir}/templates || fail "unexpected diff in template result for ${release_name}"
|
./diff-yamls ${golden_dir} ${release_dir}/templates || fail "unexpected diff in template result for ${release_name}"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
if [[ helm_major_version -eq 3 ]]; then
|
|
||||||
postrender_diff_case_input_dir="${cases_dir}/postrender-diff/input"
|
postrender_diff_case_input_dir="${cases_dir}/postrender-diff/input"
|
||||||
postrender_diff_case_output_dir="${cases_dir}/postrender-diff/output"
|
postrender_diff_case_output_dir="${cases_dir}/postrender-diff/output"
|
||||||
|
|
||||||
|
|
@ -27,4 +26,3 @@ if [[ helm_major_version -eq 3 ]]; then
|
||||||
echo code=$?
|
echo code=$?
|
||||||
done
|
done
|
||||||
test_pass "postrender diff"
|
test_pass "postrender diff"
|
||||||
fi
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
test_start "regression tests"
|
test_start "regression tests"
|
||||||
|
|
||||||
if [[ helm_major_version -eq 3 ]]; then
|
|
||||||
regression_case_input_dir="${cases_dir}/regression/input"
|
regression_case_input_dir="${cases_dir}/regression/input"
|
||||||
|
|
||||||
info "https://github.com/roboll/helmfile/issues/1857"
|
info "https://github.com/roboll/helmfile/issues/1857"
|
||||||
|
|
@ -34,8 +33,5 @@ if [[ helm_major_version -eq 3 ]]; then
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
(${helmfile} -f ${regression_case_input_dir}/${config_file} template 1>/dev/null) || fail "\"helmfile template\" shouldn't fail"
|
(${helmfile} -f ${regression_case_input_dir}/${config_file} template 1>/dev/null) || fail "\"helmfile template\" shouldn't fail"
|
||||||
else
|
|
||||||
info "There are no regression tests for helm 2 because all the target charts have dropped helm 2 support."
|
|
||||||
fi
|
|
||||||
|
|
||||||
test_pass "regression tests"
|
test_pass "regression tests"
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
if [[ helm_major_version -eq 3 ]]; then
|
|
||||||
export VAULT_ADDR=http://127.0.0.1:8200
|
export VAULT_ADDR=http://127.0.0.1:8200
|
||||||
export VAULT_TOKEN=toor
|
export VAULT_TOKEN=toor
|
||||||
sops="sops --hc-vault-transit $VAULT_ADDR/v1/sops/keys/key"
|
sops="sops --hc-vault-transit $VAULT_ADDR/v1/sops/keys/key"
|
||||||
|
|
@ -67,4 +66,3 @@ if [[ helm_major_version -eq 3 ]]; then
|
||||||
done
|
done
|
||||||
|
|
||||||
test_pass "secretssops.3"
|
test_pass "secretssops.3"
|
||||||
fi
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
if [[ helm_major_version -eq 3 ]]; then
|
|
||||||
if [[ ${HELMFILE_V1MODE} = true ]]; then
|
if [[ ${HELMFILE_V1MODE} = true ]]; then
|
||||||
yaml_overwrite_case_input_dir="${cases_dir}/yaml-overwrite/input"
|
yaml_overwrite_case_input_dir="${cases_dir}/yaml-overwrite/input"
|
||||||
yaml_overwrite_case_output_dir="${cases_dir}/yaml-overwrite/output"
|
yaml_overwrite_case_output_dir="${cases_dir}/yaml-overwrite/output"
|
||||||
|
|
@ -18,4 +17,3 @@ if [[ helm_major_version -eq 3 ]]; then
|
||||||
else
|
else
|
||||||
test_pass "[skipped] yaml overwrite feature"
|
test_pass "[skipped] yaml overwrite feature"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue