mirror of https://github.com/k3s-io/k3s
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
2.0 KiB
50 lines
2.0 KiB
4 years ago
|
#!/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
|
||
|
|
||
4 years ago
|
# --- suppress test failures if the agent is intentionally incompatible with the server version
|
||
|
test-post-hook() {
|
||
|
if [[ $1 -eq 0 ]]; then
|
||
|
return
|
||
|
fi
|
||
3 years ago
|
dump-logs skip-output
|
||
4 years ago
|
grep -sqF 'incompatible down-level server detected' $TEST_DIR/agents/*/logs/system.log
|
||
|
}
|
||
|
export -f test-post-hook
|
||
|
|
||
4 years ago
|
REPO=${REPO:-rancher}
|
||
|
IMAGE_NAME=${IMAGE_NAME:-k3s}
|
||
1 year ago
|
PREVIOUS_CHANNEL=$(echo ${VERSION_K8S} | awk -F. '{print "v1." ($2 - 1)}')
|
||
4 years ago
|
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
|
||
3 years ago
|
|
||
|
cleanup-test-env
|