Skip to content

Conversation

gsmith-sas
Copy link
Member

No description provided.

Copy link
Contributor

sh-checker report

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

shellcheck errors

'shellcheck -e SC1004' returned error 1 finding the following syntactical issues:

----------

In bin/autogenerate-include.sh line 1:
# Copyright © 2025, SAS Institute Inc., Cary, NC, USA.  All Rights Reserved.
^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.


In bin/autogenerate-include.sh line 38:
        kubectl -n $namespace label secret $secretName  managed-by="v4m-es-script"
                   ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                           ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
        kubectl -n "$namespace" label secret "$secretName"  managed-by="v4m-es-script"


In bin/autogenerate-include.sh line 39:
    elif [ ! -z "$certFile$keyFile" ]; then
           ^-- SC2236 (style): Use -n instead of ! -z.


In bin/autogenerate-include.sh line 74:
        BASE_DOMAIN="${BASE_DOMAIN}"
        ^---------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 90:
        INGRESS_CERT="${INGRESS_CERT}"
        ^----------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 91:
        INGRESS_KEY="${INGRESS_KEY}"
        ^---------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 195:
        if $(kubectl get storageClass "$storageClass" -o name &>/dev/null); then
           ^-- SC2091 (warning): Remove surrounding $() to avoid executing output (or use eval if intentional).

For more information:
  https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...
  https://www.shellcheck.net/wiki/SC2091 -- Remove surrounding $() to avoid e...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors

'shfmt -s -i 4 -bn -sr -ln bash' returned error 1 finding the following formatting issues:

----------
diff bin/autogenerate-include.sh.orig bin/autogenerate-include.sh
--- bin/autogenerate-include.sh.orig
+++ bin/autogenerate-include.sh
@@ -4,7 +4,6 @@
 # This file is not marked as executable as it is intended to be sourced
 # Current directory must be the root directory of the repo
 
