Skip to content

Commit

Permalink
Fix helm job failure on multi-server tests
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
brandond committed Oct 6, 2022
1 parent bde7e92 commit 559271a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/test-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 19 additions & 3 deletions scripts/test-run-etcd
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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() {
Expand Down

0 comments on commit 559271a

Please sign in to comment.