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..640f3eac3e 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_A}") +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}" \