Merge pull request #1957 from mcsaucy/http

Perform basic validation on K3S_URL in install.sh
This commit is contained in:
Brad Davidson 2020-07-13 12:33:24 -07:00 committed by GitHub
commit 5e01bd3558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,6 +153,14 @@ setup_env() {
if [ -z "${K3S_TOKEN}" ] && [ -z "${K3S_CLUSTER_SECRET}" ]; then
fatal "Defaulted k3s exec command to 'agent' because K3S_URL is defined, but K3S_TOKEN or K3S_CLUSTER_SECRET is not defined."
fi
case "${K3S_URL}" in
https://*)
;;
*)
fatal "Only https:// URLs are supported for K3S_URL (have ${K3S_URL})"
;;
esac
CMD_K3S=agent
fi
;;