sassoftware / viya4-monitoring-kubernetes

Provides simple scripts and customization options to deploy monitoring, alerts, and log aggregation for Viya 4 running on Kubernetes
Apache License 2.0
50 stars 31 forks source link

[CHANGE] Eliminated use of --short option from kubectl version commands #652

Closed gsmith-sas closed 2 weeks ago

github-actions[bot] commented 3 weeks ago

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,8 +7,8 @@ # 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/') @@ -16,10 +16,10 @@ # Client version allowed to be one minor version earlier than minimum server version if [[ $KUBE_CLIENT_VER =~ v1.2[0-9] ]]; 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." + : +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." fi # SAS Viya 4 versions @@ -35,10 +35,10 @@ # 2024.05 1.27 1.29 if [[ $KUBE_SERVER_VER =~ v1.2[1-9] ]]; 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." + : +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." 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 ```
github-actions[bot] commented 2 weeks ago

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,8 +7,8 @@ # 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/') @@ -16,10 +16,10 @@ # Client version allowed to be one minor version earlier than minimum server version if [[ $KUBE_CLIENT_VER =~ v1.2[0-9] ]]; 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." + : +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." fi # SAS Viya 4 versions @@ -35,10 +35,10 @@ # 2024.05 1.27 1.29 if [[ $KUBE_SERVER_VER =~ v1.2[1-9] ]]; 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." + : +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." 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 commented 2 weeks ago

This PR supersedes/ closes #644 .