-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5199 from rancher-sandbox/4952-handle-invalid-k8s…
…-version Handle invalid k8s versions at startup
- Loading branch information
Showing
4 changed files
with
103 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
load '../helpers/load' | ||
|
||
@test 'factory reset' { | ||
factory_reset | ||
} | ||
|
||
@test 'invalid k8s version' { | ||
start_kubernetes --kubernetes.version=moose | ||
wait_for_container_engine | ||
# Can't use wait_for_api_server because it hard-wires a valid k8s version and we're specifying an invalid one here. | ||
# and we're specifying an invalid one here | ||
local timeout="$(($(date +%s) + 10 * 60))" | ||
until kubectl get --raw /readyz &>/dev/null; do | ||
assert [ "$(date +%s)" -lt "$timeout" ] | ||
sleep 1 | ||
done | ||
# No way there's a race-condition here. | ||
# The version was checked and written to the log file before starting k8s, | ||
# and we have to wait a few minutes before k8s is ready and we're at the next line. | ||
assert_file_contains "$PATH_LOGS/kube.log" "Requested kubernetes version 'moose' is not a valid version. Falling back to the most recent stable version of" | ||
} | ||
|
||
# on macOS it still hangs without this | ||
@test 'shutdown' { | ||
if is_macos; then | ||
rdctl shutdown | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters