Skip to content

Commit

Permalink
Add non GA version check (#266)
Browse files Browse the repository at this point in the history
* Add kNonGAversion
  • Loading branch information
bharathsreekanth authored Jun 24, 2024
1 parent 3b99593 commit 5716adc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dell-csi-helm-installer/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ function verify_k8s_versions() {
local MIN=${1}
local MAX=${2}
local V="${kMajorVersion}.${kMinorVersion}"

# check non supported version (k8s alpha/beta)
if [ -n "${kNonGAVersion}" ]; then
echo "Installing on an unreleased version of Kubernetes : "${kNonGAVersion}". Acknowledge and proceed with installation? (y/n)"
read -n 1 -p "Press 'y' to continue or any other key to exit: " CONT
decho
if [ "${CONT}" != "Y" -a "${CONT}" != "y" ]; then
decho "quitting at user request"
exit 2
fi
fi

# check minimum
log arrow
log smart_step "Verifying minimum Kubernetes version" "small"
Expand Down Expand Up @@ -571,6 +583,7 @@ MASTER_NODES=$(run_command kubectl get nodes -o wide | awk ' /master/{ print $6;
# Get the kubernetes major and minor version numbers.
kMajorVersion=$(run_command kubectl version | grep 'Server Version' | sed -E 's/.*v([0-9]+)\.[0-9]+\.[0-9]+.*/\1/')
kMinorVersion=$(run_command kubectl version | grep 'Server Version' | sed -E 's/.*v[0-9]+\.([0-9]+)\.[0-9]+.*/\1/')
kNonGAVersion=$(run_command kubectl version | grep 'Server Version' | sed -n 's/.*\(-[alpha|beta][^ ]*\).*/\1/p')

while getopts ":h-:" optchar; do
case "${optchar}" in
Expand Down

0 comments on commit 5716adc

Please sign in to comment.