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

Start of sprint housekeeping #671

Merged
merged 2 commits into from
Aug 27, 2024
Merged

Start of sprint housekeeping #671

merged 2 commits into from
Aug 27, 2024

Conversation

gsmith-sas
Copy link
Member

No description provided.

@gsmith-sas gsmith-sas requested a review from ceelias August 26, 2024 20:01
Copy link
Contributor

sh-checker report

To get the full details, please check in the job output.

shellcheck errors
'shellcheck -e SC1004' found no issues.

shfmt errors

'shfmt -s' returned error 1 finding the following formatting issues:

----------
--- bin/kube-include.sh.orig
+++ bin/kube-include.sh
@@ -7,30 +7,30 @@
 # Assumes bin/common.sh has been sourced
 
 if [ ! "$(which kubectl)" ]; then
-  log_error "kubectl not found on the current PATH"
-  exit 1
+	log_error "kubectl not found on the current PATH"
+	exit 1
 fi
 
 KUBE_CLIENT_VER=$(kubectl version --output=json | tr -d '\n' | tr -s " " | sed -E 's/^\{.*"clientVersion": \{([^\}]+)}.*/\1\n/' | sed -E 's/.*"gitVersion": "([^\"]*)".*$/\1/')
 KUBE_SERVER_VER=$(kubectl version --output=json | tr -d '\n' | tr -s " " | sed -E 's/^\{.*"serverVersion": \{([^\}]+)}.*/\1\n/' | sed -E 's/.*"gitVersion": "([^\"]*)".*$/\1/')
 
