Skip to content

Commit c03545e

Browse files
authored
Start of sprint housekeeping (2) (#743)
1 parent a0fc0fc commit c03545e

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

bin/kube-include.sh

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,56 @@
77
# Assumes bin/common.sh has been sourced
88

99
if [ ! "$(which kubectl)" ]; then
10-
log_error "kubectl not found on the current PATH"
11-
exit 1
10+
log_error "kubectl not found on the current PATH"
11+
exit 1
1212
fi
1313

1414
KUBE_CLIENT_VER=$(kubectl version --output=json | tr -d '\n' | tr -s " " | sed -E 's/^\{.*"clientVersion": \{([^\}]+)}.*/\1\n/' | sed -E 's/.*"gitVersion": "([^\"]*)".*$/\1/')
1515
KUBE_SERVER_VER=$(kubectl version --output=json | tr -d '\n' | tr -s " " | sed -E 's/^\{.*"serverVersion": \{([^\}]+)}.*/\1\n/' | sed -E 's/.*"gitVersion": "([^\"]*)".*$/\1/')
1616

1717
if [[ "$KUBE_CLIENT_VER" =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
18-
KUBE_CLIENT_MAJOR=${BASH_REMATCH[1]}
19-
KUBE_CLIENT_MINOR=${BASH_REMATCH[2]}
20-
KUBE_CLIENT_PATCH=${BASH_REMATCH[3]}
21-
log_debug "Kubernetes CLIENT - Major: [$KUBE_CLIENT_MAJOR] Minor: [$KUBE_CLIENT_MINOR] Patch: [$KUBE_CLIENT_PATCH]"
18+
KUBE_CLIENT_MAJOR=${BASH_REMATCH[1]}
19+
KUBE_CLIENT_MINOR=${BASH_REMATCH[2]}
20+
KUBE_CLIENT_PATCH=${BASH_REMATCH[3]}
21+
log_debug "Kubernetes CLIENT - Major: [$KUBE_CLIENT_MAJOR] Minor: [$KUBE_CLIENT_MINOR] Patch: [$KUBE_CLIENT_PATCH]"
2222
else
23-
log_error "Kubernetes Client Version does not match expected pattern.";
23+
log_error "Kubernetes Client Version does not match expected pattern.";
2424
fi;
2525

2626
if [[ "$KUBE_SERVER_VER" =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
27-
KUBE_SERVER_MAJOR=${BASH_REMATCH[1]}
28-
KUBE_SERVER_MINOR=${BASH_REMATCH[2]}
29-
KUBE_SERVER_PATCH=${BASH_REMATCH[3]}
30-
log_debug "Kubernetes SERVER - Major: [$KUBE_SERVER_MAJOR] Minor: [$KUBE_SERVER_MINOR] Patch: [$KUBE_SERVER_PATCH]"
27+
KUBE_SERVER_MAJOR=${BASH_REMATCH[1]}
28+
KUBE_SERVER_MINOR=${BASH_REMATCH[2]}
29+
KUBE_SERVER_PATCH=${BASH_REMATCH[3]}
30+
log_debug "Kubernetes SERVER - Major: [$KUBE_SERVER_MAJOR] Minor: [$KUBE_SERVER_MINOR] Patch: [$KUBE_SERVER_PATCH]"
3131
else
32-
log_error "Kubernetes SERVER Version does not match expected pattern.";
32+
log_error "Kubernetes SERVER Version does not match expected pattern.";
3333
fi;
3434

3535
# SAS Viya 4 versions
3636
# supported by SAS Tech Support
37-
# Updated: 20MAR25
37+
# Updated: 18APR25
3838
# 2023.03 LTS 1.23 1.25 (EOL: 1.23, 1.24)
3939
# 2023.10 LTS 1.25 1.27
4040
# 2024.03 LTS 1.26 1.28
4141
# 2024.09 LTS 1.28 1.30
42-
# 2024.12 1.28 1.30
4342
# 2025.01 1.28 1.30
4443
# 2025.02 1.29 1.31
4544
# 2025.03 1.29 1.31
46-
45+
# 2025.04 1.29 1.31
4746

4847
# Client version allowed to be one minor version earlier than minimum server version
4948
if [ "$KUBE_CLIENT_MAJOR" -eq "1" ] && [ "$KUBE_CLIENT_MINOR" -gt "22" ]; then
50-
:
49+
:
5150
else
52-
log_warn "Unsupported kubectl version: [$KUBE_CLIENT_VER]."
53-
log_warn "This script might not work as expected. Support might not be available until kubectl is upgraded to a supported version."
51+
log_warn "Unsupported kubectl version: [$KUBE_CLIENT_VER]."
52+
log_warn "This script might not work as expected. Support might not be available until kubectl is upgraded to a supported version."
5453
fi
5554

56-
if [ "$KUBE_SERVER_MAJOR" -eq "1" ] && [ "$KUBE_SERVER_MINOR" -gt "23" ]; then
57-
:
55+
if [ "$KUBE_SERVER_MAJOR" -eq "1" ] && [ "$KUBE_SERVER_MINOR" -gt "23" ]; then
56+
:
5857
else
59-
log_warn "The detected version of Kubernetes [$KUBE_SERVER_VER] is not supported by any of the currently supported releases of SAS Viya."
60-
log_warn "This script might not work as expected. Support might not be available until Kubernetes is upgraded to a supported version."
58+
log_warn "The detected version of Kubernetes [$KUBE_SERVER_VER] is not supported by any of the currently supported releases of SAS Viya."
59+
log_warn "This script might not work as expected. Support might not be available until Kubernetes is upgraded to a supported version."
6160
fi
6261

6362
export KUBE_CLIENT_VER="$KUBE_CLIENT_VER"

0 commit comments

Comments
 (0)