-
 function checkYqVersion {
     # confirm yq installed and correct version
     local goodver yq_version
@@ -35,7 +34,7 @@
     if [ -f "$certFile" ] && [ -f "$keyFile" ]; then
         kubectl delete secret "$secretName" --namespace "$namespace" --ignore-not-found
         kubectl create secret tls "$secretName" --namespace "$namespace" --key="$keyFile" --cert="$certFile"
-        kubectl -n $namespace label secret $secretName  managed-by="v4m-es-script"
+        kubectl -n $namespace label secret $secretName managed-by="v4m-es-script"
     elif [ ! -z "$certFile$keyFile" ]; then
         log_warn "Missing Ingress certificate file; specified Ingress cert [$certFile] and/or key [$keyFile] file is missing."
         log_warn "Create the missing Kubernetes secrets after deployment; use command: kubectl -create secret tls $secretName --namespace $namespace --key=cert_key_file --cert=cert_file"
@@ -159,7 +158,7 @@
             log_debug "Secret [$SMTP_USER_SECRET] exists; will use it for SMTP user credentials"
         elif [ -z "$SMTP_USER" ] && [ -z "$SMTP_PASSWORD" ]; then
             log_debug "Neither SMTP_USER nor SMTP_PASSWORD are set; skipping creation of secret [$SMTP_USER_SECRET]"
-        elif  [ -z "$SMTP_USER" ] || [ -z "$SMTP_PASSWORD" ]; then
+        elif [ -z "$SMTP_USER" ] || [ -z "$SMTP_PASSWORD" ]; then
             log_error "Complete SMTP Credentials NOT provided; MUST provide BOTH [SMTP_USER] and [SMTP_PASSWORD]"
             log_info "SMTP_USER is set to [$SMTP_USER] and SMTP_PASSWORD is set to [$SMTP_PASSWORD]"
             exit 1
@@ -172,12 +171,11 @@
 
     export AUTOGENERATE_SOURCED="true"
 
-    elif [ "$AUTOGENERATE_SOURCED" == "NotNeeded" ]; then
-        log_debug "autogenerate-include.sh not needed"
-    else
-        log_debug "autogenerate-include.sh was already sourced [$AUTOGENERATE_SOURCED]"
-fi
-
+elif [ "$AUTOGENERATE_SOURCED" == "NotNeeded" ]; then
+    log_debug "autogenerate-include.sh not needed"
+else
+    log_debug "autogenerate-include.sh was already sourced [$AUTOGENERATE_SOURCED]"
+fi
 
 function checkStorageClass {
     # input parms: $1  *Name of env var* identifying storageClass
@@ -192,7 +190,7 @@
         log_error "Required parameter not provided.  Either [$storageClassEnvVar] or [STORAGECLASS] MUST be provided."
         exit 1
     else
-        if $(kubectl get storageClass "$storageClass" -o name &>/dev/null); then
+        if $(kubectl get storageClass "$storageClass" -o name &> /dev/null); then
             log_debug "The specified StorageClass [$storageClass] exists"
         else
             log_error "The specified StorageClass [$storageClass] does NOT exist"
diff monitoring/bin/deploy_monitoring_cluster.sh.orig monitoring/bin/deploy_monitoring_cluster.sh
--- monitoring/bin/deploy_monitoring_cluster.sh.orig
+++ monitoring/bin/deploy_monitoring_cluster.sh
@@ -70,31 +70,31 @@
         log_debug "File [$autogeneratedYAMLFile] already exists"
     fi
 
-   smtpHost="${SMTP_HOST}"
-   smtpPort="${SMTP_PORT}"
-   smtpFromAddress="${SMTP_FROM_ADDRESS}"
-   smtpFromName="${SMTP_FROM_NAME}"
-   smtpUserSecret="${SMTP_USER_SECRET}"
-   smtpSkipVerify="${SMTP_SKIP_VERIFY:-false}"
-   smtpTLSCertFile="${SMTP_TLS_CERT_FILE:-/cert/tls.crt}"
-   smtpTLSKeyFile="${SMTP_TLS_KEY_FILE:-/cert/tls.key}"
-   ###smtpTLSSecret="${SMTP_TLS_REQUIRED}"
-
-   yq -i '.grafana."grafana.ini".smtp.enabled=true' "$autogeneratedYAMLFile"
-
-   value="$smtpHost:$smtpPort" yq -i '.grafana."grafana.ini".smtp.host=env(value)' "$autogeneratedYAMLFile"
-
-   value="$smtpFromAddress" yq -i '.grafana."grafana.ini".smtp.from_address=env(value)' "$autogeneratedYAMLFile"
-   value="$smtpFromName" yq -i '.grafana."grafana.ini".smtp.from_name=env(value)' "$autogeneratedYAMLFile"
-
-   if [ -n "$smtpUserSecret" ]; then
-       value="$smtpUserSecret" yq -i '.grafana.smtp.existingSecret=env(value)' "$autogeneratedYAMLFile"
-   fi
-
-   value="$smtpSkipVerify" yq -i '.grafana."grafana.ini".smtp.skip_verify=env(value)' "$autogeneratedYAMLFile"
-
-   value="$smtpTLSCertFile" yq -i '.grafana."grafana.ini".smtp.cert_file=env(value)' "$autogeneratedYAMLFile"
-   value="$smtpTLSKeyFile" yq -i '.grafana."grafana.ini".smtp.key_file=env(value)' "$autogeneratedYAMLFile"
+    smtpHost="${SMTP_HOST}"
+    smtpPort="${SMTP_PORT}"
+    smtpFromAddress="${SMTP_FROM_ADDRESS}"
+    smtpFromName="${SMTP_FROM_NAME}"
+    smtpUserSecret="${SMTP_USER_SECRET}"
+    smtpSkipVerify="${SMTP_SKIP_VERIFY:-false}"
+    smtpTLSCertFile="${SMTP_TLS_CERT_FILE:-/cert/tls.crt}"
+    smtpTLSKeyFile="${SMTP_TLS_KEY_FILE:-/cert/tls.key}"
+    ###smtpTLSSecret="${SMTP_TLS_REQUIRED}"
+
+    yq -i '.grafana."grafana.ini".smtp.enabled=true' "$autogeneratedYAMLFile"
+
+    value="$smtpHost:$smtpPort" yq -i '.grafana."grafana.ini".smtp.host=env(value)' "$autogeneratedYAMLFile"
+
+    value="$smtpFromAddress" yq -i '.grafana."grafana.ini".smtp.from_address=env(value)' "$autogeneratedYAMLFile"
+    value="$smtpFromName" yq -i '.grafana."grafana.ini".smtp.from_name=env(value)' "$autogeneratedYAMLFile"
+
+    if [ -n "$smtpUserSecret" ]; then
+        value="$smtpUserSecret" yq -i '.grafana.smtp.existingSecret=env(value)' "$autogeneratedYAMLFile"
+    fi
+
+    value="$smtpSkipVerify" yq -i '.grafana."grafana.ini".smtp.skip_verify=env(value)' "$autogeneratedYAMLFile"
+
+    value="$smtpTLSCertFile" yq -i '.grafana."grafana.ini".smtp.cert_file=env(value)' "$autogeneratedYAMLFile"
+    value="$smtpTLSKeyFile" yq -i '.grafana."grafana.ini".smtp.key_file=env(value)' "$autogeneratedYAMLFile"
 
 #    if [ -n "$smtpUser" ]; then
 #        value="$smtpUser" yq -i '.grafana."grafana.ini".smtp.user=env(value)' "$autogeneratedYAMLFile"
@@ -107,7 +107,6 @@
     log_debug "Auto-generation of SMTP not enabled; skipping Grafana SMTP server configuration"
 fi
 
-
 PROM_OPER_USER_YAML="${PROM_OPER_USER_YAML:-$USER_DIR/monitoring/user-values-prom-operator.yaml}"
 if [ ! -f "$PROM_OPER_USER_YAML" ]; then
     log_debug "[$PROM_OPER_USER_YAML] not found. Using $TMP_DIR/empty.yaml"
----------

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

  shfmt -s -i 4 -bn -sr -ln bash -w filename


Copy link
Contributor

sh-checker report

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

shellcheck errors

'shellcheck -e SC1004' returned error 1 finding the following syntactical issues:

----------

In bin/autogenerate-include.sh line 1:
# Copyright © 2025, SAS Institute Inc., Cary, NC, USA.  All Rights Reserved.
^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.


In bin/autogenerate-include.sh line 38:
        kubectl -n $namespace label secret $secretName  managed-by="v4m-es-script"
                   ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                           ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
        kubectl -n "$namespace" label secret "$secretName"  managed-by="v4m-es-script"


In bin/autogenerate-include.sh line 39:
    elif [ ! -z "$certFile$keyFile" ]; then
           ^-- SC2236 (style): Use -n instead of ! -z.


In bin/autogenerate-include.sh line 74:
        BASE_DOMAIN="${BASE_DOMAIN}"
        ^---------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 90:
        INGRESS_CERT="${INGRESS_CERT}"
        ^----------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 91:
        INGRESS_KEY="${INGRESS_KEY}"
        ^---------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 196:
        if $(kubectl get storageClass "$storageClass" -o name &>/dev/null); then
           ^-- SC2091 (warning): Remove surrounding $() to avoid executing output (or use eval if intentional).

For more information:
  https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...
  https://www.shellcheck.net/wiki/SC2091 -- Remove surrounding $() to avoid e...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors

'shfmt -s -i 4 -bn -sr -ln bash' returned error 1 finding the following formatting issues:

----------
diff bin/autogenerate-include.sh.orig bin/autogenerate-include.sh
--- bin/autogenerate-include.sh.orig
+++ bin/autogenerate-include.sh
@@ -4,7 +4,6 @@
 # This file is not marked as executable as it is intended to be sourced
 # Current directory must be the root directory of the repo
 
-
 function checkYqVersion {
     # confirm yq installed and correct version
     local goodver yq_version
@@ -35,7 +34,7 @@
     if [ -f "$certFile" ] && [ -f "$keyFile" ]; then
         kubectl delete secret "$secretName" --namespace "$namespace" --ignore-not-found
         kubectl create secret tls "$secretName" --namespace "$namespace" --key="$keyFile" --cert="$certFile"
-        kubectl -n $namespace label secret $secretName  managed-by="v4m-es-script"
+        kubectl -n $namespace label secret $secretName managed-by="v4m-es-script"
     elif [ ! -z "$certFile$keyFile" ]; then
         log_warn "Missing Ingress certificate file; specified Ingress cert [$certFile] and/or key [$keyFile] file is missing."
         log_warn "Create the missing Kubernetes secrets after deployment; use command: kubectl -create secret tls $secretName --namespace $namespace --key=cert_key_file --cert=cert_file"
@@ -159,7 +158,7 @@
             log_debug "Secret [$SMTP_USER_SECRET] exists; will use it for SMTP user credentials"
         elif [ -z "$SMTP_USER" ] && [ -z "$SMTP_PASSWORD" ]; then
             log_debug "Neither SMTP_USER nor SMTP_PASSWORD are set; skipping creation of secret [$SMTP_USER_SECRET]"
-        elif  [ -z "$SMTP_USER" ] || [ -z "$SMTP_PASSWORD" ]; then
+        elif [ -z "$SMTP_USER" ] || [ -z "$SMTP_PASSWORD" ]; then
             log_error "Complete SMTP Credentials NOT provided; MUST provide BOTH [SMTP_USER] and [SMTP_PASSWORD]"
             log_info "SMTP_USER is set to [$SMTP_USER] and SMTP_PASSWORD is set to [$SMTP_PASSWORD]"
             exit 1
@@ -173,12 +172,11 @@
 
     export AUTOGENERATE_SOURCED="true"
 
-    elif [ "$AUTOGENERATE_SOURCED" == "NotNeeded" ]; then
-        log_debug "autogenerate-include.sh not needed"
-    else
-        log_debug "autogenerate-include.sh was already sourced [$AUTOGENERATE_SOURCED]"
-fi
-
+elif [ "$AUTOGENERATE_SOURCED" == "NotNeeded" ]; then
+    log_debug "autogenerate-include.sh not needed"
+else
+    log_debug "autogenerate-include.sh was already sourced [$AUTOGENERATE_SOURCED]"
+fi
 
 function checkStorageClass {
     # input parms: $1  *Name of env var* identifying storageClass
@@ -193,7 +191,7 @@
         log_error "Required parameter not provided.  Either [$storageClassEnvVar] or [STORAGECLASS] MUST be provided."
         exit 1
     else
-        if $(kubectl get storageClass "$storageClass" -o name &>/dev/null); then
+        if $(kubectl get storageClass "$storageClass" -o name &> /dev/null); then
             log_debug "The specified StorageClass [$storageClass] exists"
         else
             log_error "The specified StorageClass [$storageClass] does NOT exist"
----------

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

  shfmt -s -i 4 -bn -sr -ln bash -w filename


@gsmith-sas
Copy link
Member Author

I'm going to hold off on addressing the shellcheck changes since they are limited to bin/autogenerate-include.sh. That is one of the files we are updating in the next sprint when we bring the last batch of files up-to-date with the shellcheck standard.

@gsmith-sas gsmith-sas requested a review from ceelias September 15, 2025 15:31
* [UPGRADE] Fluent Bit Helm chart upgraded from 0.49.0 to 0.52.0
* [UPGRADE] Elasticsearch Exporer Helm chart upgraded from 6.7.2 to 7.0.0
* [UPGRADE] OpenSearch Data Source Plugin to Grafana upgraded from 2.28.0 to 2.29.1
* **Metrics**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to link to docs in the last sentence?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with the proper link.

Copy link
Contributor

sh-checker report

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

shellcheck errors

'shellcheck -e SC1004' returned error 1 finding the following syntactical issues:

----------

In bin/autogenerate-include.sh line 1:
# Copyright © 2025, SAS Institute Inc., Cary, NC, USA.  All Rights Reserved.
^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.


In bin/autogenerate-include.sh line 38:
        kubectl -n $namespace label secret $secretName  managed-by="v4m-es-script"
                   ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                           ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
        kubectl -n "$namespace" label secret "$secretName"  managed-by="v4m-es-script"


In bin/autogenerate-include.sh line 39:
    elif [ ! -z "$certFile$keyFile" ]; then
           ^-- SC2236 (style): Use -n instead of ! -z.


In bin/autogenerate-include.sh line 74:
        BASE_DOMAIN="${BASE_DOMAIN}"
        ^---------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 90:
        INGRESS_CERT="${INGRESS_CERT}"
        ^----------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 91:
        INGRESS_KEY="${INGRESS_KEY}"
        ^---------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 196:
        if $(kubectl get storageClass "$storageClass" -o name &>/dev/null); then
           ^-- SC2091 (warning): Remove surrounding $() to avoid executing output (or use eval if intentional).

For more information:
  https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...
  https://www.shellcheck.net/wiki/SC2091 -- Remove surrounding $() to avoid e...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors

'shfmt -s -i 4 -bn -sr -ln bash' returned error 1 finding the following formatting issues:

----------
diff bin/autogenerate-include.sh.orig bin/autogenerate-include.sh
--- bin/autogenerate-include.sh.orig
+++ bin/autogenerate-include.sh
@@ -4,7 +4,6 @@
 # This file is not marked as executable as it is intended to be sourced
 # Current directory must be the root directory of the repo
 
-
 function checkYqVersion {
     # confirm yq installed and correct version
     local goodver yq_version
@@ -35,7 +34,7 @@
     if [ -f "$certFile" ] && [ -f "$keyFile" ]; then
         kubectl delete secret "$secretName" --namespace "$namespace" --ignore-not-found
         kubectl create secret tls "$secretName" --namespace "$namespace" --key="$keyFile" --cert="$certFile"
-        kubectl -n $namespace label secret $secretName  managed-by="v4m-es-script"
+        kubectl -n $namespace label secret $secretName managed-by="v4m-es-script"
     elif [ ! -z "$certFile$keyFile" ]; then
         log_warn "Missing Ingress certificate file; specified Ingress cert [$certFile] and/or key [$keyFile] file is missing."
         log_warn "Create the missing Kubernetes secrets after deployment; use command: kubectl -create secret tls $secretName --namespace $namespace --key=cert_key_file --cert=cert_file"
@@ -159,7 +158,7 @@
             log_debug "Secret [$SMTP_USER_SECRET] exists; will use it for SMTP user credentials"
         elif [ -z "$SMTP_USER" ] && [ -z "$SMTP_PASSWORD" ]; then
             log_debug "Neither SMTP_USER nor SMTP_PASSWORD are set; skipping creation of secret [$SMTP_USER_SECRET]"
-        elif  [ -z "$SMTP_USER" ] || [ -z "$SMTP_PASSWORD" ]; then
+        elif [ -z "$SMTP_USER" ] || [ -z "$SMTP_PASSWORD" ]; then
             log_error "Complete SMTP Credentials NOT provided; MUST provide BOTH [SMTP_USER] and [SMTP_PASSWORD]"
             log_info "SMTP_USER is set to [$SMTP_USER] and SMTP_PASSWORD is set to [$SMTP_PASSWORD]"
             exit 1
@@ -173,12 +172,11 @@
 
     export AUTOGENERATE_SOURCED="true"
 
-    elif [ "$AUTOGENERATE_SOURCED" == "NotNeeded" ]; then
-        log_debug "autogenerate-include.sh not needed"
-    else
-        log_debug "autogenerate-include.sh was already sourced [$AUTOGENERATE_SOURCED]"
-fi
-
+elif [ "$AUTOGENERATE_SOURCED" == "NotNeeded" ]; then
+    log_debug "autogenerate-include.sh not needed"
+else
+    log_debug "autogenerate-include.sh was already sourced [$AUTOGENERATE_SOURCED]"
+fi
 
 function checkStorageClass {
     # input parms: $1  *Name of env var* identifying storageClass
@@ -193,7 +191,7 @@
         log_error "Required parameter not provided.  Either [$storageClassEnvVar] or [STORAGECLASS] MUST be provided."
         exit 1
     else
-        if $(kubectl get storageClass "$storageClass" -o name &>/dev/null); then
+        if $(kubectl get storageClass "$storageClass" -o name &> /dev/null); then
             log_debug "The specified StorageClass [$storageClass] exists"
         else
             log_error "The specified StorageClass [$storageClass] does NOT exist"
----------

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

  shfmt -s -i 4 -bn -sr -ln bash -w filename


@gsmith-sas gsmith-sas requested a review from ceelias September 16, 2025 16:00
Copy link
Contributor

sh-checker report

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

shellcheck errors

'shellcheck -e SC1004' returned error 1 finding the following syntactical issues:

----------

In bin/autogenerate-include.sh line 1:
# Copyright © 2025, SAS Institute Inc., Cary, NC, USA.  All Rights Reserved.
^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.


In bin/autogenerate-include.sh line 38:
        kubectl -n $namespace label secret $secretName  managed-by="v4m-es-script"
                   ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                           ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
        kubectl -n "$namespace" label secret "$secretName"  managed-by="v4m-es-script"


In bin/autogenerate-include.sh line 39:
    elif [ ! -z "$certFile$keyFile" ]; then
           ^-- SC2236 (style): Use -n instead of ! -z.


In bin/autogenerate-include.sh line 74:
        BASE_DOMAIN="${BASE_DOMAIN}"
        ^---------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 90:
        INGRESS_CERT="${INGRESS_CERT}"
        ^----------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 91:
        INGRESS_KEY="${INGRESS_KEY}"
        ^---------^ SC2269 (info): This variable is assigned to itself, so the assignment does nothing.


In bin/autogenerate-include.sh line 196:
        if $(kubectl get storageClass "$storageClass" -o name &>/dev/null); then
           ^-- SC2091 (warning): Remove surrounding $() to avoid executing output (or use eval if intentional).

For more information:
  https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...
  https://www.shellcheck.net/wiki/SC2091 -- Remove surrounding $() to avoid e...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors

'shfmt -s -i 4 -bn -sr -ln bash' returned error 1 finding the following formatting issues:

----------
diff bin/autogenerate-include.sh.orig bin/autogenerate-include.sh
--- bin/autogenerate-include.sh.orig
+++ bin/autogenerate-include.sh
@@ -4,7 +4,6 @@
 # This file is not marked as executable as it is intended to be sourced
 # Current directory must be the root directory of the repo
 
-
 function checkYqVersion {
     # confirm yq installed and correct version
     local goodver yq_version
@@ -35,7 +34,7 @@
     if [ -f "$certFile" ] && [ -f "$keyFile" ]; then
         kubectl delete secret "$secretName" --namespace "$namespace" --ignore-not-found
         kubectl create secret tls "$secretName" --namespace "$namespace" --key="$keyFile" --cert="$certFile"
-        kubectl -n $namespace label secret $secretName  managed-by="v4m-es-script"
+        kubectl -n $namespace label secret $secretName managed-by="v4m-es-script"
     elif [ ! -z "$certFile$keyFile" ]; then
         log_warn "Missing Ingress certificate file; specified Ingress cert [$certFile] and/or key [$keyFile] file is missing."
         log_warn "Create the missing Kubernetes secrets after deployment; use command: kubectl -create secret tls $secretName --namespace $namespace --key=cert_key_file --cert=cert_file"
@@ -159,7 +158,7 @@
             log_debug "Secret [$SMTP_USER_SECRET] exists; will use it for SMTP user credentials"
         elif [ -z "$SMTP_USER" ] && [ -z "$SMTP_PASSWORD" ]; then
             log_debug "Neither SMTP_USER nor SMTP_PASSWORD are set; skipping creation of secret [$SMTP_USER_SECRET]"
-        elif  [ -z "$SMTP_USER" ] || [ -z "$SMTP_PASSWORD" ]; then
+        elif [ -z "$SMTP_USER" ] || [ -z "$SMTP_PASSWORD" ]; then
             log_error "Complete SMTP Credentials NOT provided; MUST provide BOTH [SMTP_USER] and [SMTP_PASSWORD]"
             log_info "SMTP_USER is set to [$SMTP_USER] and SMTP_PASSWORD is set to [$SMTP_PASSWORD]"
             exit 1
@@ -173,12 +172,11 @@
 
     export AUTOGENERATE_SOURCED="true"
 
-    elif [ "$AUTOGENERATE_SOURCED" == "NotNeeded" ]; then
-        log_debug "autogenerate-include.sh not needed"
-    else
-        log_debug "autogenerate-include.sh was already sourced [$AUTOGENERATE_SOURCED]"
-fi
-
+elif [ "$AUTOGENERATE_SOURCED" == "NotNeeded" ]; then
+    log_debug "autogenerate-include.sh not needed"
+else
+    log_debug "autogenerate-include.sh was already sourced [$AUTOGENERATE_SOURCED]"
+fi
 
 function checkStorageClass {
     # input parms: $1  *Name of env var* identifying storageClass
@@ -193,7 +191,7 @@
         log_error "Required parameter not provided.  Either [$storageClassEnvVar] or [STORAGECLASS] MUST be provided."
         exit 1
     else
-        if $(kubectl get storageClass "$storageClass" -o name &>/dev/null); then
+        if $(kubectl get storageClass "$storageClass" -o name &> /dev/null); then
             log_debug "The specified StorageClass [$storageClass] exists"
         else
             log_error "The specified StorageClass [$storageClass] does NOT exist"
----------

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

  shfmt -s -i 4 -bn -sr -ln bash -w filename


@gsmith-sas gsmith-sas merged commit 803f4a4 into main Sep 16, 2025
1 of 2 checks passed
@gsmith-sas gsmith-sas deleted the grafanasmtp branch September 16, 2025 17:33
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