From 559271a88eb55f3b60e4ec3bffa2f79c57929fa9 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Thu, 6 Oct 2022 20:35:53 +0000 Subject: [PATCH] Fix helm job failure on multi-server tests Replace ETCD-JOIN-STABLE-SECOND with ETCD-JOIN-LATEST-FIRST. We don't support joining down-level servers to existing clusters, as the new down-level server will try to deploy older versions of the packaged manifests. Signed-off-by: Brad Davidson --- scripts/test-helpers | 2 +- scripts/test-run-etcd | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/test-helpers b/scripts/test-helpers index 2f7328c116c4..8bb52496b1c0 100755 --- a/scripts/test-helpers +++ b/scripts/test-helpers @@ -326,7 +326,7 @@ test-setup() { SERVER_MINOR=$(awk -F. '{print $2}' <<<${K3S_IMAGE_SERVER:-$K3S_IMAGE}) AGENT_MINOR=$(awk -F. '{print $2}' <<<${K3S_IMAGE_AGENT:-$K3S_IMAGE}) if [ $NUM_AGENTS -gt 0 ] && [ $AGENT_MINOR -gt $SERVER_MINOR ]; then - echo "Agent minor version cannot be newer than server - not supported by Kubernetes version skew policy" + echo "Agent minor version cannot be higher than server - not supported by Kubernetes version skew policy" exit 0 fi diff --git a/scripts/test-run-etcd b/scripts/test-run-etcd index 07112c2e52f0..78fb649ddfe1 100755 --- a/scripts/test-run-etcd +++ b/scripts/test-run-etcd @@ -39,8 +39,16 @@ LABEL="ETCD-JOIN-BASIC" SERVER_ARGS="" run-test LABEL="ETCD-JOIN-AGENTTOKEN" SERVER_ARGS="--agent-token ${RANDOM}${RANDOM}${RANDOM}" run-test # --- test joining managed etcd cluster with stable-version first server and current-build second server +# --- this test is skipped if the second node is down-level, as we don't support adding a down-level server to an existing cluster server-post-hook() { if [ $1 -eq 1 ]; then + SERVER_1_MINOR=$(awk -F. '{print $2}' <<<${K3S_IMAGE_SERVER}) + SERVER_2_MINOR=$(awk -F. '{print $2}' <<<${K3S_IMAGE}) + if [ $SERVER_1_MINOR -gt $SERVER_2_MINOR ]; then + echo "First server minor version cannot be higher than second server" + exit 0 + fi + local url=$(cat $TEST_DIR/servers/1/metadata/url) export SERVER_ARGS="${SERVER_ARGS} --server $url" export K3S_IMAGE_SERVER=${K3S_IMAGE} @@ -49,16 +57,24 @@ server-post-hook() { export -f server-post-hook LABEL="ETCD-JOIN-STABLE-FIRST" K3S_IMAGE_SERVER=${REPO}/${IMAGE_NAME}:${STABLE_VERSION} run-test -# --- test joining managed etcd cluster with current-build first server and stable-version second server +# --- test joining managed etcd cluster with latest-version first server and current-build second server +# --- this test is skipped if the second node is down-level, as we don't support adding a down-level server to an existing cluster server-post-hook() { if [ $1 -eq 1 ]; then + SERVER_1_MINOR=$(awk -F. '{print $2}' <<<${K3S_IMAGE_SERVER}) + SERVER_2_MINOR=$(awk -F. '{print $2}' <<<${K3S_IMAGE}) + if [ $SERVER_1_MINOR -gt $SERVER_2_MINOR ]; then + echo "First server minor version cannot be higher than second server" + exit 0 + fi + local url=$(cat $TEST_DIR/servers/1/metadata/url) export SERVER_ARGS="${SERVER_ARGS} --server $url" - export K3S_IMAGE_SERVER=${K3S_IMAGE_SERVER_2} + export K3S_IMAGE_SERVER=${K3S_IMAGE} fi } export -f server-post-hook -LABEL="ETCD-JOIN-STABLE-SECOND" K3S_IMAGE_SERVER_2=${REPO}/${IMAGE_NAME}:${STABLE_VERSION} run-test +LABEL="ETCD-JOIN-LATEST-FIRST" K3S_IMAGE_SERVER=${REPO}/${IMAGE_NAME}:${LATEST_VERSION} run-test # --- test joining a managed etcd cluster with incompatible configuration test-post-hook() {