-if [[ "$KUBE_CLIENT_VER" =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
-   KUBE_CLIENT_MAJOR=${BASH_REMATCH[1]}
-   KUBE_CLIENT_MINOR=${BASH_REMATCH[2]}
-   KUBE_CLIENT_PATCH=${BASH_REMATCH[3]}
-   log_debug "Kubernetes Client - Major: [$KUBE_CLIENT_MAJOR] Minor: [$KUBE_CLIENT_MINOR] Patch: [$KUBE_CLIENT_PATCH]"
+if [[ $KUBE_CLIENT_VER =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
+	KUBE_CLIENT_MAJOR=${BASH_REMATCH[1]}
+	KUBE_CLIENT_MINOR=${BASH_REMATCH[2]}
+	KUBE_CLIENT_PATCH=${BASH_REMATCH[3]}
+	log_debug "Kubernetes Client - Major: [$KUBE_CLIENT_MAJOR] Minor: [$KUBE_CLIENT_MINOR] Patch: [$KUBE_CLIENT_PATCH]"
 else
-   log_error "Kubernetes Client Version does not match expected pattern.";
-fi;
+	log_error "Kubernetes Client Version does not match expected pattern."
+fi
 
-if [[ "$KUBE_SERVER_VER" =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
-   KUBE_SERVER_MAJOR=${BASH_REMATCH[1]}
-   KUBE_SERVER_MINOR=${BASH_REMATCH[2]}
-   KUBE_SERVER_PATCH=${BASH_REMATCH[3]}
-   log_debug "Kubernetes SERVER - Major: [$KUBE_SERVER_MAJOR] Minor: [$KUBE_SERVER_MINOR] Patch: [$KUBE_SERVER_PATCH]"
+if [[ $KUBE_SERVER_VER =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
+	KUBE_SERVER_MAJOR=${BASH_REMATCH[1]}
+	KUBE_SERVER_MINOR=${BASH_REMATCH[2]}
+	KUBE_SERVER_PATCH=${BASH_REMATCH[3]}
+	log_debug "Kubernetes SERVER - Major: [$KUBE_SERVER_MAJOR] Minor: [$KUBE_SERVER_MINOR] Patch: [$KUBE_SERVER_PATCH]"
 else
-   log_error "Kubernetes SERVER Version does not match expected pattern.";
-fi;
+	log_error "Kubernetes SERVER Version does not match expected pattern."
+fi
 
 # SAS Viya 4 versions
 # supported by SAS Tech Support
@@ -44,20 +44,19 @@
 # 2024.07     1.27 1.29
 # 2024.08     1.27 1.29
 
-
 # Client version allowed to be one minor version earlier than minimum server version
 if [ "$KUBE_CLIENT_MAJOR" -eq "1" ] && [ "$KUBE_CLIENT_MINOR" -gt "21" ]; then
-  :
+	:
 else
-  log_warn "Unsupported kubectl version: [$KUBE_CLIENT_VER]."
-  log_warn "This script might not work as expected. Support might not be available until kubectl is upgraded to a supported version."
+	log_warn "Unsupported kubectl version: [$KUBE_CLIENT_VER]."
+	log_warn "This script might not work as expected. Support might not be available until kubectl is upgraded to a supported version."
 fi
 
-if [ "$KUBE_SERVER_MAJOR" -eq "1" ] && [ "$KUBE_SERVER_MINOR" -gt "22"  ]; then
-  :
+if [ "$KUBE_SERVER_MAJOR" -eq "1" ] && [ "$KUBE_SERVER_MINOR" -gt "22" ]; then
+	:
 else
-  log_warn "The detected version of Kubernetes [$KUBE_SERVER_VER] is not supported by any of the currently supported releases of SAS Viya."
-  log_warn "This script might not work as expected. Support might not be available until Kubernetes is upgraded to a supported version."
+	log_warn "The detected version of Kubernetes [$KUBE_SERVER_VER] is not supported by any of the currently supported releases of SAS Viya."
+	log_warn "This script might not work as expected. Support might not be available until Kubernetes is upgraded to a supported version."
 fi
 
 export KUBE_CLIENT_VER="$KUBE_CLIENT_VER"
----------

You can reformat the above files to meet shfmt's requirements by typing:

  shfmt -s -w filename


Copy link
Contributor

sh-checker report

To get the full details, please check in the job output.

shellcheck errors
'shellcheck -e SC1004' found no issues.

shfmt errors

'shfmt -s' returned error 1 finding the following formatting issues:

----------
--- bin/kube-include.sh.orig
+++ bin/kube-include.sh
@@ -7,30 +7,30 @@
 # Assumes bin/common.sh has been sourced
 
 if [ ! "$(which kubectl)" ]; then
-  log_error "kubectl not found on the current PATH"
-  exit 1
+	log_error "kubectl not found on the current PATH"
+	exit 1
 fi
 
 KUBE_CLIENT_VER=$(kubectl version --output=json | tr -d '\n' | tr -s " " | sed -E 's/^\{.*"clientVersion": \{([^\}]+)}.*/\1\n/' | sed -E 's/.*"gitVersion": "([^\"]*)".*$/\1/')
 KUBE_SERVER_VER=$(kubectl version --output=json | tr -d '\n' | tr -s " " | sed -E 's/^\{.*"serverVersion": \{([^\}]+)}.*/\1\n/' | sed -E 's/.*"gitVersion": "([^\"]*)".*$/\1/')
 
-if [[ "$KUBE_CLIENT_VER" =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
-   KUBE_CLIENT_MAJOR=${BASH_REMATCH[1]}
-   KUBE_CLIENT_MINOR=${BASH_REMATCH[2]}
-   KUBE_CLIENT_PATCH=${BASH_REMATCH[3]}
-   log_debug "Kubernetes CLIENT - Major: [$KUBE_CLIENT_MAJOR] Minor: [$KUBE_CLIENT_MINOR] Patch: [$KUBE_CLIENT_PATCH]"
+if [[ $KUBE_CLIENT_VER =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
+	KUBE_CLIENT_MAJOR=${BASH_REMATCH[1]}
+	KUBE_CLIENT_MINOR=${BASH_REMATCH[2]}
+	KUBE_CLIENT_PATCH=${BASH_REMATCH[3]}
+	log_debug "Kubernetes CLIENT - Major: [$KUBE_CLIENT_MAJOR] Minor: [$KUBE_CLIENT_MINOR] Patch: [$KUBE_CLIENT_PATCH]"
 else
-   log_error "Kubernetes Client Version does not match expected pattern.";
-fi;
+	log_error "Kubernetes Client Version does not match expected pattern."
+fi
 
-if [[ "$KUBE_SERVER_VER" =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
-   KUBE_SERVER_MAJOR=${BASH_REMATCH[1]}
-   KUBE_SERVER_MINOR=${BASH_REMATCH[2]}
-   KUBE_SERVER_PATCH=${BASH_REMATCH[3]}
-   log_debug "Kubernetes SERVER - Major: [$KUBE_SERVER_MAJOR] Minor: [$KUBE_SERVER_MINOR] Patch: [$KUBE_SERVER_PATCH]"
+if [[ $KUBE_SERVER_VER =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
+	KUBE_SERVER_MAJOR=${BASH_REMATCH[1]}
+	KUBE_SERVER_MINOR=${BASH_REMATCH[2]}
+	KUBE_SERVER_PATCH=${BASH_REMATCH[3]}
+	log_debug "Kubernetes SERVER - Major: [$KUBE_SERVER_MAJOR] Minor: [$KUBE_SERVER_MINOR] Patch: [$KUBE_SERVER_PATCH]"
 else
-   log_error "Kubernetes SERVER Version does not match expected pattern.";
-fi;
+	log_error "Kubernetes SERVER Version does not match expected pattern."
+fi
 
 # SAS Viya 4 versions
 # supported by SAS Tech Support
@@ -44,20 +44,19 @@
 # 2024.07     1.27 1.29
 # 2024.08     1.27 1.29
 
-
 # Client version allowed to be one minor version earlier than minimum server version
 if [ "$KUBE_CLIENT_MAJOR" -eq "1" ] && [ "$KUBE_CLIENT_MINOR" -gt "21" ]; then
-  :
+	:
 else
-  log_warn "Unsupported kubectl version: [$KUBE_CLIENT_VER]."
-  log_warn "This script might not work as expected. Support might not be available until kubectl is upgraded to a supported version."
+	log_warn "Unsupported kubectl version: [$KUBE_CLIENT_VER]."
+	log_warn "This script might not work as expected. Support might not be available until kubectl is upgraded to a supported version."
 fi
 
-if [ "$KUBE_SERVER_MAJOR" -eq "1" ] && [ "$KUBE_SERVER_MINOR" -gt "22"  ]; then
-  :
+if [ "$KUBE_SERVER_MAJOR" -eq "1" ] && [ "$KUBE_SERVER_MINOR" -gt "22" ]; then
+	:
 else
-  log_warn "The detected version of Kubernetes [$KUBE_SERVER_VER] is not supported by any of the currently supported releases of SAS Viya."
-  log_warn "This script might not work as expected. Support might not be available until Kubernetes is upgraded to a supported version."
+	log_warn "The detected version of Kubernetes [$KUBE_SERVER_VER] is not supported by any of the currently supported releases of SAS Viya."
+	log_warn "This script might not work as expected. Support might not be available until Kubernetes is upgraded to a supported version."
 fi
 
 export KUBE_CLIENT_VER="$KUBE_CLIENT_VER"
----------

You can reformat the above files to meet shfmt's requirements by typing:

  shfmt -s -w filename


@gsmith-sas gsmith-sas merged commit ade004d into main Aug 27, 2024
1 check failed
@gsmith-sas gsmith-sas deleted the sos2409b branch August 27, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants