From 9e5c298706107f8a3347e77592ce85a80f3453bb Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Thu, 3 Jun 2021 13:24:56 +0200 Subject: [PATCH 1/2] Use release markers instead of releases --- tests/e2e/scenarios/lib/common.sh | 8 ++++++++ tests/e2e/scenarios/upgrade-ab/run-test.sh | 18 +++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/e2e/scenarios/lib/common.sh b/tests/e2e/scenarios/lib/common.sh index 10b323e2b7..4fc554d4fd 100644 --- a/tests/e2e/scenarios/lib/common.sh +++ b/tests/e2e/scenarios/lib/common.sh @@ -63,4 +63,12 @@ function kops-download-from-base() { wget -qO "${kops}" "$KOPS_BASE_URL/$(go env GOOS)/$(go env GOARCH)/kops" chmod +x "${kops}" echo "${kops}" +} + +function kops-base-from-marker() { + if [[ "${1}" == "latest" ]]; then + curl -s "https://storage.googleapis.com/kops-ci/bin/latest-ci-updown-green.txt" + else + curl -s "https://storage.googleapis.com/k8s-staging-kops/kops/releases/markers/release-${1}/latest-ci.txt" + fi } \ No newline at end of file diff --git a/tests/e2e/scenarios/upgrade-ab/run-test.sh b/tests/e2e/scenarios/upgrade-ab/run-test.sh index 6ad7dc11ed..d941afb22a 100755 --- a/tests/e2e/scenarios/upgrade-ab/run-test.sh +++ b/tests/e2e/scenarios/upgrade-ab/run-test.sh @@ -22,7 +22,9 @@ if [ -z "$KOPS_VERSION_A" ] || [ -z "$K8S_VERSION_A" ] || [ -z "$KOPS_VERSION_B" exit 1 fi -KOPS_A=$(kops-download-release "${KOPS_VERSION_A}") +export KOPS_BASE_URL +KOPS_BASE_URL=$(kops-base-from-marker "${KOPS_VERSION_B}") +KOPS_A=$(kops-download-from-base) KOPS="${KOPS_A}" ${KUBETEST2} \ @@ -33,18 +35,13 @@ ${KUBETEST2} \ # Export kubeconfig-a KUBECONFIG_A=$(mktemp -t kops.XXXXXXXXX) -"{KOPS_A}" export kubecfg --name "${CLUSTER_NAME}" --admin --kubeconfig "{KUBECONFIG_A}" +"${KOPS_A}" export kubecfg --name "${CLUSTER_NAME}" --admin --kubeconfig "${KUBECONFIG_A}" # Verify kubeconfig-a kubectl get nodes -owide --kubeconfig="${KUBECONFIG_A}" -if [[ "${KOPS_VERSION_B}" == "source" ]]; then - export KOPS_BASE_URL - KOPS_BASE_URL="$(curl -s https://storage.googleapis.com/kops-ci/bin/latest-ci-updown-green.txt)" - KOPS_B=$(kops-download-from-base) -else - KOPS_B=$(kops-download-release "${KOPS_VERSION_B}") -fi +KOPS_BASE_URL=$(kops-base-from-marker "${KOPS_VERSION_B}") +KOPS_B=$(kops-download-from-base) KOPS="${KOPS_B}" @@ -55,7 +52,6 @@ KOPS="${KOPS_B}" # Verify no additional changes "${KOPS_B}" update cluster -sleep 300 # Verify kubeconfig-a still works kubectl get nodes -owide --kubeconfig "${KUBECONFIG_A}" @@ -69,7 +65,7 @@ kubectl get nodes -owide --kubeconfig="${KUBECONFIG_A}" cp "${KOPS_B}" "${WORKSPACE}/kops" -"{KOPS_B}" export kubecfg --name "${CLUSTER_NAME}" --admin +"${KOPS_B}" export kubecfg --name "${CLUSTER_NAME}" --admin ${KUBETEST2} \ --cloud-provider="${CLOUD_PROVIDER}" \ From ae8d8be1924c731e40b4d2655fe1bc19ac2ee745 Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Thu, 3 Jun 2021 13:34:07 +0200 Subject: [PATCH 2/2] Update tests/e2e/scenarios/upgrade-ab/run-test.sh Co-authored-by: Peter Rifel --- tests/e2e/scenarios/upgrade-ab/run-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/scenarios/upgrade-ab/run-test.sh b/tests/e2e/scenarios/upgrade-ab/run-test.sh index d941afb22a..640f3eac3e 100755 --- a/tests/e2e/scenarios/upgrade-ab/run-test.sh +++ b/tests/e2e/scenarios/upgrade-ab/run-test.sh @@ -23,7 +23,7 @@ if [ -z "$KOPS_VERSION_A" ] || [ -z "$K8S_VERSION_A" ] || [ -z "$KOPS_VERSION_B" fi export KOPS_BASE_URL -KOPS_BASE_URL=$(kops-base-from-marker "${KOPS_VERSION_B}") +KOPS_BASE_URL=$(kops-base-from-marker "${KOPS_VERSION_A}") KOPS_A=$(kops-download-from-base) KOPS="${KOPS_A}"