Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clusters.sh: handle empty k8s_version #580

Merged
merged 1 commit into from
Jun 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/shared/clusters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Kubernetes version mapping, as supported by kind ##
# See the release notes of the kind version in use
DEFAULT_K8S_VERSION=1.20
declare -A kind_k8s_versions
kind_k8s_versions[1.17]=1.17.17
kind_k8s_versions[1.18]=1.18.19
Expand All @@ -12,7 +13,7 @@ kind_k8s_versions[1.21]=1.21.1
## Process command line flags ##

source ${SCRIPTS_DIR}/lib/shflags
DEFINE_string 'k8s_version' '1.20' 'Version of K8s to use'
DEFINE_string 'k8s_version' "${DEFAULT_K8S_VERSION}" 'Version of K8s to use'
DEFINE_string 'olm_version' '0.14.1' 'Version of OLM to use'
DEFINE_boolean 'olm' false 'Deploy OLM'
DEFINE_boolean 'prometheus' false 'Deploy Prometheus'
Expand All @@ -25,6 +26,7 @@ eval set -- "${FLAGS_ARGV}"

k8s_version="${FLAGS_k8s_version}"
olm_version="${FLAGS_olm_version}"
[[ -z "${k8s_version}" ]] && k8s_version="${DEFAULT_K8S_VERSION}"
[[ -n "${kind_k8s_versions[$k8s_version]}" ]] && k8s_version="${kind_k8s_versions[$k8s_version]}"
[[ "${FLAGS_olm}" = "${FLAGS_TRUE}" ]] && olm=true || olm=false
[[ "${FLAGS_prometheus}" = "${FLAGS_TRUE}" ]] && prometheus=true || prometheus=false
Expand Down