test: fix helm2 integration tests

This commit is contained in:
Andrey Tuzhilin 2021-03-15 14:50:01 +03:00 committed by Yusuke Kuoka
parent 17a969ce83
commit 45b8eb6942
1 changed files with 3 additions and 2 deletions

View File

@ -50,14 +50,15 @@ if helm version --client 2>/dev/null | grep '"v2\.'; then
helm_major_version=2 helm_major_version=2
info "Using Helm version: $(helm version --short --client | grep -o v.*$)" 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 ${helm} init --stable-repo-url https://charts.helm.sh/stable --wait --override spec.template.spec.automountServiceAccountToken=true
${helm} plugin ls | grep diff || ${helm} plugin install https://github.com/databus23/helm-diff --version v2.11.0+5
# helm v3 # helm v3
else else
helm_major_version=3 helm_major_version=3
info "Using Helm version: $(helm version --short | grep -o v.*$)" info "Using Helm version: $(helm version --short | grep -o v.*$)"
fi
info "Using Kustomize version: $(kustomize version --short | grep -o 'v[^ ]+')"
${helm} plugin ls | grep diff || ${helm} plugin install https://github.com/databus23/helm-diff --version v3.1.3 ${helm} plugin ls | grep diff || ${helm} plugin install https://github.com/databus23/helm-diff --version v3.1.3
${helm} plugin ls | grep secrets || ${helm} plugin install https://github.com/jkroepke/helm-secrets --version v3.5.0 ${helm} plugin ls | grep secrets || ${helm} plugin install https://github.com/jkroepke/helm-secrets --version v3.5.0
fi
info "Using Kustomize version: $(kustomize version --short | grep -o 'v[^ ]+')"
${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?"
$kubectl create namespace ${test_ns} || fail "Could not create namespace ${test_ns}" $kubectl create namespace ${test_ns} || fail "Could not create namespace ${test_ns}"
trap "{ $kubectl delete namespace ${test_ns}; }" EXIT # remove namespace whenever we exit this script trap "{ $kubectl delete namespace ${test_ns}; }" EXIT # remove namespace whenever we exit this script