mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
7734015db7
We have had a couple issues with newer agents not working with old servers or vice versa. Add a CI test to test variations on uplevel/downlevel server/agent against latest, stable, and the previous branch. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
38 lines
1.8 KiB
Bash
Executable File
38 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
all_services=(
|
|
coredns
|
|
local-path-provisioner
|
|
metrics-server
|
|
traefik
|
|
)
|
|
|
|
export NUM_SERVERS=1
|
|
export NUM_AGENTS=1
|
|
export WAIT_SERVICES="${all_services[@]}"
|
|
export SERVER_ARGS="--node-taint=CriticalAddonsOnly=true:NoExecute"
|
|
|
|
start-test() {
|
|
echo "Cluster is up"
|
|
}
|
|
export -f start-test
|
|
|
|
REPO=${REPO:-rancher}
|
|
IMAGE_NAME=${IMAGE_NAME:-k3s}
|
|
PREVIOUS_CHANNEL=$(curl -s https://update.k3s.io/v1-release/channels/stable -o /dev/null -w '%{redirect_url}' | awk -F. '{print "v1." ($(NF - 1) - 1)}')
|
|
PREVIOUS_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/${PREVIOUS_CHANNEL} -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}')
|
|
STABLE_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/stable -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}')
|
|
LATEST_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/latest -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}')
|
|
|
|
# --- create a basic cluster to test for compat with the previous minor version of the server and agent
|
|
K3S_IMAGE_SERVER=${REPO}/${IMAGE_NAME}:${PREVIOUS_VERSION} LABEL=PREVIOUS-SERVER run-test
|
|
K3S_IMAGE_AGENT=${REPO}/${IMAGE_NAME}:${PREVIOUS_VERSION} LABEL=PREVIOUS-AGENT run-test
|
|
|
|
# --- create a basic cluster to test for compat with the stable version of the server and agent
|
|
K3S_IMAGE_SERVER=${REPO}/${IMAGE_NAME}:${STABLE_VERSION} LABEL=STABLE-SERVER run-test
|
|
K3S_IMAGE_AGENT=${REPO}/${IMAGE_NAME}:${STABLE_VERSION} LABEL=STABLE-AGENT run-test
|
|
|
|
# --- create a basic cluster to test for compat with the latest version of the server and agent
|
|
K3S_IMAGE_SERVER=${REPO}/${IMAGE_NAME}:${LATEST_VERSION} LABEL=LATEST-SERVER run-test
|
|
K3S_IMAGE_AGENT=${REPO}/${IMAGE_NAME}:${LATEST_VERSION} LABEL=LATEST-AGENT run-test
|