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.
51 lines
1.3 KiB
51 lines
1.3 KiB
5 years ago
|
#!/bin/bash
|
||
|
|
||
5 years ago
|
all_services=(
|
||
|
coredns
|
||
|
local-path-provisioner
|
||
|
metrics-server
|
||
5 years ago
|
traefik
|
||
5 years ago
|
)
|
||
|
|
||
5 years ago
|
export NUM_SERVERS=1
|
||
|
export NUM_AGENTS=1
|
||
5 years ago
|
export WAIT_SERVICES="${all_services[@]}"
|
||
5 years ago
|
|
||
|
start-test() {
|
||
4 years ago
|
use-local-storage-volume
|
||
5 years ago
|
docker exec $(cat $TEST_DIR/servers/1/metadata/name) check-config || true
|
||
|
verify-valid-versions $(cat $TEST_DIR/servers/1/metadata/name)
|
||
5 years ago
|
verify-airgap-images $(cat $TEST_DIR/{servers,agents}/*/metadata/name)
|
||
5 years ago
|
}
|
||
|
export -f start-test
|
||
|
|
||
5 years ago
|
# -- check for changes to the airgap image list
|
||
|
verify-airgap-images() {
|
||
|
local airgap_image_list='scripts/airgap/image-list.txt'
|
||
|
|
||
|
for name in $@; do
|
||
|
docker exec $name crictl images -o json \
|
||
|
| jq -r '.images[].repoTags[0] | select(. != null)'
|
||
|
done | sort -u >$airgap_image_list.tmp
|
||
|
|
||
|
if ! diff $airgap_image_list{,.tmp}; then
|
||
|
echo '[ERROR] Failed airgap image check'
|
||
|
return 1
|
||
|
fi
|
||
|
}
|
||
|
export -f verify-airgap-images
|
||
|
|
||
4 years ago
|
# -- create a pod that uses local-storage to ensure that the local-path-provisioner
|
||
|
# -- helper image gets used
|
||
|
use-local-storage-volume() {
|
||
|
local volume_test_manifest='scripts/airgap/volume-test.yaml'
|
||
|
kubectl apply -f $volume_test_manifest
|
||
|
wait-for-services volume-test
|
||
|
}
|
||
|
export -f use-local-storage-volume
|
||
|
|
||
5 years ago
|
# --- create a basic cluster and check for valid versions
|
||
|
LABEL=BASICS run-test
|
||
3 years ago
|
|
||
|
cleanup-test-env
|