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

Containerimg #597

Closed
wants to merge 27 commits into from
Closed

Containerimg #597

wants to merge 27 commits into from

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/common.sh line 1:
# Copyright © 2021, 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/common.sh line 20:
         extract_trap_cmd() { printf '%s\n' "$3"; }
                              ^----------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/common.sh line 29:
      log_error "Exiting script [`basename $0`] due to an error executing the command [$BASH_COMMAND]."
                                 ^-----------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
                                           ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      log_error "Exiting script [$(basename "$0")] due to an error executing the command [$BASH_COMMAND]."


In bin/common.sh line 31:
      log_debug "Trap [ERR] triggered in [`basename $0`] while executing the command [$BASH_COMMAND]."
                                          ^-----------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
                                                    ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      log_debug "Trap [ERR] triggered in [$(basename "$0")] while executing the command [$BASH_COMMAND]."


In bin/common.sh line 40:
    source bin/colors-include.sh
           ^-------------------^ SC1091 (info): Not following: bin/colors-include.sh was not specified as input (see shellcheck -x).


In bin/common.sh line 41:
    source bin/log-include.sh
           ^----------------^ SC1091 (info): Not following: bin/log-include.sh was not specified as input (see shellcheck -x).


In bin/common.sh line 42:
    source bin/openshift-include.sh
           ^----------------------^ SC1091 (info): Not following: bin/openshift-include.sh was not specified as input (see shellcheck -x).


In bin/common.sh line 44:
    if [ ! $(which sha256sum) ]; then
           ^----------------^ SC2046 (warning): Quote this to prevent word splitting.


In bin/common.sh line 57:
            export $userEnv
                   ^------^ SC2163 (warning): This does not export 'userEnv'. Remove $/${} for that, or use ${var?} to quiet.
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
            export "$userEnv"


In bin/common.sh line 69:
      export USER_DIR=$(cd "$(dirname "$USER_DIR")"; pwd)/$(basename "$USER_DIR")
             ^------^ SC2155 (warning): Declare and assign separately to avoid masking return values.
                        ^-------------------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

Did you mean: 
      export USER_DIR=$(cd "$(dirname "$USER_DIR")" || exit; pwd)/$(basename "$USER_DIR")


In bin/common.sh line 72:
        userEnv=$(grep -v '^[[:blank:]]*$' $USER_DIR/user.env | grep -v '^#' | xargs)
                                           ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
        userEnv=$(grep -v '^[[:blank:]]*$' "$USER_DIR"/user.env | grep -v '^#' | xargs)


In bin/common.sh line 76:
            export $userEnv
                   ^------^ SC2163 (warning): This does not export 'userEnv'. Remove $/${} for that, or use ${var?} to quiet.
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
            export "$userEnv"


In bin/common.sh line 88:
       source bin/helm-include.sh
              ^-----------------^ SC1091 (info): Not following: bin/helm-include.sh was not specified as input (see shellcheck -x).


In bin/common.sh line 94:
       source bin/kube-include.sh
              ^-----------------^ SC1091 (info): Not following: bin/kube-include.sh was not specified as input (see shellcheck -x).


In bin/common.sh line 121:
    export TMP_DIR=$(mktemp -d -t sas.mon.XXXXXXXX)
           ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values.


In bin/common.sh line 127:
    echo "# This file intentionally empty" > $TMP_DIR/empty.yaml
                                             ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    echo "# This file intentionally empty" > "$TMP_DIR"/empty.yaml


In bin/common.sh line 177:
      for n in ${reservedNames[@]}; do
               ^-----------------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements.


In bin/common.sh line 218:
      kubectl -n $ns patch serviceAccount $sa_name -p '{"automountServiceAccountToken":false}'
                 ^-^ 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 "$ns" patch serviceAccount "$sa_name" -p '{"automountServiceAccountToken":false}'


In bin/common.sh line 238:
        kubectl -n $ns patch $resource_type  $resource_name -p '{"spec": {"template": {"spec": {"automountServiceAccountToken":true}}}}'
                   ^-^ SC2086 (info): Double quote to prevent globbing and word splitting.
                             ^------------^ 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 "$ns" patch "$resource_type"  "$resource_name" -p '{"spec": {"template": {"spec": {"automountServiceAccountToken":true}}}}'


In bin/common.sh line 258:
   fullImage="$1"
   ^-------^ SC2034 (warning): fullImage appears unused. Verify use (or export if used externally).


In bin/common.sh line 301:
      rm -f  $imageKeysFile
             ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      rm -f  "$imageKeysFile"


In bin/common.sh line 302:
      cp $template_file  $imageKeysFile
         ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                         ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      cp "$template_file"  "$imageKeysFile"


In bin/test-fb-image.sh line 4:
   fullImage="$1"
   ^-------^ SC2034 (warning): fullImage appears unused. Verify use (or export if used externally).


In bin/test-fb-image.sh line 123:
      cp $template_file  $tempfile
         ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      cp "$template_file"  $tempfile


In bin/test-fb-image.sh line 184:
LOG_NS=foo
^--------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image.sh line 185:
FLUENTBIT_HELM_CHART_VERSION=0.40.0
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image.sh line 186:
touch /tmp/empty.yaml
^-------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image.sh line 187:
FB_OPENSEARCH_USER_YAML=/tmp/empty.yaml
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image.sh line 188:
set -x
^----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image.sh line 189:
helm $helmDebug upgrade --install --namespace $LOG_NS fb-testing  \
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
     ^--------^ SC2154 (warning): helmDebug is referenced but not assigned.
     ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
helm "$helmDebug" upgrade --install --namespace "$LOG_NS" fb-testing  \


In bin/test-fb-image.sh line 190:
  --version $FLUENTBIT_HELM_CHART_VERSION \
            ^---------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --version "$FLUENTBIT_HELM_CHART_VERSION" \


In bin/test-fb-image.sh line 193:
  --values $FB_OPENSEARCH_USER_YAML   \
           ^----------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --values "$FB_OPENSEARCH_USER_YAML"   \


In bin/test-fb-image2.sh line 4:
   fullImage="$1"
   ^-------^ SC2034 (warning): fullImage appears unused. Verify use (or export if used externally).


In bin/test-fb-image2.sh line 52:
      cp $template_file  $tempfile
         ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      cp "$template_file"  $tempfile


In bin/test-fb-image2.sh line 79:
            export $userEnv
                   ^------^ SC2163 (warning): This does not export 'userEnv'. Remove $/${} for that, or use ${var?} to quiet.
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
            export "$userEnv"


In bin/test-fb-image2.sh line 110:
doitall "$OSD_FULL_IMAGE"         "logging/opensearch/osd_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 111:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In bin/test-fb-image2.sh line 114:
doitall "$ES_EXPORTER_FULL_IMAGE" "logging/esexporter/es-exporter_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 115:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In bin/test-fb-image2.sh line 119:
doitall "$GRAFANA_FULL_IMAGE"     "monitoring/grafana_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 120:
doitall "$GRAFANA_SIDECAR_FULL_IMAGE"   "TEMPFILE"  "SIDECAR_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 121:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In bin/test-fb-image2.sh line 133:
doitall "$PROMOP_FULL_IMAGE"          "monitoring/prom-operator_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 134:
doitall "$ALERTMANAGER_FULL_IMAGE"    "TEMPFILE"  "ALERTMANAGER_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 135:
doitall "$ADMWEBHOOK_FULL_IMAGE"      "TEMPFILE"  "ADMWEBHOOK_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 136:
doitall "$KSM_FULL_IMAGE"             "TEMPFILE"  "KSM_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 137:
doitall "$NODEXPORT_FULL_IMAGE"       "TEMPFILE"  "NODEXPORT_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 138:
doitall "$PROMETHEUS_FULL_IMAGE"      "TEMPFILE"  "PROMETHEUS_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 139:
doitall "$CONFIGRELOAD_FULL_IMAGE"    "TEMPFILE"  "CONFIGRELOAD_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 140:
doitall "$GRAFANA_FULL_IMAGE"         "TEMPFILE"  "GRAFANA_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 141:
doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE"  "SIDECAR_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 142:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In bin/test-fb-image2.sh line 145:
doitall "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 146:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In bin/test-fb-image2.sh line 149:
doitall "$PUSHGATEWAY_FULL_IMAGE" "monitoring/pushgateway_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 150:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In logging/bin/deploy_esexporter.sh line 6:
cd "$(dirname $BASH_SOURCE)/../.."
              ^----------^ SC2128 (warning): Expanding an array without an index only gives the first element.
              ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cd "$(dirname "$BASH_SOURCE")/../.."


In logging/bin/deploy_esexporter.sh line 7:
source logging/bin/common.sh
       ^-------------------^ SC1091 (info): Not following: logging/bin/common.sh was not specified as input (see shellcheck -x).


In logging/bin/deploy_esexporter.sh line 8:
source logging/bin/secrets-include.sh
       ^----------------------------^ SC1091 (info): Not following: logging/bin/secrets-include.sh was not specified as input (see shellcheck -x).


In logging/bin/deploy_esexporter.sh line 10:
this_script=`basename "$0"`
            ^-------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.

Did you mean: 
this_script=$(basename "$0")


In logging/bin/deploy_esexporter.sh line 31:
if [ "$(kubectl get ns $LOG_NS -o name 2>/dev/null)" == "" ]; then
                       ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if [ "$(kubectl get ns "$LOG_NS" -o name 2>/dev/null)" == "" ]; then


In logging/bin/deploy_esexporter.sh line 42:
if helm3ReleaseExists es-exporter $LOG_NS; then
                                  ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if helm3ReleaseExists es-exporter "$LOG_NS"; then


In logging/bin/deploy_esexporter.sh line 44:
   if [ -z $(kubectl -n $LOG_NS get pods -l "app=prometheus-elasticsearch-exporter,searchbackend=opensearch" -o name 2>/dev/null) ]; then
           ^-- SC2046 (warning): Quote this to prevent word splitting.
                        ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   if [ -z $(kubectl -n "$LOG_NS" get pods -l "app=prometheus-elasticsearch-exporter,searchbackend=opensearch" -o name 2>/dev/null) ]; then


In logging/bin/deploy_esexporter.sh line 46:
      helm -n $LOG_NS delete es-exporter
              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      helm -n "$LOG_NS" delete es-exporter


In logging/bin/deploy_esexporter.sh line 70:
  source bin/airgap-include.sh
         ^-------------------^ SC1091 (info): Not following: bin/airgap-include.sh was not specified as input (see shellcheck -x).


In logging/bin/deploy_esexporter.sh line 84:
cat "$imageKeysFile"     #DEBUGGING-REMOVE
     ^------------^ SC2154 (warning): imageKeysFile is referenced but not assigned.


In logging/bin/deploy_esexporter.sh line 119:
helm2ReleaseCheck es-exporter-$LOG_NS
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
helm2ReleaseCheck es-exporter-"$LOG_NS"


In logging/bin/deploy_esexporter.sh line 124:
chart2install="$(get_helmchart_reference $ESEXPORTER_HELM_CHART_REPO $ESEXPORTER_HELM_CHART_NAME $ESEXPORTER_HELM_CHART_VERSION)"
                                         ^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                     ^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                                 ^----------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
chart2install="$(get_helmchart_reference "$ESEXPORTER_HELM_CHART_REPO" "$ESEXPORTER_HELM_CHART_NAME" "$ESEXPORTER_HELM_CHART_VERSION")"


In logging/bin/deploy_esexporter.sh line 127:
helm $helmDebug upgrade --install es-exporter \
     ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
helm "$helmDebug" upgrade --install es-exporter \


In logging/bin/deploy_esexporter.sh line 128:
 --namespace $LOG_NS \
             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 --namespace "$LOG_NS" \


In logging/bin/deploy_esexporter.sh line 129:
 --version $ESEXPORTER_HELM_CHART_VERSION \
           ^----------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 --version "$ESEXPORTER_HELM_CHART_VERSION" \


In logging/bin/deploy_esexporter.sh line 130:
 -f $imageKeysFile \
    ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 -f "$imageKeysFile" \


In logging/bin/deploy_esexporter.sh line 132:
 -f $wnpValuesFile \
    ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 -f "$wnpValuesFile" \


In logging/bin/deploy_esexporter.sh line 133:
 -f $openshiftValuesFile \
    ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 -f "$openshiftValuesFile" \


In logging/bin/deploy_esexporter.sh line 134:
 -f $ES_OPEN_EXPORTER_USER_YAML \
    ^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 -f "$ES_OPEN_EXPORTER_USER_YAML" \


In logging/bin/deploy_esexporter.sh line 136:
 $chart2install
 ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 "$chart2install"

For more information:
  https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ...
  https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...
  https://www.shellcheck.net/wiki/SC2034 -- fullImage appears unused. Verify ...
----------

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' returned error 1 finding the following formatting issues:

----------
--- bin/common.sh.orig
+++ bin/common.sh
@@ -5,244 +5,244 @@
 # Current directory must be the root directory of the repo
 
 function trap_add() {
- # based on https://stackoverflow.com/questions/3338030/multiple-bash-traps-for-the-same-signal
- # but: prepends new cmd rather than append it, changed var names and eliminated messages
+	# based on https://stackoverflow.com/questions/3338030/multiple-bash-traps-for-the-same-signal
+	# but: prepends new cmd rather than append it, changed var names and eliminated messages
 
-   local cmd_to_add signal
+	local cmd_to_add signal
 
-   cmd_to_add=$1; shift
-   for signal in "$@"; do
-      trap -- "$(
-         # print the new trap command
-         printf '%s\n' "${cmd_to_add}"
-         # helper fn to get existing trap command from output
-         # of trap -p
-         extract_trap_cmd() { printf '%s\n' "$3"; }
-         # print existing trap command with newline
-         eval "extract_trap_cmd $(trap -p "${signal}")"
-      )" "${signal}"
-   done
+	cmd_to_add=$1
+	shift
+	for signal in "$@"; do
+		trap -- "$(
+			# print the new trap command
+			printf '%s\n' "${cmd_to_add}"
+			# helper fn to get existing trap command from output
+			# of trap -p
+			extract_trap_cmd() { printf '%s\n' "$3"; }
+			# print existing trap command with newline
+			eval "extract_trap_cmd $(trap -p "${signal}")"
+		)" "${signal}"
+	done
 }
 
 function errexit_msg {
-   if [ -o errexit ]; then
-      log_error "Exiting script [`basename $0`] due to an error executing the command [$BASH_COMMAND]."
-   else
-      log_debug "Trap [ERR] triggered in [`basename $0`] while executing the command [$BASH_COMMAND]."
-   fi
+	if [ -o errexit ]; then
+		log_error "Exiting script [$(basename $0)] due to an error executing the command [$BASH_COMMAND]."
+	else
+		log_debug "Trap [ERR] triggered in [$(basename $0)] while executing the command [$BASH_COMMAND]."
+	fi
 }
 
 if [ "$SAS_COMMON_SOURCED" = "" ]; then
-    # Save standard out to a new descriptor
-    exec 3>&1
+	# Save standard out to a new descriptor
+	exec 3>&1
 
-    # Includes
-    source bin/colors-include.sh
-    source bin/log-include.sh
-    source bin/openshift-include.sh
+	# Includes
+	source bin/colors-include.sh
+	source bin/log-include.sh
+	source bin/openshift-include.sh
 
-    if [ ! $(which sha256sum) ]; then
-      log_error "Missing required utility: sha256sum"
-      exit 1
-    fi
+	if [ ! $(which sha256sum) ]; then
+		log_error "Missing required utility: sha256sum"
+		exit 1
+	fi
 
-    # Load component Helm chart version infomation
-    # NOTE: This is loaded prior to the USER_DIR to allow
-    # overriding these defaults via USER_DIR user.env files
-    if [ -f "component_versions.env" ]; then
-        userEnv=$(grep -v '^[[:blank:]]*$' component_versions.env | grep -v '^#' | xargs)
-        if [ "$userEnv" != "" ]; then
-          log_debug "Loading global user environment file: component_versions.env"
-          if [ "$userEnv" != "" ]; then
-            export $userEnv
-          fi
-        fi
-    else
-        log_debug "No component_versions.env file found"
-    fi
+	# Load component Helm chart version infomation
+	# NOTE: This is loaded prior to the USER_DIR to allow
+	# overriding these defaults via USER_DIR user.env files
+	if [ -f "component_versions.env" ]; then
+		userEnv=$(grep -v '^[[:blank:]]*$' component_versions.env | grep -v '^#' | xargs)
+		if [ "$userEnv" != "" ]; then
+			log_debug "Loading global user environment file: component_versions.env"
+			if [ "$userEnv" != "" ]; then
+				export $userEnv
+			fi
+		fi
+	else
+		log_debug "No component_versions.env file found"
+	fi
 
+	export USER_DIR=${USER_DIR:-$(pwd)}
+	if [ -d "$USER_DIR" ]; then
+		# Resolve full path
+		export USER_DIR=$(
+			cd "$(dirname "$USER_DIR")"
+			pwd
+		)/$(basename "$USER_DIR")
+	fi
+	if [ -f "$USER_DIR/user.env" ]; then
+		userEnv=$(grep -v '^[[:blank:]]*$' $USER_DIR/user.env | grep -v '^#' | xargs)
+		if [ "$userEnv" != "" ]; then
+			log_debug "Loading global user environment file: $USER_DIR/user.env"
+			if [ "$userEnv" != "" ]; then
+				export $userEnv
+			fi
+		fi
+	fi
 
+	log_debug "Working directory: $(pwd)"
+	log_info "User directory: $USER_DIR"
 
-    export USER_DIR=${USER_DIR:-$(pwd)}
-    if [ -d "$USER_DIR" ]; then
-      # Resolve full path
-      export USER_DIR=$(cd "$(dirname "$USER_DIR")"; pwd)/$(basename "$USER_DIR")
-    fi
-    if [ -f "$USER_DIR/user.env" ]; then
-        userEnv=$(grep -v '^[[:blank:]]*$' $USER_DIR/user.env | grep -v '^#' | xargs)
-        if [ "$userEnv" != "" ]; then
-          log_debug "Loading global user environment file: $USER_DIR/user.env"
-          if [ "$userEnv" != "" ]; then
-            export $userEnv
-          fi
-        fi
-    fi
+	export AIRGAP_DEPLOYMENT=${AIRGAP_DEPLOYMENT:-false}
 
-    log_debug "Working directory: $(pwd)"
-    log_info "User directory: $USER_DIR"
+	CHECK_HELM=${CHECK_HELM:-true}
+	if [ "$CHECK_HELM" == "true" ]; then
+		source bin/helm-include.sh
+		log_verbose "Helm client version: $HELM_VER_FULL"
+	fi
 
-    export AIRGAP_DEPLOYMENT=${AIRGAP_DEPLOYMENT:-false}
-    
-    CHECK_HELM=${CHECK_HELM:-true}
-    if [ "$CHECK_HELM" == "true" ]; then
-       source bin/helm-include.sh
-       log_verbose "Helm client version: $HELM_VER_FULL"
-    fi
+	CHECK_KUBERNETES=${CHECK_KUBERNETES:-true}
+	if [ "$CHECK_KUBERNETES" == "true" ]; then
+		source bin/kube-include.sh
 
-    CHECK_KUBERNETES=${CHECK_KUBERNETES:-true}
-    if [ "$CHECK_KUBERNETES" == "true" ]; then
-       source bin/kube-include.sh
+		log_verbose Kubernetes client version: "$KUBE_CLIENT_VER"
+		log_verbose Kubernetes server version: "$KUBE_SERVER_VER"
 
-       log_verbose Kubernetes client version: "$KUBE_CLIENT_VER"
-       log_verbose Kubernetes server version: "$KUBE_SERVER_VER"
+		# Check that the current KUBECONFIG has admin access
+		CHECK_ADMIN=${CHECK_ADMIN:-true}
+		if [ "$CHECK_ADMIN" == "true" ]; then
+			if [ "$(kubectl auth can-i create namespace --all-namespaces)" == "no" ]; then
+				ctx=$(kubectl config current-context)
+				log_error "The current kubectl context [$ctx] does not have cluster admin access"
+				exit 1
+			else
+				log_debug "Cluster admin check OK"
+			fi
+		else
+			log_debug "Cluster admin check disabled"
+		fi
+	fi
 
-       # Check that the current KUBECONFIG has admin access
-       CHECK_ADMIN=${CHECK_ADMIN:-true}
-       if [ "$CHECK_ADMIN" == "true" ]; then
-          if [ "$(kubectl auth can-i create namespace --all-namespaces)" == "no" ]; then
-             ctx=$(kubectl config current-context)
-             log_error "The current kubectl context [$ctx] does not have cluster admin access"
-             exit 1
-          else
-             log_debug "Cluster admin check OK"
-          fi
-       else
-          log_debug "Cluster admin check disabled"
-       fi
-    fi
+	# set TLS Cert Generator (cert-manager|openssl)
+	export CERT_GENERATOR="${CERT_GENERATOR:-openssl}"
 
-    # set TLS Cert Generator (cert-manager|openssl)
-    export CERT_GENERATOR="${CERT_GENERATOR:-openssl}"
+	# Set default timeout for kubectl namespace delete command
+	export KUBE_NAMESPACE_DELETE_TIMEOUT=${KUBE_NAMESPACE_DELETE_TIMEOUT:-5m}
 
+	export TMP_DIR=$(mktemp -d -t sas.mon.XXXXXXXX)
+	if [ ! -d "$TMP_DIR" ]; then
+		log_error "Could not create temporary directory [$TMP_DIR]"
+		exit 1
+	fi
+	log_debug "Temporary directory: [$TMP_DIR]"
+	echo "# This file intentionally empty" >$TMP_DIR/empty.yaml
 
-    # Set default timeout for kubectl namespace delete command
-    export KUBE_NAMESPACE_DELETE_TIMEOUT=${KUBE_NAMESPACE_DELETE_TIMEOUT:-5m}
+	# Delete the temp directory on exit
+	function cleanup {
+		KEEP_TMP_DIR=${KEEP_TMP_DIR:-false}
+		if [ "$KEEP_TMP_DIR" != "true" ]; then
+			rm -rf "$TMP_DIR"
+			log_debug "Deleted temporary directory: [$TMP_DIR]"
+		else
+			log_info "TMP_DIR [$TMP_DIR] was not removed"
+		fi
+	}
+	trap_add cleanup EXIT
 
-    export TMP_DIR=$(mktemp -d -t sas.mon.XXXXXXXX)
-    if [ ! -d "$TMP_DIR" ]; then
-      log_error "Could not create temporary directory [$TMP_DIR]"
-      exit 1
-    fi
-    log_debug "Temporary directory: [$TMP_DIR]"
-    echo "# This file intentionally empty" > $TMP_DIR/empty.yaml
+	trap_add errexit_msg ERR
 
-    # Delete the temp directory on exit
-    function cleanup {
-      KEEP_TMP_DIR=${KEEP_TMP_DIR:-false}
-      if [ "$KEEP_TMP_DIR" != "true" ]; then
-        rm -rf "$TMP_DIR"
-        log_debug "Deleted temporary directory: [$TMP_DIR]"
-      else
-        log_info "TMP_DIR [$TMP_DIR] was not removed"
-      fi
-    }
-    trap_add cleanup EXIT
-
-    trap_add errexit_msg ERR
-
-    export SAS_COMMON_SOURCED=true
+	export SAS_COMMON_SOURCED=true
 fi
 
 function checkDefaultStorageClass {
-    if [ -z "$defaultStorageClass" ]; then
-      # Check for kubernetes environment conflicts/requirements
-      defaultStorageClass=$(kubectl get storageclass -o jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.metadata.annotations..storageclass\.kubernetes\.io/is-default-class}{'\n'}{end}" | grep true | awk '{print $1}')
-      if [ "$defaultStorageClass" ]; then
-        log_debug "Found default storageClass: [$defaultStorageClass]"
-      else
-        # Try again with beta storageclass annotation key
-        defaultStorageClass=$(kubectl get storageclass -o jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.metadata.annotations..storageclass\.beta\.kubernetes\.io/is-default-class}{'\n'}{end}" | grep true | awk '{print $1}')
-        if [ "$defaultStorageClass" ]; then
-          log_debug "Found default storageClass: [$defaultStorageClass]"
-        else
-          log_warn "This cluster does not have a default storageclass defined"
-          log_warn "This may cause errors unless storageclass values are explicitly defined"
-          defaultStorageClass=_NONE_
-        fi
-      fi
-    fi
+	if [ -z "$defaultStorageClass" ]; then
+		# Check for kubernetes environment conflicts/requirements
+		defaultStorageClass=$(kubectl get storageclass -o jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.metadata.annotations..storageclass\.kubernetes\.io/is-default-class}{'\n'}{end}" | grep true | awk '{print $1}')
+		if [ "$defaultStorageClass" ]; then
+			log_debug "Found default storageClass: [$defaultStorageClass]"
+		else
+			# Try again with beta storageclass annotation key
+			defaultStorageClass=$(kubectl get storageclass -o jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.metadata.annotations..storageclass\.beta\.kubernetes\.io/is-default-class}{'\n'}{end}" | grep true | awk '{print $1}')
+			if [ "$defaultStorageClass" ]; then
+				log_debug "Found default storageClass: [$defaultStorageClass]"
+			else
+				log_warn "This cluster does not have a default storageclass defined"
+				log_warn "This may cause errors unless storageclass values are explicitly defined"
+				defaultStorageClass=_NONE_
+			fi
+		fi
+	fi
 }
 
 function validateTenantID {
-  tenantID=$1
-  reservedNames=(default provider shared sharedservices spre uaa viya)
+	tenantID=$1
+	reservedNames=(default provider shared sharedservices spre uaa viya)
 
-  CHECK_TENANT_NAME=${CHECK_TENANT_NAME:-true}
-  if [ "$CHECK_TENANT_NAME" == "true" ]; then
-    if [[ $tenantID =~ ^[a-z]([a-z0-9]){0,15}$ ]]; then
-      if [[ $tenantID =~ ^sas ]]; then
-        log_error "Tenant names cannot start with 'sas'"
-        exit 1
-      fi
-      for n in ${reservedNames[@]}; do
-        if [ "$tenantID" == "$n" ]; then
-          log_error "The tenant name [$tenantID] is a reserved name"
-          exit 1
-        fi
-      done
-    else
-      log_error "[$tenantID] is not a valid tenant name"
-      exit 1
-    fi
-  else
-    log_debug "Tenant name validation is disabled"
-  fi
+	CHECK_TENANT_NAME=${CHECK_TENANT_NAME:-true}
+	if [ "$CHECK_TENANT_NAME" == "true" ]; then
+		if [[ $tenantID =~ ^[a-z]([a-z0-9]){0,15}$ ]]; then
+			if [[ $tenantID =~ ^sas ]]; then
+				log_error "Tenant names cannot start with 'sas'"
+				exit 1
+			fi
+			for n in ${reservedNames[@]}; do
+				if [ "$tenantID" == "$n" ]; then
+					log_error "The tenant name [$tenantID] is a reserved name"
+					exit 1
+				fi
+			done
+		else
+			log_error "[$tenantID] is not a valid tenant name"
+			exit 1
+		fi
+	else
+		log_debug "Tenant name validation is disabled"
+	fi
 }
 
-
 function validateNamespace {
-  local namespace
-  namespace="$1"
-  if [[ "$namespace" =~ ^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$ ]]; then
-    log_debug "Namespace [$namespace] passes validation"
-  else
-    log_error "[$namespace] is not a valid namespace name"
-    exit 1
-  fi
+	local namespace
+	namespace="$1"
+	if [[ $namespace =~ ^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$ ]]; then
+		log_debug "Namespace [$namespace] passes validation"
+	else
+		log_error "[$namespace] is not a valid namespace name"
+		exit 1
+	fi
 }
 
-
 function randomPassword {
-  date +%s | sha256sum | base64 | head -c 32 ; echo
+	date +%s | sha256sum | base64 | head -c 32
+	echo
 }
 
 function disable_sa_token_automount {
-  local ns sa_name should_disable
-  ns=$1
-  sa_name=$2
-  should_disable=${SEC_DISABLE_SA_TOKEN_AUTOMOUNT:-true}
-  
-  if [ "$should_disable" == "true" ]; then
-    if [ -n "$(kubectl -n "$ns" get serviceAccount "$sa_name" -o name 2>/dev/null)" ]; then
-      log_debug "Disabling automount of API tokens for serviceAccount [$ns/$sa_name]"
-      kubectl -n $ns patch serviceAccount $sa_name -p '{"automountServiceAccountToken":false}'
-    else
-      log_debug "ServiceAccount [$ns/$sa_name] not found. Skipping patch"
-    fi
-  else
-    log_debug "NOT disabling token automount serviceAccount [$ns/$sa_name]; SEC_DISABLE_SA_TOKEN_AUTOMOUNT set to [$SEC_DISABLE_SA_TOKEN_AUTOMOUNT]"
-  fi
+	local ns sa_name should_disable
+	ns=$1
+	sa_name=$2
+	should_disable=${SEC_DISABLE_SA_TOKEN_AUTOMOUNT:-true}
+
+	if [ "$should_disable" == "true" ]; then
+		if [ -n "$(kubectl -n "$ns" get serviceAccount "$sa_name" -o name 2>/dev/null)" ]; then
+			log_debug "Disabling automount of API tokens for serviceAccount [$ns/$sa_name]"
+			kubectl -n $ns patch serviceAccount $sa_name -p '{"automountServiceAccountToken":false}'
+		else
+			log_debug "ServiceAccount [$ns/$sa_name] not found. Skipping patch"
+		fi
+	else
+		log_debug "NOT disabling token automount serviceAccount [$ns/$sa_name]; SEC_DISABLE_SA_TOKEN_AUTOMOUNT set to [$SEC_DISABLE_SA_TOKEN_AUTOMOUNT]"
+	fi
 }
 
 function enable_pod_token_automount {
-  local ns resource_type resource_name should_disable
-  ns=$1
-  resource_type=$2
-  resource_name=$3
-  should_disable=${SEC_DISABLE_SA_TOKEN_AUTOMOUNT:-true}
+	local ns resource_type resource_name should_disable
+	ns=$1
+	resource_type=$2
+	resource_name=$3
+	should_disable=${SEC_DISABLE_SA_TOKEN_AUTOMOUNT:-true}
 
-  if [ "$should_disable" == "true" ]; then
-     log_debug "Enabling automount of API tokens for pods deployed via [$resource_type/$resource_name]"
+	if [ "$should_disable" == "true" ]; then
+		log_debug "Enabling automount of API tokens for pods deployed via [$resource_type/$resource_name]"
 
-     if [ "$resource_type" == "daemonset" ] || [ "$resource_type" == "deployment" ]; then
-        kubectl -n $ns patch $resource_type  $resource_name -p '{"spec": {"template": {"spec": {"automountServiceAccountToken":true}}}}'
-     else
-        log_error "Invalid request to function [${FUNCNAME[0]}]; unsupported resource_type [$resource_type]"
-        return 1
-     fi
-  else
-     log_debug "NOT enabling token automount on pods for [$ns/$resource_type/$resource_name]; SEC_DISABLE_SA_TOKEN_AUTOMOUNT set to [$SEC_DISABLE_SA_TOKEN_AUTOMOUNT]"
-  fi
+		if [ "$resource_type" == "daemonset" ] || [ "$resource_type" == "deployment" ]; then
+			kubectl -n $ns patch $resource_type $resource_name -p '{"spec": {"template": {"spec": {"automountServiceAccountToken":true}}}}'
+		else
+			log_error "Invalid request to function [${FUNCNAME[0]}]; unsupported resource_type [$resource_type]"
+			return 1
+		fi
+	else
+		log_debug "NOT enabling token automount on pods for [$ns/$resource_type/$resource_name]; SEC_DISABLE_SA_TOKEN_AUTOMOUNT set to [$SEC_DISABLE_SA_TOKEN_AUTOMOUNT]"
+	fi
 }
 
 export -f checkDefaultStorageClass
@@ -255,72 +255,70 @@
 export -f enable_pod_token_automount
 
 function parseFullImage {
-   fullImage="$1"
-   unset REGISTRY REPOS IMAGE VERSION
+	fullImage="$1"
+	unset REGISTRY REPOS IMAGE VERSION
 
-   if [[ "$1" =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
+	if [[ $1 =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
 
-      REGISTRY="${BASH_REMATCH[1]}"
-      REPOS="${BASH_REMATCH[2]}"
-      IMAGE="${BASH_REMATCH[3]}"
-      VERSION="${BASH_REMATCH[4]}"
-      return 0
-   else
-      log_warn "Invalid value for full container image; does not fit expected pattern [$1]."
-      return 1
-   fi
+		REGISTRY="${BASH_REMATCH[1]}"
+		REPOS="${BASH_REMATCH[2]}"
+		IMAGE="${BASH_REMATCH[3]}"
+		VERSION="${BASH_REMATCH[4]}"
+		return 0
+	else
+		log_warn "Invalid value for full container image; does not fit expected pattern [$1]."
+		return 1
+	fi
 }
 
-
 function v4m_replace {
 
-    if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-      sed -i '' s/"$1"/"$2"/g  "$3"
-    else
-      sed -i  s/"$1"/"$2"/g  "$3"
-    fi
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' s/"$1"/"$2"/g "$3"
+	else
+		sed -i s/"$1"/"$2"/g "$3"
+	fi
 }
 
 function doitall {
 
-   #arg1 Full container image
-   #arg2 name of template file
-   #arg3 prefix to insert in placeholders (optional)
+	#arg1 Full container image
+	#arg2 name of template file
+	#arg3 prefix to insert in placeholders (optional)
 
-   if ! parseFullImage "$1";  then
-      log_error "Unable to parse full image [$1]"
-      return 1
-   fi
+	if ! parseFullImage "$1"; then
+		log_error "Unable to parse full image [$1]"
+		return 1
+	fi
 
-   prefix=${3:-""}
+	prefix=${3:-""}
 
-   imageKeysFile="$TMP_DIR/imageKeysFile.yaml"
-   template_file=$2
+	imageKeysFile="$TMP_DIR/imageKeysFile.yaml"
+	template_file=$2
 
-   if [ "$template_file" != "TEMPFILE" ]; then
-      rm -f  $imageKeysFile
-      cp $template_file  $imageKeysFile
-   else
-      log_debug "Modifying an existing imageKeysFile"
-   fi
+	if [ "$template_file" != "TEMPFILE" ]; then
+		rm -f $imageKeysFile
+		cp $template_file $imageKeysFile
+	else
+		log_debug "Modifying an existing imageKeysFile"
+	fi
 
-   if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-      REGISTRY="$AIRGAP_REGISTRY"
-   fi
+	if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
+		REGISTRY="$AIRGAP_REGISTRY"
+	fi
 
-   v4m_replace "__${prefix}IMAGE_REGISTRY__"     "$REGISTRY"                 "$imageKeysFile"
-   v4m_replace "__${prefix}GLOBAL_REGISTRY__"    "$REGISTRY"                 "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE_REPO__"         "$REGISTRY\/$REPOS\/$IMAGE" "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE__"              "$IMAGE"                    "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE_TAG__"          "$VERSION"                  "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE_PULL_POLICY__"  "Always"                    "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE_PULL_SECRET__"  "null"                      "$imageKeysFile"       #Handle Single Image Pull Secret
-   v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]"                        "$imageKeysFile"       #Handle Multiple Image Pull Secrets
+	v4m_replace "__${prefix}IMAGE_REGISTRY__" "$REGISTRY" "$imageKeysFile"
+	v4m_replace "__${prefix}GLOBAL_REGISTRY__" "$REGISTRY" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE__" "$IMAGE" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE_TAG__" "$VERSION" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE_PULL_POLICY__" "Always" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE_PULL_SECRET__" "null" "$imageKeysFile" #Handle Single Image Pull Secret
+	v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]" "$imageKeysFile"  #Handle Multiple Image Pull Secrets
 
-   return 0
+	return 0
 }
 
-
 export -f parseFullImage
 export -f v4m_replace
 export -f doitall
--- bin/test-fb-image.sh.orig
+++ bin/test-fb-image.sh
@@ -1,38 +1,37 @@
 #! /bin/bash
 
 function parseFullImage {
-   fullImage="$1"
-   unset REGISTRY REPOS IMAGE VERSION
+	fullImage="$1"
+	unset REGISTRY REPOS IMAGE VERSION
 
-   if [[ "$1" =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
-      echo "ALL:      ${BASH_REMATCH[0]}"
-      REGISTRY="${BASH_REMATCH[1]}"
-      REPOS="${BASH_REMATCH[2]}"
-      IMAGE="${BASH_REMATCH[3]}"
-      VERSION="${BASH_REMATCH[4]}"
-   else
-      echo "no match"
-   fi
+	if [[ $1 =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
+		echo "ALL:      ${BASH_REMATCH[0]}"
+		REGISTRY="${BASH_REMATCH[1]}"
+		REPOS="${BASH_REMATCH[2]}"
+		IMAGE="${BASH_REMATCH[3]}"
+		VERSION="${BASH_REMATCH[4]}"
+	else
+		echo "no match"
+	fi
 }
 
-
 function v4m_replace {
 
-    if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-      sed -i '' s/"$1"/"$2"/g  "$3"
-    else
-      sed -i  s/"$1"/"$2"/g  "$3"
-    fi
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' s/"$1"/"$2"/g "$3"
+	else
+		sed -i s/"$1"/"$2"/g "$3"
+	fi
 }
 
 FB_FULL_IMAGE="cr.fluentbit.io/fluent/fluent-bit:2.1.10"
 parseFullImage "$FB_FULL_IMAGE"
 
-rm -f  /tmp/container_image.yaml
+rm -f /tmp/container_image.yaml
 cp logging/fb/container_image.template /tmp/container_image.yaml
 
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-   REGISTRY="$AIRGAP_REGISTRY"
+	REGISTRY="$AIRGAP_REGISTRY"
 fi
 
 v4m_replace "__IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml"
@@ -46,15 +45,15 @@
 OS_FULL_IMAGE="docker.io/opensearchproject/opensearch:2.10.0"
 parseFullImage "$OS_FULL_IMAGE"
 
-rm -f  /tmp/container_image.yaml
+rm -f /tmp/container_image.yaml
 cp logging/opensearch/os_container_image.template /tmp/container_image.yaml
 
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-   REGISTRY="$AIRGAP_REGISTRY"
+	REGISTRY="$AIRGAP_REGISTRY"
 fi
 
 v4m_replace "__GLOBAL_REGISTRY__" "$REGISTRY" "/tmp/container_image.yaml"
-v4m_replace "__IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml"    #No Registry since we set Global?
+v4m_replace "__IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml" #No Registry since we set Global?
 v4m_replace "__IMAGE_TAG__" "$VERSION" "/tmp/container_image.yaml"
 v4m_replace "__IMAGE_PULL_POLICY__" "Always" "/tmp/container_image.yaml"
 v4m_replace "__IMAGE_PULL_SECRETS__" "[]" "/tmp/container_image.yaml"
@@ -62,20 +61,20 @@
 OS_SYSCTL_FULL_IMAGE="docker.io/library/busybox:latest"
 parseFullImage "$OS_SYSCTL_FULL_IMAGE"
 
-v4m_replace "__OS_SYSCTL_IMAGE__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml" 
+v4m_replace "__OS_SYSCTL_IMAGE__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml"
 v4m_replace "__OS_SYSCTL_TAG__" "$VERSION" "/tmp/container_image.yaml"
 
 cat /tmp/container_image.yaml
 
-#3rd times the charm 
+#3rd times the charm
 OSD_FULL_IMAGE="docker.io/opensearchproject/opensearch-dashboards:2.10.0"
 parseFullImage "$OSD_FULL_IMAGE"
 
-rm -f  /tmp/container_image.yaml
+rm -f /tmp/container_image.yaml
 cp logging/opensearch/osd_container_image.template /tmp/container_image.yaml
 
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-   REGISTRY="$AIRGAP_REGISTRY"
+	REGISTRY="$AIRGAP_REGISTRY"
 fi
 
 #v4m_replace "__GLOBAL_REGISTRY__" "$REGISTRY" "/tmp/container_image.yaml"  #NOT NEEDED
@@ -90,72 +89,72 @@
 ES_EXPORTER_FULL_IMAGE="quay.io/prometheuscommunity/elasticsearch-exporter:v1.6.0"
 parseFullImage "$ES_EXPORTER_FULL_IMAGE"
 
-rm -f  /tmp/container_image.yaml
+rm -f /tmp/container_image.yaml
 cp logging/esexporter/es-exporter_container_image.template /tmp/container_image.yaml
 
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-   REGISTRY="$AIRGAP_REGISTRY"
+	REGISTRY="$AIRGAP_REGISTRY"
 fi
 
 #v4m_replace "__GLOBAL_REGISTRY__" "$REGISTRY" "/tmp/container_image.yaml"  #NOT NEEDED
 v4m_replace "__IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml"
 v4m_replace "__IMAGE_TAG__" "$VERSION" "/tmp/container_image.yaml"
 v4m_replace "__IMAGE_PULL_POLICY__" "Always" "/tmp/container_image.yaml"
-v4m_replace "__IMAGE_PULL_SECRET__" "null" "/tmp/container_image.yaml"      #Single Image Pull Secret 
+v4m_replace "__IMAGE_PULL_SECRET__" "null" "/tmp/container_image.yaml" #Single Image Pull Secret
 
 cat /tmp/container_image.yaml
 
 #Function, function what's your (er) function?
 function doitall {
 
-   #arg1 Full container image
-   #arg2 name of template file
-   #arg3 prefix to insert in placeholders
-   #prefix="_"
-   parseFullImage "$1"
-   prefix=${3:-""}
+	#arg1 Full container image
+	#arg2 name of template file
+	#arg3 prefix to insert in placeholders
+	#prefix="_"
+	parseFullImage "$1"
+	prefix=${3:-""}
 
-   tempfile="/tmp/container_image.yaml"
-   template_file=$2
+	tempfile="/tmp/container_image.yaml"
+	template_file=$2
 
-   if [ "$template_file" != "TEMPFILE" ]; then
-      rm -f  $tempfile
-      cp $template_file  $tempfile
-   else
-      echo "DEBUG: modifying existing file"
-   fi
+	if [ "$template_file" != "TEMPFILE" ]; then
+		rm -f $tempfile
+		cp $template_file $tempfile
+	else
+		echo "DEBUG: modifying existing file"
+	fi
 
-   if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-      REGISTRY="$AIRGAP_REGISTRY"
-   fi
-   v4m_replace "__${prefix}IMAGE_REGISTRY__"     "$REGISTRY"                 "$tempfile"
-   v4m_replace "__${prefix}GLOBAL_REGISTRY__"    "$REGISTRY"                 "$tempfile"
-   v4m_replace "__${prefix}IMAGE_REPO__"         "$REGISTRY\/$REPOS\/$IMAGE" "$tempfile"
-   v4m_replace "__${prefix}IMAGE__"              "$IMAGE"                    "$tempfile"
-   v4m_replace "__${prefix}IMAGE_TAG__"          "$VERSION"                  "$tempfile"
-   v4m_replace "__${prefix}IMAGE_PULL_POLICY__"  "Always"                    "$tempfile"
-   v4m_replace "__${prefix}IMAGE_PULL_SECRET__"  "null"                      "$tempfile"       #Handle Single Image Pull Secret
-   v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]"                        "$tempfile"       #Handle Multiple Image Pull Secrets
+	if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
+		REGISTRY="$AIRGAP_REGISTRY"
+	fi
+	v4m_replace "__${prefix}IMAGE_REGISTRY__" "$REGISTRY" "$tempfile"
+	v4m_replace "__${prefix}GLOBAL_REGISTRY__" "$REGISTRY" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "$tempfile"
+	v4m_replace "__${prefix}IMAGE__" "$IMAGE" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_TAG__" "$VERSION" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_PULL_POLICY__" "Always" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_PULL_SECRET__" "null" "$tempfile" #Handle Single Image Pull Secret
+	v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]" "$tempfile"  #Handle Multiple Image Pull Secrets
 
-   cat $tempfile
+	cat $tempfile
 
 }
 
 echo "*****************"
 
-doitall "$FB_FULL_IMAGE"          "logging/fb/container_image.template"
+doitall "$FB_FULL_IMAGE" "logging/fb/container_image.template"
 
-doitall "$OS_FULL_IMAGE"          "logging/opensearch/os_container_image.template"
-doitall "$OS_SYSCTL_FULL_IMAGE"   "TEMPFILE"  "OS_SYSCTL_"
+doitall "$OS_FULL_IMAGE" "logging/opensearch/os_container_image.template"
+doitall "$OS_SYSCTL_FULL_IMAGE" "TEMPFILE" "OS_SYSCTL_"
 
-doitall "$OSD_FULL_IMAGE"         "logging/opensearch/osd_container_image.template"
+doitall "$OSD_FULL_IMAGE" "logging/opensearch/osd_container_image.template"
 
 doitall "$ES_EXPORTER_FULL_IMAGE" "logging/esexporter/es-exporter_container_image.template"
 
 GRAFANA_FULL_IMAGE="docker.io/grafana/grafana:10.2.1"
 GRAFANA_SIDECAR_FULL_IMAGE="quay.io/kiwigrid/k8s-sidecar:1.25.2"
-doitall "$GRAFANA_FULL_IMAGE"     "monitoring/grafana_container_image.template"
-doitall "$GRAFANA_SIDECAR_FULL_IMAGE"   "TEMPFILE"  "SIDECAR_"
+doitall "$GRAFANA_FULL_IMAGE" "monitoring/grafana_container_image.template"
+doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE" "SIDECAR_"
 
 ALERTMANAGER_FULL_IMAGE="quay.io/prometheus/alertmanager:v0.26.0"
 GRAFANA_FULL_IMAGE="docker.io/grafana/grafana:10.2.1"
@@ -167,18 +166,16 @@
 PROMOP_FULL_IMAGE="quay.io/prometheus-operator/prometheus-operator:v0.69.1"
 CONFIGRELOAD_FULL_IMAGE="quay.io/prometheus-operator/prometheus-config-reloader:v0.69.1"
 
-doitall "$PROMOP_FULL_IMAGE"          "TEMPFILE"  "monitoring/prom-operator_container_image.template"
-doitall "$ALERTMANAGER_FULL_IMAGE"    "TEMPFILE"  "ALERTMANAGER_"
-doitall "$ADMWEBHOOK_FULL_IMAGE"      "TEMPFILE"  "ADMWEBHOOK_"
-doitall "$KSM_FULL_IMAGE"             "TEMPFILE"  "KSM_"
-doitall "$NODEXPORT_FULL_IMAGE"       "TEMPFILE"  "NODEXPORT_"
-doitall "$PROMETHEUS_FULL_IMAGE"      "TEMPFILE"  "PROMETHEUS_"
-doitall "$CONFIGRELOAD_FULL_IMAGE"    "TEMPFILE"  "CONFIGRELOAD_"
-doitall "$GRAFANA_FULL_IMAGE"         "TEMPFILE"  "GRAFANA_"
-doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE"  "SIDECAR_"
+doitall "$PROMOP_FULL_IMAGE" "TEMPFILE" "monitoring/prom-operator_container_image.template"
+doitall "$ALERTMANAGER_FULL_IMAGE" "TEMPFILE" "ALERTMANAGER_"
+doitall "$ADMWEBHOOK_FULL_IMAGE" "TEMPFILE" "ADMWEBHOOK_"
+doitall "$KSM_FULL_IMAGE" "TEMPFILE" "KSM_"
+doitall "$NODEXPORT_FULL_IMAGE" "TEMPFILE" "NODEXPORT_"
+doitall "$PROMETHEUS_FULL_IMAGE" "TEMPFILE" "PROMETHEUS_"
+doitall "$CONFIGRELOAD_FULL_IMAGE" "TEMPFILE" "CONFIGRELOAD_"
+doitall "$GRAFANA_FULL_IMAGE" "TEMPFILE" "GRAFANA_"
+doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE" "SIDECAR_"
 
-
-
 #### REMOVE FOLLOWING
 exit
 LOG_NS=foo
@@ -186,11 +183,10 @@
 touch /tmp/empty.yaml
 FB_OPENSEARCH_USER_YAML=/tmp/empty.yaml
 set -x
-helm $helmDebug upgrade --install --namespace $LOG_NS fb-testing  \
-  --version $FLUENTBIT_HELM_CHART_VERSION \
-  --values /tmp/container_image.yaml \
-  --values logging/fb/fluent-bit_helm_values_opensearch.yaml  \
-  --values $FB_OPENSEARCH_USER_YAML   \
-  --set fullnameOverride=v4m-fb \
-  fluent/fluent-bit
- 
+helm $helmDebug upgrade --install --namespace $LOG_NS fb-testing \
+	--version $FLUENTBIT_HELM_CHART_VERSION \
+	--values /tmp/container_image.yaml \
+	--values logging/fb/fluent-bit_helm_values_opensearch.yaml \
+	--values $FB_OPENSEARCH_USER_YAML \
+	--set fullnameOverride=v4m-fb \
+	fluent/fluent-bit
--- bin/test-fb-image2.sh.orig
+++ bin/test-fb-image2.sh
@@ -1,113 +1,109 @@
 #! /bin/bash
 
 function parseFullImage {
-   fullImage="$1"
-   unset REGISTRY REPOS IMAGE VERSION
+	fullImage="$1"
+	unset REGISTRY REPOS IMAGE VERSION
 
-   if [[ "$1" =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
-      ###echo "DEBUG:  ${BASH_REMATCH[0]}"
+	if [[ $1 =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
+		###echo "DEBUG:  ${BASH_REMATCH[0]}"
 
-      REGISTRY="${BASH_REMATCH[1]}"
-      REPOS="${BASH_REMATCH[2]}"
-      IMAGE="${BASH_REMATCH[3]}"
-      VERSION="${BASH_REMATCH[4]}"
-      return 0
-   else
-      ###echo "no match"
-      return 1
-   fi
+		REGISTRY="${BASH_REMATCH[1]}"
+		REPOS="${BASH_REMATCH[2]}"
+		IMAGE="${BASH_REMATCH[3]}"
+		VERSION="${BASH_REMATCH[4]}"
+		return 0
+	else
+		###echo "no match"
+		return 1
+	fi
 }
 
-
 function v4m_replace {
 
-    if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-      sed -i '' s/"$1"/"$2"/g  "$3"
-    else
-      sed -i  s/"$1"/"$2"/g  "$3"
-    fi
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' s/"$1"/"$2"/g "$3"
+	else
+		sed -i s/"$1"/"$2"/g "$3"
+	fi
 }
 
-
-
 #Function, function what's your (er) function?
 function doitall {
 
-   #arg1 Full container image
-   #arg2 name of template file
-   #arg3 prefix to insert in placeholders
+	#arg1 Full container image
+	#arg2 name of template file
+	#arg3 prefix to insert in placeholders
 
-   if ! parseFullImage "$1";  then
-      echo "ERROR: unable to parse full image [$1]"
-      return 1
-   fi
+	if ! parseFullImage "$1"; then
+		echo "ERROR: unable to parse full image [$1]"
+		return 1
+	fi
 
-   prefix=${3:-""}
+	prefix=${3:-""}
 
-   tempfile="/tmp/container_image.yaml"
-   template_file=$2
+	tempfile="/tmp/container_image.yaml"
+	template_file=$2
 
-   if [ "$template_file" != "TEMPFILE" ]; then
-      rm -f  $tempfile
-      cp $template_file  $tempfile
-   else
-      echo "DEBUG: modifying existing file"
-   fi
+	if [ "$template_file" != "TEMPFILE" ]; then
+		rm -f $tempfile
+		cp $template_file $tempfile
+	else
+		echo "DEBUG: modifying existing file"
+	fi
 
-   if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-      REGISTRY="$AIRGAP_REGISTRY"
-   fi
+	if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
+		REGISTRY="$AIRGAP_REGISTRY"
+	fi
 
-   v4m_replace "__${prefix}IMAGE_REGISTRY__"     "$REGISTRY"                 "$tempfile"
-   v4m_replace "__${prefix}GLOBAL_REGISTRY__"    "$REGISTRY"                 "$tempfile"
-   v4m_replace "__${prefix}IMAGE_REPO__"         "$REGISTRY\/$REPOS\/$IMAGE" "$tempfile"
-   v4m_replace "__${prefix}IMAGE__"              "$IMAGE"                    "$tempfile"
-   v4m_replace "__${prefix}IMAGE_TAG__"          "$VERSION"                  "$tempfile"
-   v4m_replace "__${prefix}IMAGE_PULL_POLICY__"  "Always"                    "$tempfile"
-   v4m_replace "__${prefix}IMAGE_PULL_SECRET__"  "null"                      "$tempfile"       #Handle Single Image Pull Secret
-   v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]"                        "$tempfile"       #Handle Multiple Image Pull Secrets
+	v4m_replace "__${prefix}IMAGE_REGISTRY__" "$REGISTRY" "$tempfile"
+	v4m_replace "__${prefix}GLOBAL_REGISTRY__" "$REGISTRY" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "$tempfile"
+	v4m_replace "__${prefix}IMAGE__" "$IMAGE" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_TAG__" "$VERSION" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_PULL_POLICY__" "Always" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_PULL_SECRET__" "null" "$tempfile" #Handle Single Image Pull Secret
+	v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]" "$tempfile"  #Handle Multiple Image Pull Secrets
 
-   return 0
+	return 0
 }
 
+if [ -f "component_versions.env" ]; then
+	userEnv=$(grep -v '^[[:blank:]]*$' component_versions.env | grep -v '^#' | xargs)
+	if [ "$userEnv" != "" ]; then
+		echo "DEBUG: Loading global user environment file: component_versions.env"
+		if [ "$userEnv" != "" ]; then
+			export $userEnv
+		fi
+	fi
+else
+	echo "DEBUG No component_versions.env file found"
+fi
 
-    if [ -f "component_versions.env" ]; then
-        userEnv=$(grep -v '^[[:blank:]]*$' component_versions.env | grep -v '^#' | xargs)
-        if [ "$userEnv" != "" ]; then
-           echo "DEBUG: Loading global user environment file: component_versions.env"
-          if [ "$userEnv" != "" ]; then
-            export $userEnv
-          fi
-        fi
-    else
-        echo "DEBUG No component_versions.env file found"
-    fi
-
-
 echo "*****************"
 TEMPFILE="/tmp/container_image.yaml"
 
 ###FB_FULL_IMAGE="cr.fluentbit.io/fluent/fluent-bit:2.1.10"
-if doitall "$FB_FULL_IMAGE"          "logging/fb/container_image.template"; then
-   cat $TEMPFILE
+if doitall "$FB_FULL_IMAGE" "logging/fb/container_image.template"; then
+	cat $TEMPFILE
 else
-   echo "ERROR"
+	echo "ERROR"
 fi
 
 ###OS_FULL_IMAGE="docker.io/opensearchproject/opensearch:2.10.0"
 ###OS_SYSCTL_FULL_IMAGE="docker.io/library/busybox:latest"
-if doitall "$OS_FULL_IMAGE"          "logging/opensearch/os_container_image.template"; then
-   if doitall "$OS_SYSCTL_FULL_IMAGE"   "TEMPFILE"  "OS_SYSCTL_"; then
-      cat $TEMPFILE
-   else echo "ERROR: Failed on [OS_SYSCT]"
-   fi
+if doitall "$OS_FULL_IMAGE" "logging/opensearch/os_container_image.template"; then
+	if doitall "$OS_SYSCTL_FULL_IMAGE" "TEMPFILE" "OS_SYSCTL_"; then
+		cat $TEMPFILE
+	else
+		echo "ERROR: Failed on [OS_SYSCT]"
+	fi
 else
-   echo "ERROR: Failed on [OS]"
+	echo "ERROR: Failed on [OS]"
 fi
 exit
 
 ###OSD_FULL_IMAGE="docker.io/opensearchproject/opensearch-dashboards:2.10.0"
-doitall "$OSD_FULL_IMAGE"         "logging/opensearch/osd_container_image.template"
+doitall "$OSD_FULL_IMAGE" "logging/opensearch/osd_container_image.template"
 cat $TEMPFILE
 
 ###ES_EXPORTER_FULL_IMAGE="quay.io/prometheuscommunity/elasticsearch-exporter:v1.6.0"
@@ -116,8 +112,8 @@
 
 ###GRAFANA_FULL_IMAGE="docker.io/grafana/grafana:10.2.1"
 ###GRAFANA_SIDECAR_FULL_IMAGE="quay.io/kiwigrid/k8s-sidecar:1.25.2"
-doitall "$GRAFANA_FULL_IMAGE"     "monitoring/grafana_container_image.template"
-doitall "$GRAFANA_SIDECAR_FULL_IMAGE"   "TEMPFILE"  "SIDECAR_"
+doitall "$GRAFANA_FULL_IMAGE" "monitoring/grafana_container_image.template"
+doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE" "SIDECAR_"
 cat $TEMPFILE
 
 ###ALERTMANAGER_FULL_IMAGE="quay.io/prometheus/alertmanager:v0.26.0"
@@ -130,15 +126,15 @@
 ###PROMOP_FULL_IMAGE="quay.io/prometheus-operator/prometheus-operator:v0.69.1"
 ###CONFIGRELOAD_FULL_IMAGE="quay.io/prometheus-operator/prometheus-config-reloader:v0.69.1"
 
-doitall "$PROMOP_FULL_IMAGE"          "monitoring/prom-operator_container_image.template"
-doitall "$ALERTMANAGER_FULL_IMAGE"    "TEMPFILE"  "ALERTMANAGER_"
-doitall "$ADMWEBHOOK_FULL_IMAGE"      "TEMPFILE"  "ADMWEBHOOK_"
-doitall "$KSM_FULL_IMAGE"             "TEMPFILE"  "KSM_"
-doitall "$NODEXPORT_FULL_IMAGE"       "TEMPFILE"  "NODEXPORT_"
-doitall "$PROMETHEUS_FULL_IMAGE"      "TEMPFILE"  "PROMETHEUS_"
-doitall "$CONFIGRELOAD_FULL_IMAGE"    "TEMPFILE"  "CONFIGRELOAD_"
-doitall "$GRAFANA_FULL_IMAGE"         "TEMPFILE"  "GRAFANA_"
-doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE"  "SIDECAR_"
+doitall "$PROMOP_FULL_IMAGE" "monitoring/prom-operator_container_image.template"
+doitall "$ALERTMANAGER_FULL_IMAGE" "TEMPFILE" "ALERTMANAGER_"
+doitall "$ADMWEBHOOK_FULL_IMAGE" "TEMPFILE" "ADMWEBHOOK_"
+doitall "$KSM_FULL_IMAGE" "TEMPFILE" "KSM_"
+doitall "$NODEXPORT_FULL_IMAGE" "TEMPFILE" "NODEXPORT_"
+doitall "$PROMETHEUS_FULL_IMAGE" "TEMPFILE" "PROMETHEUS_"
+doitall "$CONFIGRELOAD_FULL_IMAGE" "TEMPFILE" "CONFIGRELOAD_"
+doitall "$GRAFANA_FULL_IMAGE" "TEMPFILE" "GRAFANA_"
+doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE" "SIDECAR_"
 cat $TEMPFILE
 
 #TEMPO_FULL_IMAGE="docker.io/grafana/tempo:2.2.0"
@@ -148,5 +144,3 @@
 #PUSHGATEWAY_FULL_IMAGE="quay.io/prom/pushgateway:v1.6.2"
 doitall "$PUSHGATEWAY_FULL_IMAGE" "monitoring/pushgateway_container_image.template"
 cat $TEMPFILE
-
- 
--- logging/bin/deploy_esexporter.sh.orig
+++ logging/bin/deploy_esexporter.sh
@@ -7,15 +7,15 @@
 source logging/bin/common.sh
 source logging/bin/secrets-include.sh
 
-this_script=`basename "$0"`
+this_script=$(basename "$0")
 
 log_debug "Script [$this_script] has started [$(date)]"
 
 ELASTICSEARCH_EXPORTER_ENABLED=${ELASTICSEARCH_EXPORTER_ENABLED:-true}
 
 if [ "$ELASTICSEARCH_EXPORTER_ENABLED" != "true" ]; then
-  log_verbose "Environment variable [ELASTICSEARCH_EXPORTER_ENABLED] is not set to 'true'; exiting WITHOUT deploying Elasticsearch Exporter"
-  exit
+	log_verbose "Environment variable [ELASTICSEARCH_EXPORTER_ENABLED] is not set to 'true'; exiting WITHOUT deploying Elasticsearch Exporter"
+	exit
 fi
 
 set -e
@@ -29,31 +29,33 @@
 
 # Confirm namespace exists
 if [ "$(kubectl get ns $LOG_NS -o name 2>/dev/null)" == "" ]; then
-  log_error "Namespace [$LOG_NS] does NOT exist."
-  exit 1
+	log_error "Namespace [$LOG_NS] does NOT exist."
+	exit 1
 fi
 
 # get credentials
 get_credentials_from_secret metricgetter
 rc=$?
-if [ "$rc" != "0" ] ;then log_debug "RC=$rc"; exit $rc;fi
+if [ "$rc" != "0" ]; then
+	log_debug "RC=$rc"
+	exit $rc
+fi
 
-
 if helm3ReleaseExists es-exporter $LOG_NS; then
-   #remove an existing instance if it does NOT target OPENSEARCH (i.e. targets ODFE)
-   if [ -z $(kubectl -n $LOG_NS get pods -l "app=prometheus-elasticsearch-exporter,searchbackend=opensearch" -o name 2>/dev/null) ]; then
-      log_debug "Removing an outdated version of Helm release [es-exporter]"
-      helm -n $LOG_NS delete es-exporter
-   fi
+	#remove an existing instance if it does NOT target OPENSEARCH (i.e. targets ODFE)
+	if [ -z $(kubectl -n $LOG_NS get pods -l "app=prometheus-elasticsearch-exporter,searchbackend=opensearch" -o name 2>/dev/null) ]; then
+		log_debug "Removing an outdated version of Helm release [es-exporter]"
+		helm -n $LOG_NS delete es-exporter
+	fi
 else
-   log_debug "No existing Helm release [es-exporter] found."
+	log_debug "No existing Helm release [es-exporter] found."
 fi
 
 # enable debug on Helm via env var
 export HELM_DEBUG="${HELM_DEBUG:-false}"
 
 if [ "$HELM_DEBUG" == "true" ]; then
-  helmDebug="--debug"
+	helmDebug="--debug"
 fi
 
 helmRepoAdd prometheus-community https://prometheus-community.github.io/helm-charts
@@ -67,10 +69,10 @@
 
 ## Check for air gap deployment
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-  source bin/airgap-include.sh
+	source bin/airgap-include.sh
 
-  # Check for the image pull secret for the air gap environment and replace placeholders
-  checkForAirgapSecretInNamespace "$AIRGAP_IMAGE_PULL_SECRET_NAME" "$LOG_NS"
+	# Check for the image pull secret for the air gap environment and replace placeholders
+	checkForAirgapSecretInNamespace "$AIRGAP_IMAGE_PULL_SECRET_NAME" "$LOG_NS"
 ###   replaceAirgapValuesInFiles "logging/airgap/airgap-values-es-exporter.yaml"
 
 ###   airgapValuesFile=$updatedAirgapValuesFile
@@ -79,18 +81,16 @@
 fi
 
 ########
-echo "DDDDDDD"           #DEBUGGING-REMOVE
+echo "DDDDDDD" #DEBUGGING-REMOVE
 doitall "$ES_EXPORTER_FULL_IMAGE" "logging/esexporter/es-exporter_container_image.template"
-cat "$imageKeysFile"     #DEBUGGING-REMOVE
-echo "DDDDDDD"           #DEBUGGING-REMOVE
+cat "$imageKeysFile" #DEBUGGING-REMOVE
+echo "DDDDDDD"       #DEBUGGING-REMOVE
 
-
-
 # Load any user customizations/overrides
 ES_OPEN_EXPORTER_USER_YAML="${ES_OPEN_EXPORTER_USER_YAML:-$USER_DIR/logging/user-values-es-exporter.yaml}"
 if [ ! -f "$ES_OPEN_EXPORTER_USER_YAML" ]; then
-  log_debug "[$ES_OPEN_EXPORTER_USER_YAML] not found. Using $TMP_DIR/empty.yaml"
-  ES_OPEN_EXPORTER_USER_YAML=$TMP_DIR/empty.yaml
+	log_debug "[$ES_OPEN_EXPORTER_USER_YAML] not found. Using $TMP_DIR/empty.yaml"
+	ES_OPEN_EXPORTER_USER_YAML=$TMP_DIR/empty.yaml
 fi
 
 # Enable workload node placement?
@@ -98,42 +98,40 @@
 
 # Optional workload node placement support
 if [ "$LOG_NODE_PLACEMENT_ENABLE" == "true" ]; then
-  log_verbose "Enabling elasticsearch exporter for workload node placement"
-  wnpValuesFile="logging/node-placement/values-elasticsearch-exporter-wnp.yaml"
+	log_verbose "Enabling elasticsearch exporter for workload node placement"
+	wnpValuesFile="logging/node-placement/values-elasticsearch-exporter-wnp.yaml"
 else
-  log_debug "Workload node placement support is disabled for the elasticsearch exporter"
-  wnpValuesFile="$TMP_DIR/empty.yaml"
+	log_debug "Workload node placement support is disabled for the elasticsearch exporter"
+	wnpValuesFile="$TMP_DIR/empty.yaml"
 fi
 
-
 # Point to OpenShift response file or dummy as appropriate
 if [ "$OPENSHIFT_CLUSTER" == "true" ]; then
-  log_verbose "Deploying Elasticsearch metric exporter onto OpenShift cluster"
-  openshiftValuesFile="logging/openshift/values-elasticsearch-exporter.yaml"
+	log_verbose "Deploying Elasticsearch metric exporter onto OpenShift cluster"
+	openshiftValuesFile="logging/openshift/values-elasticsearch-exporter.yaml"
 else
-  log_debug "Elasticsearch metric exporter is NOT being deployed on OpenShift cluster"
-  openshiftValuesFile="$TMP_DIR/empty.yaml"
+	log_debug "Elasticsearch metric exporter is NOT being deployed on OpenShift cluster"
+	openshiftValuesFile="$TMP_DIR/empty.yaml"
 fi
 
 # Elasticsearch metric exporter
 helm2ReleaseCheck es-exporter-$LOG_NS
 
-
 ## Get Helm Chart Name
 log_debug "Elasticsearch Exporter Helm Chart: repo [$ESEXPORTER_HELM_CHART_REPO] name [$ESEXPORTER_HELM_CHART_NAME] version [$ESEXPORTER_HELM_CHART_VERSION]"
 chart2install="$(get_helmchart_reference $ESEXPORTER_HELM_CHART_REPO $ESEXPORTER_HELM_CHART_NAME $ESEXPORTER_HELM_CHART_VERSION)"
 log_debug "Installing Helm chart from artifact [$chart2install]"
 
 helm $helmDebug upgrade --install es-exporter \
- --namespace $LOG_NS \
- --version $ESEXPORTER_HELM_CHART_VERSION \
- -f $imageKeysFile \
- -f $primaryValuesFile \
- -f $wnpValuesFile \
- -f $openshiftValuesFile \
- -f $ES_OPEN_EXPORTER_USER_YAML \
- --set fullnameOverride=v4m-es-exporter  \
- $chart2install
+	--namespace $LOG_NS \
+	--version $ESEXPORTER_HELM_CHART_VERSION \
+	-f $imageKeysFile \
+	-f $primaryValuesFile \
+	-f $wnpValuesFile \
+	-f $openshiftValuesFile \
+	-f $ES_OPEN_EXPORTER_USER_YAML \
+	--set fullnameOverride=v4m-es-exporter \
+	$chart2install
 
 log_info "Elasticsearch metric exporter has been deployed"
 
----------

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' returned error 1 finding the following syntactical issues:

----------

In bin/common.sh line 1:
# Copyright © 2021, 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/common.sh line 20:
         extract_trap_cmd() { printf '%s\n' "$3"; }
                              ^----------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/common.sh line 29:
      log_error "Exiting script [`basename $0`] due to an error executing the command [$BASH_COMMAND]."
                                 ^-----------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
                                           ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      log_error "Exiting script [$(basename "$0")] due to an error executing the command [$BASH_COMMAND]."


In bin/common.sh line 31:
      log_debug "Trap [ERR] triggered in [`basename $0`] while executing the command [$BASH_COMMAND]."
                                          ^-----------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
                                                    ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      log_debug "Trap [ERR] triggered in [$(basename "$0")] while executing the command [$BASH_COMMAND]."


In bin/common.sh line 40:
    source bin/colors-include.sh
           ^-------------------^ SC1091 (info): Not following: bin/colors-include.sh was not specified as input (see shellcheck -x).


In bin/common.sh line 41:
    source bin/log-include.sh
           ^----------------^ SC1091 (info): Not following: bin/log-include.sh was not specified as input (see shellcheck -x).


In bin/common.sh line 42:
    source bin/openshift-include.sh
           ^----------------------^ SC1091 (info): Not following: bin/openshift-include.sh was not specified as input (see shellcheck -x).


In bin/common.sh line 44:
    if [ ! $(which sha256sum) ]; then
           ^----------------^ SC2046 (warning): Quote this to prevent word splitting.


In bin/common.sh line 57:
            export $userEnv
                   ^------^ SC2163 (warning): This does not export 'userEnv'. Remove $/${} for that, or use ${var?} to quiet.
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
            export "$userEnv"


In bin/common.sh line 69:
      export USER_DIR=$(cd "$(dirname "$USER_DIR")"; pwd)/$(basename "$USER_DIR")
             ^------^ SC2155 (warning): Declare and assign separately to avoid masking return values.
                        ^-------------------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

Did you mean: 
      export USER_DIR=$(cd "$(dirname "$USER_DIR")" || exit; pwd)/$(basename "$USER_DIR")


In bin/common.sh line 72:
        userEnv=$(grep -v '^[[:blank:]]*$' $USER_DIR/user.env | grep -v '^#' | xargs)
                                           ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
        userEnv=$(grep -v '^[[:blank:]]*$' "$USER_DIR"/user.env | grep -v '^#' | xargs)


In bin/common.sh line 76:
            export $userEnv
                   ^------^ SC2163 (warning): This does not export 'userEnv'. Remove $/${} for that, or use ${var?} to quiet.
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
            export "$userEnv"


In bin/common.sh line 88:
       source bin/helm-include.sh
              ^-----------------^ SC1091 (info): Not following: bin/helm-include.sh was not specified as input (see shellcheck -x).


In bin/common.sh line 94:
       source bin/kube-include.sh
              ^-----------------^ SC1091 (info): Not following: bin/kube-include.sh was not specified as input (see shellcheck -x).


In bin/common.sh line 121:
    export TMP_DIR=$(mktemp -d -t sas.mon.XXXXXXXX)
           ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values.


In bin/common.sh line 127:
    echo "# This file intentionally empty" > $TMP_DIR/empty.yaml
                                             ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    echo "# This file intentionally empty" > "$TMP_DIR"/empty.yaml


In bin/common.sh line 177:
      for n in ${reservedNames[@]}; do
               ^-----------------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements.


In bin/common.sh line 218:
      kubectl -n $ns patch serviceAccount $sa_name -p '{"automountServiceAccountToken":false}'
                 ^-^ 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 "$ns" patch serviceAccount "$sa_name" -p '{"automountServiceAccountToken":false}'


In bin/common.sh line 238:
        kubectl -n $ns patch $resource_type  $resource_name -p '{"spec": {"template": {"spec": {"automountServiceAccountToken":true}}}}'
                   ^-^ SC2086 (info): Double quote to prevent globbing and word splitting.
                             ^------------^ 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 "$ns" patch "$resource_type"  "$resource_name" -p '{"spec": {"template": {"spec": {"automountServiceAccountToken":true}}}}'


In bin/common.sh line 258:
   fullImage="$1"
   ^-------^ SC2034 (warning): fullImage appears unused. Verify use (or export if used externally).


In bin/common.sh line 301:
      rm -f  $imageKeysFile
             ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      rm -f  "$imageKeysFile"


In bin/common.sh line 302:
      cp $template_file  $imageKeysFile
         ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                         ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      cp "$template_file"  "$imageKeysFile"


In bin/test-fb-image.sh line 4:
   fullImage="$1"
   ^-------^ SC2034 (warning): fullImage appears unused. Verify use (or export if used externally).


In bin/test-fb-image.sh line 123:
      cp $template_file  $tempfile
         ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      cp "$template_file"  $tempfile


In bin/test-fb-image.sh line 184:
LOG_NS=foo
^--------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image.sh line 185:
FLUENTBIT_HELM_CHART_VERSION=0.40.0
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image.sh line 186:
touch /tmp/empty.yaml
^-------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image.sh line 187:
FB_OPENSEARCH_USER_YAML=/tmp/empty.yaml
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image.sh line 188:
set -x
^----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image.sh line 189:
helm $helmDebug upgrade --install --namespace $LOG_NS fb-testing  \
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
     ^--------^ SC2154 (warning): helmDebug is referenced but not assigned.
     ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
helm "$helmDebug" upgrade --install --namespace "$LOG_NS" fb-testing  \


In bin/test-fb-image.sh line 190:
  --version $FLUENTBIT_HELM_CHART_VERSION \
            ^---------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --version "$FLUENTBIT_HELM_CHART_VERSION" \


In bin/test-fb-image.sh line 193:
  --values $FB_OPENSEARCH_USER_YAML   \
           ^----------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --values "$FB_OPENSEARCH_USER_YAML"   \


In bin/test-fb-image2.sh line 4:
   fullImage="$1"
   ^-------^ SC2034 (warning): fullImage appears unused. Verify use (or export if used externally).


In bin/test-fb-image2.sh line 52:
      cp $template_file  $tempfile
         ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      cp "$template_file"  $tempfile


In bin/test-fb-image2.sh line 79:
            export $userEnv
                   ^------^ SC2163 (warning): This does not export 'userEnv'. Remove $/${} for that, or use ${var?} to quiet.
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
            export "$userEnv"


In bin/test-fb-image2.sh line 110:
doitall "$OSD_FULL_IMAGE"         "logging/opensearch/osd_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 111:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In bin/test-fb-image2.sh line 114:
doitall "$ES_EXPORTER_FULL_IMAGE" "logging/esexporter/es-exporter_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 115:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In bin/test-fb-image2.sh line 119:
doitall "$GRAFANA_FULL_IMAGE"     "monitoring/grafana_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 120:
doitall "$GRAFANA_SIDECAR_FULL_IMAGE"   "TEMPFILE"  "SIDECAR_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 121:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In bin/test-fb-image2.sh line 133:
doitall "$PROMOP_FULL_IMAGE"          "monitoring/prom-operator_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 134:
doitall "$ALERTMANAGER_FULL_IMAGE"    "TEMPFILE"  "ALERTMANAGER_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 135:
doitall "$ADMWEBHOOK_FULL_IMAGE"      "TEMPFILE"  "ADMWEBHOOK_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 136:
doitall "$KSM_FULL_IMAGE"             "TEMPFILE"  "KSM_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 137:
doitall "$NODEXPORT_FULL_IMAGE"       "TEMPFILE"  "NODEXPORT_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 138:
doitall "$PROMETHEUS_FULL_IMAGE"      "TEMPFILE"  "PROMETHEUS_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 139:
doitall "$CONFIGRELOAD_FULL_IMAGE"    "TEMPFILE"  "CONFIGRELOAD_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 140:
doitall "$GRAFANA_FULL_IMAGE"         "TEMPFILE"  "GRAFANA_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 141:
doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE"  "SIDECAR_"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 142:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In bin/test-fb-image2.sh line 145:
doitall "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 146:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In bin/test-fb-image2.sh line 149:
doitall "$PUSHGATEWAY_FULL_IMAGE" "monitoring/pushgateway_container_image.template"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).


In bin/test-fb-image2.sh line 150:
cat $TEMPFILE
^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cat "$TEMPFILE"


In logging/bin/deploy_esexporter.sh line 6:
cd "$(dirname $BASH_SOURCE)/../.."
              ^----------^ SC2128 (warning): Expanding an array without an index only gives the first element.
              ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cd "$(dirname "$BASH_SOURCE")/../.."


In logging/bin/deploy_esexporter.sh line 7:
source logging/bin/common.sh
       ^-------------------^ SC1091 (info): Not following: logging/bin/common.sh was not specified as input (see shellcheck -x).


In logging/bin/deploy_esexporter.sh line 8:
source logging/bin/secrets-include.sh
       ^----------------------------^ SC1091 (info): Not following: logging/bin/secrets-include.sh was not specified as input (see shellcheck -x).


In logging/bin/deploy_esexporter.sh line 10:
this_script=`basename "$0"`
            ^-------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.

Did you mean: 
this_script=$(basename "$0")


In logging/bin/deploy_esexporter.sh line 31:
if [ "$(kubectl get ns $LOG_NS -o name 2>/dev/null)" == "" ]; then
                       ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if [ "$(kubectl get ns "$LOG_NS" -o name 2>/dev/null)" == "" ]; then


In logging/bin/deploy_esexporter.sh line 42:
if helm3ReleaseExists es-exporter $LOG_NS; then
                                  ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if helm3ReleaseExists es-exporter "$LOG_NS"; then


In logging/bin/deploy_esexporter.sh line 44:
   if [ -z $(kubectl -n $LOG_NS get pods -l "app=prometheus-elasticsearch-exporter,searchbackend=opensearch" -o name 2>/dev/null) ]; then
           ^-- SC2046 (warning): Quote this to prevent word splitting.
                        ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   if [ -z $(kubectl -n "$LOG_NS" get pods -l "app=prometheus-elasticsearch-exporter,searchbackend=opensearch" -o name 2>/dev/null) ]; then


In logging/bin/deploy_esexporter.sh line 46:
      helm -n $LOG_NS delete es-exporter
              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      helm -n "$LOG_NS" delete es-exporter


In logging/bin/deploy_esexporter.sh line 70:
  source bin/airgap-include.sh
         ^-------------------^ SC1091 (info): Not following: bin/airgap-include.sh was not specified as input (see shellcheck -x).


In logging/bin/deploy_esexporter.sh line 84:
cat "$imageKeysFile"     #DEBUGGING-REMOVE
     ^------------^ SC2154 (warning): imageKeysFile is referenced but not assigned.


In logging/bin/deploy_esexporter.sh line 119:
helm2ReleaseCheck es-exporter-$LOG_NS
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
helm2ReleaseCheck es-exporter-"$LOG_NS"


In logging/bin/deploy_esexporter.sh line 124:
chart2install="$(get_helmchart_reference $ESEXPORTER_HELM_CHART_REPO $ESEXPORTER_HELM_CHART_NAME $ESEXPORTER_HELM_CHART_VERSION)"
                                         ^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                     ^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                                 ^----------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
chart2install="$(get_helmchart_reference "$ESEXPORTER_HELM_CHART_REPO" "$ESEXPORTER_HELM_CHART_NAME" "$ESEXPORTER_HELM_CHART_VERSION")"


In logging/bin/deploy_esexporter.sh line 127:
helm $helmDebug upgrade --install es-exporter \
     ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
helm "$helmDebug" upgrade --install es-exporter \


In logging/bin/deploy_esexporter.sh line 128:
 --namespace $LOG_NS \
             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 --namespace "$LOG_NS" \


In logging/bin/deploy_esexporter.sh line 129:
 --version $ESEXPORTER_HELM_CHART_VERSION \
           ^----------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 --version "$ESEXPORTER_HELM_CHART_VERSION" \


In logging/bin/deploy_esexporter.sh line 130:
 -f $imageKeysFile \
    ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 -f "$imageKeysFile" \


In logging/bin/deploy_esexporter.sh line 132:
 -f $wnpValuesFile \
    ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 -f "$wnpValuesFile" \


In logging/bin/deploy_esexporter.sh line 133:
 -f $openshiftValuesFile \
    ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 -f "$openshiftValuesFile" \


In logging/bin/deploy_esexporter.sh line 134:
 -f $ES_OPEN_EXPORTER_USER_YAML \
    ^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 -f "$ES_OPEN_EXPORTER_USER_YAML" \


In logging/bin/deploy_esexporter.sh line 136:
 $chart2install
 ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
 "$chart2install"


In monitoring/bin/deploy_monitoring_cluster.sh line 6:
cd "$(dirname $BASH_SOURCE)/../.."
              ^----------^ SC2128 (warning): Expanding an array without an index only gives the first element.
              ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cd "$(dirname "$BASH_SOURCE")/../.."


In monitoring/bin/deploy_monitoring_cluster.sh line 7:
source monitoring/bin/common.sh
       ^----------------------^ SC1091 (info): Not following: monitoring/bin/common.sh was not specified as input (see shellcheck -x).


In monitoring/bin/deploy_monitoring_cluster.sh line 8:
source bin/service-url-include.sh
       ^------------------------^ SC1091 (info): Not following: bin/service-url-include.sh was not specified as input (see shellcheck -x).


In monitoring/bin/deploy_monitoring_cluster.sh line 18:
source bin/tls-include.sh
       ^----------------^ SC1091 (info): Not following: bin/tls-include.sh was not specified as input (see shellcheck -x).


In monitoring/bin/deploy_monitoring_cluster.sh line 19:
if verify_cert_generator $MON_NS prometheus alertmanager grafana; then
                         ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if verify_cert_generator "$MON_NS" prometheus alertmanager grafana; then


In monitoring/bin/deploy_monitoring_cluster.sh line 20:
  log_debug "cert generator check OK [$cert_generator_ok]"
                                      ^----------------^ SC2154 (warning): cert_generator_ok is referenced but not assigned.


In monitoring/bin/deploy_monitoring_cluster.sh line 22:
  log_error "One or more required TLS certs do not exist and the expected certificate generator mechanism [$cert_generator] is not available to create the missing certs"
                                                                                                           ^-------------^ SC2154 (warning): cert_generator is referenced but not assigned.


In monitoring/bin/deploy_monitoring_cluster.sh line 26:
helm2ReleaseCheck v4m-$MON_NS
                      ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
helm2ReleaseCheck v4m-"$MON_NS"


In monitoring/bin/deploy_monitoring_cluster.sh line 27:
helm2ReleaseCheck prometheus-$MON_NS
                             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
helm2ReleaseCheck prometheus-"$MON_NS"


In monitoring/bin/deploy_monitoring_cluster.sh line 43:
if [ -z "$(kubectl get ns $MON_NS -o name 2>/dev/null)" ]; then
                          ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if [ -z "$(kubectl get ns "$MON_NS" -o name 2>/dev/null)" ]; then


In monitoring/bin/deploy_monitoring_cluster.sh line 44:
  kubectl create ns $MON_NS
                    ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create ns "$MON_NS"


In monitoring/bin/deploy_monitoring_cluster.sh line 47:
  disable_sa_token_automount $MON_NS default
                             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  disable_sa_token_automount "$MON_NS" default


In monitoring/bin/deploy_monitoring_cluster.sh line 51:
  source bin/airgap-include.sh
         ^-------------------^ SC1091 (info): Not following: bin/airgap-include.sh was not specified as input (see shellcheck -x).


In monitoring/bin/deploy_monitoring_cluster.sh line 81:
cat "$imageKeysFile"  #DEBUGGING-REMOVE
     ^------------^ SC2154 (warning): imageKeysFile is referenced but not assigned.


In monitoring/bin/deploy_monitoring_cluster.sh line 123:
    if kubectl get crd $crd.monitoring.coreos.com 1>/dev/null 2>&1; then
                       ^--^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    if kubectl get crd "$crd".monitoring.coreos.com 1>/dev/null 2>&1; then


In monitoring/bin/deploy_monitoring_cluster.sh line 124:
      kubectl replace -f $crdURL
                         ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      kubectl replace -f "$crdURL"


In monitoring/bin/deploy_monitoring_cluster.sh line 126:
      kubectl create -f $crdURL
                        ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      kubectl create -f "$crdURL"


In monitoring/bin/deploy_monitoring_cluster.sh line 134:
kubectl delete daemonset -n $MON_NS -l app=prometheus-node-exporter --ignore-not-found
                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
kubectl delete daemonset -n "$MON_NS" -l app=prometheus-node-exporter --ignore-not-found


In monitoring/bin/deploy_monitoring_cluster.sh line 151:
  create_tls_certs $MON_NS monitoring ${apps[@]}
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                      ^--------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements.

Did you mean: 
  create_tls_certs "$MON_NS" monitoring ${apps[@]}


In monitoring/bin/deploy_monitoring_cluster.sh line 163:
  kubectl delete cm -n $MON_NS --ignore-not-found grafana-datasource-prom-https
                       ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl delete cm -n "$MON_NS" --ignore-not-found grafana-datasource-prom-https


In monitoring/bin/deploy_monitoring_cluster.sh line 164:
  kubectl create cm -n $MON_NS grafana-datasource-prom-https --from-file monitoring/tls/$grafanaDS
                       ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create cm -n "$MON_NS" grafana-datasource-prom-https --from-file monitoring/tls/$grafanaDS


In monitoring/bin/deploy_monitoring_cluster.sh line 165:
  kubectl label cm -n $MON_NS grafana-datasource-prom-https grafana_datasource=1 sas.com/monitoring-base=kube-viya-monitoring
                      ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl label cm -n "$MON_NS" grafana-datasource-prom-https grafana_datasource=1 sas.com/monitoring-base=kube-viya-monitoring


In monitoring/bin/deploy_monitoring_cluster.sh line 169:
  kubectl delete cm -n $MON_NS node-exporter-tls-web-config --ignore-not-found
                       ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl delete cm -n "$MON_NS" node-exporter-tls-web-config --ignore-not-found


In monitoring/bin/deploy_monitoring_cluster.sh line 171:
  kubectl create cm -n $MON_NS node-exporter-tls-web-config --from-file monitoring/tls/node-exporter-web.yaml
                       ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create cm -n "$MON_NS" node-exporter-tls-web-config --from-file monitoring/tls/node-exporter-web.yaml


In monitoring/bin/deploy_monitoring_cluster.sh line 172:
  kubectl label cm -n $MON_NS node-exporter-tls-web-config sas.com/monitoring-base=kube-viya-monitoring
                      ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl label cm -n "$MON_NS" node-exporter-tls-web-config sas.com/monitoring-base=kube-viya-monitoring


In monitoring/bin/deploy_monitoring_cluster.sh line 182:
if helm3ReleaseExists prometheus-operator $MON_NS; then
                                          ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if helm3ReleaseExists prometheus-operator "$MON_NS"; then


In monitoring/bin/deploy_monitoring_cluster.sh line 191:
if helm3ReleaseExists $promRelease $MON_NS; then
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if helm3ReleaseExists $promRelease "$MON_NS"; then


In monitoring/bin/deploy_monitoring_cluster.sh line 205:
  kubectl delete -n $MON_NS --ignore-not-found \
                    ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl delete -n "$MON_NS" --ignore-not-found \


In monitoring/bin/deploy_monitoring_cluster.sh line 224:
chart2install="$(get_helmchart_reference $KUBE_PROM_STACK_CHART_REPO $KUBE_PROM_STACK_CHART_NAME $KUBE_PROM_STACK_CHART_VERSION)"
                                         ^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                     ^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                                 ^----------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
chart2install="$(get_helmchart_reference "$KUBE_PROM_STACK_CHART_REPO" "$KUBE_PROM_STACK_CHART_NAME" "$KUBE_PROM_STACK_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_cluster.sh line 227:
helm $helmDebug upgrade --install $promRelease \
     ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
helm "$helmDebug" upgrade --install $promRelease \


In monitoring/bin/deploy_monitoring_cluster.sh line 228:
  --namespace $MON_NS \
              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --namespace "$MON_NS" \


In monitoring/bin/deploy_monitoring_cluster.sh line 229:
  -f $imageKeysFile \
     ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  -f "$imageKeysFile" \


In monitoring/bin/deploy_monitoring_cluster.sh line 231:
  -f $istioValuesFile \
     ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  -f "$istioValuesFile" \


In monitoring/bin/deploy_monitoring_cluster.sh line 232:
  -f $tlsValuesFile \
     ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  -f "$tlsValuesFile" \


In monitoring/bin/deploy_monitoring_cluster.sh line 233:
  -f $tlsPromAlertingEndpointFile \
     ^--------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  -f "$tlsPromAlertingEndpointFile" \


In monitoring/bin/deploy_monitoring_cluster.sh line 234:
  -f $nodePortValuesFile \
     ^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  -f "$nodePortValuesFile" \


In monitoring/bin/deploy_monitoring_cluster.sh line 235:
  -f $wnpValuesFile \
     ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  -f "$wnpValuesFile" \


In monitoring/bin/deploy_monitoring_cluster.sh line 236:
  -f $PROM_OPER_USER_YAML \
     ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  -f "$PROM_OPER_USER_YAML" \


In monitoring/bin/deploy_monitoring_cluster.sh line 237:
  -f $tempoDSFile \
     ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  -f "$tempoDSFile" \


In monitoring/bin/deploy_monitoring_cluster.sh line 247:
  --version $KUBE_PROM_STACK_CHART_VERSION \
            ^----------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --version "$KUBE_PROM_STACK_CHART_VERSION" \


In monitoring/bin/deploy_monitoring_cluster.sh line 248:
  $chart2install
  ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$chart2install"


In monitoring/bin/deploy_monitoring_cluster.sh line 254:
  kubectl patch servicemonitor -n $MON_NS $promName-grafana --type=json \
                                  ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl patch servicemonitor -n "$MON_NS" $promName-grafana --type=json \


In monitoring/bin/deploy_monitoring_cluster.sh line 259:
disable_sa_token_automount $MON_NS v4m-grafana
                           ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
disable_sa_token_automount "$MON_NS" v4m-grafana


In monitoring/bin/deploy_monitoring_cluster.sh line 260:
disable_sa_token_automount $MON_NS sas-ops-acct      #Used w/Prometheus
                           ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
disable_sa_token_automount "$MON_NS" sas-ops-acct      #Used w/Prometheus


In monitoring/bin/deploy_monitoring_cluster.sh line 261:
disable_sa_token_automount $MON_NS v4m-node-exporter
                           ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
disable_sa_token_automount "$MON_NS" v4m-node-exporter


In monitoring/bin/deploy_monitoring_cluster.sh line 262:
disable_sa_token_automount $MON_NS v4m-alertmanager
                           ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
disable_sa_token_automount "$MON_NS" v4m-alertmanager


In monitoring/bin/deploy_monitoring_cluster.sh line 265:
disable_sa_token_automount $MON_NS v4m-kube-state-metrics
                           ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
disable_sa_token_automount "$MON_NS" v4m-kube-state-metrics


In monitoring/bin/deploy_monitoring_cluster.sh line 266:
enable_pod_token_automount $MON_NS deployment v4m-kube-state-metrics
                           ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
enable_pod_token_automount "$MON_NS" deployment v4m-kube-state-metrics


In monitoring/bin/deploy_monitoring_cluster.sh line 267:
disable_sa_token_automount $MON_NS v4m-operator
                           ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
disable_sa_token_automount "$MON_NS" v4m-operator


In monitoring/bin/deploy_monitoring_cluster.sh line 268:
enable_pod_token_automount $MON_NS deployment v4m-operator
                           ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
enable_pod_token_automount "$MON_NS" deployment v4m-operator


In monitoring/bin/deploy_monitoring_cluster.sh line 278:
    source bin/airgap-include.sh
           ^-------------------^ SC1091 (info): Not following: bin/airgap-include.sh was not specified as input (see shellcheck -x).


In monitoring/bin/deploy_monitoring_cluster.sh line 301:
  chart2install="$(get_helmchart_reference $TEMPO_CHART_REPO $TEMPO_CHART_NAME $TEMPO_CHART_VERSION)"
                                           ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                             ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                               ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  chart2install="$(get_helmchart_reference "$TEMPO_CHART_REPO" "$TEMPO_CHART_NAME" "$TEMPO_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_cluster.sh line 307:
    -f $imageKeysFile \
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    -f "$imageKeysFile" \


In monitoring/bin/deploy_monitoring_cluster.sh line 311:
    $chart2install
    ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    "$chart2install"


In monitoring/bin/deploy_monitoring_cluster.sh line 316:
kubectl get ns $NGINX_NS 2>/dev/null
               ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
kubectl get ns "$NGINX_NS" 2>/dev/null


In monitoring/bin/deploy_monitoring_cluster.sh line 317:
if [ $? == 0 ]; then
     ^-- SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.


In monitoring/bin/deploy_monitoring_cluster.sh line 324:
  kubectl apply -n $NGINX_NS -f monitoring/monitors/kube/podMonitor-nginx.yaml 2>/dev/null
                   ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$NGINX_NS" -f monitoring/monitors/kube/podMonitor-nginx.yaml 2>/dev/null


In monitoring/bin/deploy_monitoring_cluster.sh line 328:
kubectl apply -n $MON_NS -f monitoring/monitors/kube/podMonitor-eventrouter.yaml 2>/dev/null
                 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
kubectl apply -n "$MON_NS" -f monitoring/monitors/kube/podMonitor-eventrouter.yaml 2>/dev/null


In monitoring/bin/deploy_monitoring_cluster.sh line 331:
kubectl apply -n $MON_NS -f monitoring/monitors/logging/serviceMonitor-elasticsearch.yaml
                 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
kubectl apply -n "$MON_NS" -f monitoring/monitors/logging/serviceMonitor-elasticsearch.yaml


In monitoring/bin/deploy_monitoring_cluster.sh line 334:
kubectl apply -n $MON_NS -f monitoring/monitors/logging/serviceMonitor-fluent-bit.yaml
                 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
kubectl apply -n "$MON_NS" -f monitoring/monitors/logging/serviceMonitor-fluent-bit.yaml


In monitoring/bin/deploy_monitoring_cluster.sh line 335:
kubectl apply -n $MON_NS -f monitoring/monitors/logging/serviceMonitor-fluent-bit-v2.yaml
                 ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
kubectl apply -n "$MON_NS" -f monitoring/monitors/logging/serviceMonitor-fluent-bit-v2.yaml


In monitoring/bin/deploy_monitoring_cluster.sh line 340:
  kubectl apply -n $MON_NS -f $f
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                              ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f "$f"


In monitoring/bin/deploy_monitoring_cluster.sh line 369:
gf_url=$(get_service_url $MON_NS v4m-grafana  "$TLS_ENABLE")
                         ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
gf_url=$(get_service_url "$MON_NS" v4m-grafana  "$TLS_ENABLE")


In monitoring/bin/deploy_monitoring_cluster.sh line 375:
if helm3ReleaseExists v4m $MON_NS; then
                          ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if helm3ReleaseExists v4m "$MON_NS"; then


In monitoring/bin/deploy_monitoring_cluster.sh line 387:
if [ ! -z "$gf_url" ]; then
     ^-- SC2236 (style): Use -n instead of ! -z.

For more information:
  https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ...
  https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...
  https://www.shellcheck.net/wiki/SC2034 -- fullImage appears unused. Verify ...
----------

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' returned error 1 finding the following formatting issues:

----------
--- bin/common.sh.orig
+++ bin/common.sh
@@ -5,244 +5,244 @@
 # Current directory must be the root directory of the repo
 
 function trap_add() {
- # based on https://stackoverflow.com/questions/3338030/multiple-bash-traps-for-the-same-signal
- # but: prepends new cmd rather than append it, changed var names and eliminated messages
+	# based on https://stackoverflow.com/questions/3338030/multiple-bash-traps-for-the-same-signal
+	# but: prepends new cmd rather than append it, changed var names and eliminated messages
 
-   local cmd_to_add signal
+	local cmd_to_add signal
 
-   cmd_to_add=$1; shift
-   for signal in "$@"; do
-      trap -- "$(
-         # print the new trap command
-         printf '%s\n' "${cmd_to_add}"
-         # helper fn to get existing trap command from output
-         # of trap -p
-         extract_trap_cmd() { printf '%s\n' "$3"; }
-         # print existing trap command with newline
-         eval "extract_trap_cmd $(trap -p "${signal}")"
-      )" "${signal}"
-   done
+	cmd_to_add=$1
+	shift
+	for signal in "$@"; do
+		trap -- "$(
+			# print the new trap command
+			printf '%s\n' "${cmd_to_add}"
+			# helper fn to get existing trap command from output
+			# of trap -p
+			extract_trap_cmd() { printf '%s\n' "$3"; }
+			# print existing trap command with newline
+			eval "extract_trap_cmd $(trap -p "${signal}")"
+		)" "${signal}"
+	done
 }
 
 function errexit_msg {
-   if [ -o errexit ]; then
-      log_error "Exiting script [`basename $0`] due to an error executing the command [$BASH_COMMAND]."
-   else
-      log_debug "Trap [ERR] triggered in [`basename $0`] while executing the command [$BASH_COMMAND]."
-   fi
+	if [ -o errexit ]; then
+		log_error "Exiting script [$(basename $0)] due to an error executing the command [$BASH_COMMAND]."
+	else
+		log_debug "Trap [ERR] triggered in [$(basename $0)] while executing the command [$BASH_COMMAND]."
+	fi
 }
 
 if [ "$SAS_COMMON_SOURCED" = "" ]; then
-    # Save standard out to a new descriptor
-    exec 3>&1
+	# Save standard out to a new descriptor
+	exec 3>&1
 
-    # Includes
-    source bin/colors-include.sh
-    source bin/log-include.sh
-    source bin/openshift-include.sh
+	# Includes
+	source bin/colors-include.sh
+	source bin/log-include.sh
+	source bin/openshift-include.sh
 
-    if [ ! $(which sha256sum) ]; then
-      log_error "Missing required utility: sha256sum"
-      exit 1
-    fi
+	if [ ! $(which sha256sum) ]; then
+		log_error "Missing required utility: sha256sum"
+		exit 1
+	fi
 
-    # Load component Helm chart version infomation
-    # NOTE: This is loaded prior to the USER_DIR to allow
-    # overriding these defaults via USER_DIR user.env files
-    if [ -f "component_versions.env" ]; then
-        userEnv=$(grep -v '^[[:blank:]]*$' component_versions.env | grep -v '^#' | xargs)
-        if [ "$userEnv" != "" ]; then
-          log_debug "Loading global user environment file: component_versions.env"
-          if [ "$userEnv" != "" ]; then
-            export $userEnv
-          fi
-        fi
-    else
-        log_debug "No component_versions.env file found"
-    fi
+	# Load component Helm chart version infomation
+	# NOTE: This is loaded prior to the USER_DIR to allow
+	# overriding these defaults via USER_DIR user.env files
+	if [ -f "component_versions.env" ]; then
+		userEnv=$(grep -v '^[[:blank:]]*$' component_versions.env | grep -v '^#' | xargs)
+		if [ "$userEnv" != "" ]; then
+			log_debug "Loading global user environment file: component_versions.env"
+			if [ "$userEnv" != "" ]; then
+				export $userEnv
+			fi
+		fi
+	else
+		log_debug "No component_versions.env file found"
+	fi
 
+	export USER_DIR=${USER_DIR:-$(pwd)}
+	if [ -d "$USER_DIR" ]; then
+		# Resolve full path
+		export USER_DIR=$(
+			cd "$(dirname "$USER_DIR")"
+			pwd
+		)/$(basename "$USER_DIR")
+	fi
+	if [ -f "$USER_DIR/user.env" ]; then
+		userEnv=$(grep -v '^[[:blank:]]*$' $USER_DIR/user.env | grep -v '^#' | xargs)
+		if [ "$userEnv" != "" ]; then
+			log_debug "Loading global user environment file: $USER_DIR/user.env"
+			if [ "$userEnv" != "" ]; then
+				export $userEnv
+			fi
+		fi
+	fi
 
+	log_debug "Working directory: $(pwd)"
+	log_info "User directory: $USER_DIR"
 
-    export USER_DIR=${USER_DIR:-$(pwd)}
-    if [ -d "$USER_DIR" ]; then
-      # Resolve full path
-      export USER_DIR=$(cd "$(dirname "$USER_DIR")"; pwd)/$(basename "$USER_DIR")
-    fi
-    if [ -f "$USER_DIR/user.env" ]; then
-        userEnv=$(grep -v '^[[:blank:]]*$' $USER_DIR/user.env | grep -v '^#' | xargs)
-        if [ "$userEnv" != "" ]; then
-          log_debug "Loading global user environment file: $USER_DIR/user.env"
-          if [ "$userEnv" != "" ]; then
-            export $userEnv
-          fi
-        fi
-    fi
+	export AIRGAP_DEPLOYMENT=${AIRGAP_DEPLOYMENT:-false}
 
-    log_debug "Working directory: $(pwd)"
-    log_info "User directory: $USER_DIR"
+	CHECK_HELM=${CHECK_HELM:-true}
+	if [ "$CHECK_HELM" == "true" ]; then
+		source bin/helm-include.sh
+		log_verbose "Helm client version: $HELM_VER_FULL"
+	fi
 
-    export AIRGAP_DEPLOYMENT=${AIRGAP_DEPLOYMENT:-false}
-    
-    CHECK_HELM=${CHECK_HELM:-true}
-    if [ "$CHECK_HELM" == "true" ]; then
-       source bin/helm-include.sh
-       log_verbose "Helm client version: $HELM_VER_FULL"
-    fi
+	CHECK_KUBERNETES=${CHECK_KUBERNETES:-true}
+	if [ "$CHECK_KUBERNETES" == "true" ]; then
+		source bin/kube-include.sh
 
-    CHECK_KUBERNETES=${CHECK_KUBERNETES:-true}
-    if [ "$CHECK_KUBERNETES" == "true" ]; then
-       source bin/kube-include.sh
+		log_verbose Kubernetes client version: "$KUBE_CLIENT_VER"
+		log_verbose Kubernetes server version: "$KUBE_SERVER_VER"
 
-       log_verbose Kubernetes client version: "$KUBE_CLIENT_VER"
-       log_verbose Kubernetes server version: "$KUBE_SERVER_VER"
+		# Check that the current KUBECONFIG has admin access
+		CHECK_ADMIN=${CHECK_ADMIN:-true}
+		if [ "$CHECK_ADMIN" == "true" ]; then
+			if [ "$(kubectl auth can-i create namespace --all-namespaces)" == "no" ]; then
+				ctx=$(kubectl config current-context)
+				log_error "The current kubectl context [$ctx] does not have cluster admin access"
+				exit 1
+			else
+				log_debug "Cluster admin check OK"
+			fi
+		else
+			log_debug "Cluster admin check disabled"
+		fi
+	fi
 
-       # Check that the current KUBECONFIG has admin access
-       CHECK_ADMIN=${CHECK_ADMIN:-true}
-       if [ "$CHECK_ADMIN" == "true" ]; then
-          if [ "$(kubectl auth can-i create namespace --all-namespaces)" == "no" ]; then
-             ctx=$(kubectl config current-context)
-             log_error "The current kubectl context [$ctx] does not have cluster admin access"
-             exit 1
-          else
-             log_debug "Cluster admin check OK"
-          fi
-       else
-          log_debug "Cluster admin check disabled"
-       fi
-    fi
+	# set TLS Cert Generator (cert-manager|openssl)
+	export CERT_GENERATOR="${CERT_GENERATOR:-openssl}"
 
-    # set TLS Cert Generator (cert-manager|openssl)
-    export CERT_GENERATOR="${CERT_GENERATOR:-openssl}"
+	# Set default timeout for kubectl namespace delete command
+	export KUBE_NAMESPACE_DELETE_TIMEOUT=${KUBE_NAMESPACE_DELETE_TIMEOUT:-5m}
 
+	export TMP_DIR=$(mktemp -d -t sas.mon.XXXXXXXX)
+	if [ ! -d "$TMP_DIR" ]; then
+		log_error "Could not create temporary directory [$TMP_DIR]"
+		exit 1
+	fi
+	log_debug "Temporary directory: [$TMP_DIR]"
+	echo "# This file intentionally empty" >$TMP_DIR/empty.yaml
 
-    # Set default timeout for kubectl namespace delete command
-    export KUBE_NAMESPACE_DELETE_TIMEOUT=${KUBE_NAMESPACE_DELETE_TIMEOUT:-5m}
+	# Delete the temp directory on exit
+	function cleanup {
+		KEEP_TMP_DIR=${KEEP_TMP_DIR:-false}
+		if [ "$KEEP_TMP_DIR" != "true" ]; then
+			rm -rf "$TMP_DIR"
+			log_debug "Deleted temporary directory: [$TMP_DIR]"
+		else
+			log_info "TMP_DIR [$TMP_DIR] was not removed"
+		fi
+	}
+	trap_add cleanup EXIT
 
-    export TMP_DIR=$(mktemp -d -t sas.mon.XXXXXXXX)
-    if [ ! -d "$TMP_DIR" ]; then
-      log_error "Could not create temporary directory [$TMP_DIR]"
-      exit 1
-    fi
-    log_debug "Temporary directory: [$TMP_DIR]"
-    echo "# This file intentionally empty" > $TMP_DIR/empty.yaml
+	trap_add errexit_msg ERR
 
-    # Delete the temp directory on exit
-    function cleanup {
-      KEEP_TMP_DIR=${KEEP_TMP_DIR:-false}
-      if [ "$KEEP_TMP_DIR" != "true" ]; then
-        rm -rf "$TMP_DIR"
-        log_debug "Deleted temporary directory: [$TMP_DIR]"
-      else
-        log_info "TMP_DIR [$TMP_DIR] was not removed"
-      fi
-    }
-    trap_add cleanup EXIT
-
-    trap_add errexit_msg ERR
-
-    export SAS_COMMON_SOURCED=true
+	export SAS_COMMON_SOURCED=true
 fi
 
 function checkDefaultStorageClass {
-    if [ -z "$defaultStorageClass" ]; then
-      # Check for kubernetes environment conflicts/requirements
-      defaultStorageClass=$(kubectl get storageclass -o jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.metadata.annotations..storageclass\.kubernetes\.io/is-default-class}{'\n'}{end}" | grep true | awk '{print $1}')
-      if [ "$defaultStorageClass" ]; then
-        log_debug "Found default storageClass: [$defaultStorageClass]"
-      else
-        # Try again with beta storageclass annotation key
-        defaultStorageClass=$(kubectl get storageclass -o jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.metadata.annotations..storageclass\.beta\.kubernetes\.io/is-default-class}{'\n'}{end}" | grep true | awk '{print $1}')
-        if [ "$defaultStorageClass" ]; then
-          log_debug "Found default storageClass: [$defaultStorageClass]"
-        else
-          log_warn "This cluster does not have a default storageclass defined"
-          log_warn "This may cause errors unless storageclass values are explicitly defined"
-          defaultStorageClass=_NONE_
-        fi
-      fi
-    fi
+	if [ -z "$defaultStorageClass" ]; then
+		# Check for kubernetes environment conflicts/requirements
+		defaultStorageClass=$(kubectl get storageclass -o jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.metadata.annotations..storageclass\.kubernetes\.io/is-default-class}{'\n'}{end}" | grep true | awk '{print $1}')
+		if [ "$defaultStorageClass" ]; then
+			log_debug "Found default storageClass: [$defaultStorageClass]"
+		else
+			# Try again with beta storageclass annotation key
+			defaultStorageClass=$(kubectl get storageclass -o jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.metadata.annotations..storageclass\.beta\.kubernetes\.io/is-default-class}{'\n'}{end}" | grep true | awk '{print $1}')
+			if [ "$defaultStorageClass" ]; then
+				log_debug "Found default storageClass: [$defaultStorageClass]"
+			else
+				log_warn "This cluster does not have a default storageclass defined"
+				log_warn "This may cause errors unless storageclass values are explicitly defined"
+				defaultStorageClass=_NONE_
+			fi
+		fi
+	fi
 }
 
 function validateTenantID {
-  tenantID=$1
-  reservedNames=(default provider shared sharedservices spre uaa viya)
+	tenantID=$1
+	reservedNames=(default provider shared sharedservices spre uaa viya)
 
-  CHECK_TENANT_NAME=${CHECK_TENANT_NAME:-true}
-  if [ "$CHECK_TENANT_NAME" == "true" ]; then
-    if [[ $tenantID =~ ^[a-z]([a-z0-9]){0,15}$ ]]; then
-      if [[ $tenantID =~ ^sas ]]; then
-        log_error "Tenant names cannot start with 'sas'"
-        exit 1
-      fi
-      for n in ${reservedNames[@]}; do
-        if [ "$tenantID" == "$n" ]; then
-          log_error "The tenant name [$tenantID] is a reserved name"
-          exit 1
-        fi
-      done
-    else
-      log_error "[$tenantID] is not a valid tenant name"
-      exit 1
-    fi
-  else
-    log_debug "Tenant name validation is disabled"
-  fi
+	CHECK_TENANT_NAME=${CHECK_TENANT_NAME:-true}
+	if [ "$CHECK_TENANT_NAME" == "true" ]; then
+		if [[ $tenantID =~ ^[a-z]([a-z0-9]){0,15}$ ]]; then
+			if [[ $tenantID =~ ^sas ]]; then
+				log_error "Tenant names cannot start with 'sas'"
+				exit 1
+			fi
+			for n in ${reservedNames[@]}; do
+				if [ "$tenantID" == "$n" ]; then
+					log_error "The tenant name [$tenantID] is a reserved name"
+					exit 1
+				fi
+			done
+		else
+			log_error "[$tenantID] is not a valid tenant name"
+			exit 1
+		fi
+	else
+		log_debug "Tenant name validation is disabled"
+	fi
 }
 
-
 function validateNamespace {
-  local namespace
-  namespace="$1"
-  if [[ "$namespace" =~ ^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$ ]]; then
-    log_debug "Namespace [$namespace] passes validation"
-  else
-    log_error "[$namespace] is not a valid namespace name"
-    exit 1
-  fi
+	local namespace
+	namespace="$1"
+	if [[ $namespace =~ ^[a-z0-9]([\-a-z0-9]*[a-z0-9])?$ ]]; then
+		log_debug "Namespace [$namespace] passes validation"
+	else
+		log_error "[$namespace] is not a valid namespace name"
+		exit 1
+	fi
 }
 
-
 function randomPassword {
-  date +%s | sha256sum | base64 | head -c 32 ; echo
+	date +%s | sha256sum | base64 | head -c 32
+	echo
 }
 
 function disable_sa_token_automount {
-  local ns sa_name should_disable
-  ns=$1
-  sa_name=$2
-  should_disable=${SEC_DISABLE_SA_TOKEN_AUTOMOUNT:-true}
-  
-  if [ "$should_disable" == "true" ]; then
-    if [ -n "$(kubectl -n "$ns" get serviceAccount "$sa_name" -o name 2>/dev/null)" ]; then
-      log_debug "Disabling automount of API tokens for serviceAccount [$ns/$sa_name]"
-      kubectl -n $ns patch serviceAccount $sa_name -p '{"automountServiceAccountToken":false}'
-    else
-      log_debug "ServiceAccount [$ns/$sa_name] not found. Skipping patch"
-    fi
-  else
-    log_debug "NOT disabling token automount serviceAccount [$ns/$sa_name]; SEC_DISABLE_SA_TOKEN_AUTOMOUNT set to [$SEC_DISABLE_SA_TOKEN_AUTOMOUNT]"
-  fi
+	local ns sa_name should_disable
+	ns=$1
+	sa_name=$2
+	should_disable=${SEC_DISABLE_SA_TOKEN_AUTOMOUNT:-true}
+
+	if [ "$should_disable" == "true" ]; then
+		if [ -n "$(kubectl -n "$ns" get serviceAccount "$sa_name" -o name 2>/dev/null)" ]; then
+			log_debug "Disabling automount of API tokens for serviceAccount [$ns/$sa_name]"
+			kubectl -n $ns patch serviceAccount $sa_name -p '{"automountServiceAccountToken":false}'
+		else
+			log_debug "ServiceAccount [$ns/$sa_name] not found. Skipping patch"
+		fi
+	else
+		log_debug "NOT disabling token automount serviceAccount [$ns/$sa_name]; SEC_DISABLE_SA_TOKEN_AUTOMOUNT set to [$SEC_DISABLE_SA_TOKEN_AUTOMOUNT]"
+	fi
 }
 
 function enable_pod_token_automount {
-  local ns resource_type resource_name should_disable
-  ns=$1
-  resource_type=$2
-  resource_name=$3
-  should_disable=${SEC_DISABLE_SA_TOKEN_AUTOMOUNT:-true}
+	local ns resource_type resource_name should_disable
+	ns=$1
+	resource_type=$2
+	resource_name=$3
+	should_disable=${SEC_DISABLE_SA_TOKEN_AUTOMOUNT:-true}
 
-  if [ "$should_disable" == "true" ]; then
-     log_debug "Enabling automount of API tokens for pods deployed via [$resource_type/$resource_name]"
+	if [ "$should_disable" == "true" ]; then
+		log_debug "Enabling automount of API tokens for pods deployed via [$resource_type/$resource_name]"
 
-     if [ "$resource_type" == "daemonset" ] || [ "$resource_type" == "deployment" ]; then
-        kubectl -n $ns patch $resource_type  $resource_name -p '{"spec": {"template": {"spec": {"automountServiceAccountToken":true}}}}'
-     else
-        log_error "Invalid request to function [${FUNCNAME[0]}]; unsupported resource_type [$resource_type]"
-        return 1
-     fi
-  else
-     log_debug "NOT enabling token automount on pods for [$ns/$resource_type/$resource_name]; SEC_DISABLE_SA_TOKEN_AUTOMOUNT set to [$SEC_DISABLE_SA_TOKEN_AUTOMOUNT]"
-  fi
+		if [ "$resource_type" == "daemonset" ] || [ "$resource_type" == "deployment" ]; then
+			kubectl -n $ns patch $resource_type $resource_name -p '{"spec": {"template": {"spec": {"automountServiceAccountToken":true}}}}'
+		else
+			log_error "Invalid request to function [${FUNCNAME[0]}]; unsupported resource_type [$resource_type]"
+			return 1
+		fi
+	else
+		log_debug "NOT enabling token automount on pods for [$ns/$resource_type/$resource_name]; SEC_DISABLE_SA_TOKEN_AUTOMOUNT set to [$SEC_DISABLE_SA_TOKEN_AUTOMOUNT]"
+	fi
 }
 
 export -f checkDefaultStorageClass
@@ -255,75 +255,73 @@
 export -f enable_pod_token_automount
 
 function parseFullImage {
-   fullImage="$1"
-   unset REGISTRY REPOS IMAGE VERSION
+	fullImage="$1"
+	unset REGISTRY REPOS IMAGE VERSION
 
-   if [[ "$1" =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
+	if [[ $1 =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
 
-      REGISTRY="${BASH_REMATCH[1]}"
-      REPOS="${BASH_REMATCH[2]}"
-      IMAGE="${BASH_REMATCH[3]}"
-      VERSION="${BASH_REMATCH[4]}"
-      return 0
-   else
-      log_warn "Invalid value for full container image; does not fit expected pattern [$1]."
-      return 1
-   fi
+		REGISTRY="${BASH_REMATCH[1]}"
+		REPOS="${BASH_REMATCH[2]}"
+		IMAGE="${BASH_REMATCH[3]}"
+		VERSION="${BASH_REMATCH[4]}"
+		return 0
+	else
+		log_warn "Invalid value for full container image; does not fit expected pattern [$1]."
+		return 1
+	fi
 }
 
-
 function v4m_replace {
 
-    if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-      sed -i '' s/"$1"/"$2"/g  "$3"
-    else
-      sed -i  s/"$1"/"$2"/g  "$3"
-    fi
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' s/"$1"/"$2"/g "$3"
+	else
+		sed -i s/"$1"/"$2"/g "$3"
+	fi
 }
 
 function doitall {
 
-   #arg1 Full container image
-   #arg2 name of template file
-   #arg3 prefix to insert in placeholders (optional)
+	#arg1 Full container image
+	#arg2 name of template file
+	#arg3 prefix to insert in placeholders (optional)
 
-   if ! parseFullImage "$1";  then
-      log_error "Unable to parse full image [$1]"
-      return 1
-   fi
+	if ! parseFullImage "$1"; then
+		log_error "Unable to parse full image [$1]"
+		return 1
+	fi
 
-   prefix=${3:-""}
+	prefix=${3:-""}
 
-   imageKeysFile="$TMP_DIR/imageKeysFile.yaml"
-   template_file=$2
+	imageKeysFile="$TMP_DIR/imageKeysFile.yaml"
+	template_file=$2
 
-   if [ "$template_file" != "TEMPFILE" ]; then
-      rm -f  $imageKeysFile
-      cp $template_file  $imageKeysFile
-   else
-      log_debug "Modifying an existing imageKeysFile"
-   fi
+	if [ "$template_file" != "TEMPFILE" ]; then
+		rm -f $imageKeysFile
+		cp $template_file $imageKeysFile
+	else
+		log_debug "Modifying an existing imageKeysFile"
+	fi
 
-   if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-      GLOBAL_REGISTRY="$AIRGAP_REGISTRY"
-   else
-      GLOBAL_REGISTRY="null"
-   fi
+	if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
+		GLOBAL_REGISTRY="$AIRGAP_REGISTRY"
+	else
+		GLOBAL_REGISTRY="null"
+	fi
 
-   v4m_replace "__${prefix}GLOBAL_REGISTRY__"    "$GLOBAL_REGISTRY"          "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE_REGISTRY__"     "$REGISTRY"                 "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE_REPO_3LEVEL__"  "$REGISTRY\/$REPOS\/$IMAGE" "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE_REPO_2LEVEL__"  "$REPOS\/$IMAGE"            "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE__"              "$IMAGE"                    "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE_TAG__"          "$VERSION"                  "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE_PULL_POLICY__"  "IfNotPresent"              "$imageKeysFile"
-   v4m_replace "__${prefix}IMAGE_PULL_SECRET__"  "null"                      "$imageKeysFile"       #Handle Single Image Pull Secret
-   v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]"                        "$imageKeysFile"       #Handle Multiple Image Pull Secrets
+	v4m_replace "__${prefix}GLOBAL_REGISTRY__" "$GLOBAL_REGISTRY" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE_REGISTRY__" "$REGISTRY" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE_REPO_3LEVEL__" "$REGISTRY\/$REPOS\/$IMAGE" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE_REPO_2LEVEL__" "$REPOS\/$IMAGE" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE__" "$IMAGE" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE_TAG__" "$VERSION" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE_PULL_POLICY__" "IfNotPresent" "$imageKeysFile"
+	v4m_replace "__${prefix}IMAGE_PULL_SECRET__" "null" "$imageKeysFile" #Handle Single Image Pull Secret
+	v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]" "$imageKeysFile"  #Handle Multiple Image Pull Secrets
 
-   return 0
+	return 0
 }
 
-
 export -f parseFullImage
 export -f v4m_replace
 export -f doitall
--- bin/test-fb-image.sh.orig
+++ bin/test-fb-image.sh
@@ -1,38 +1,37 @@
 #! /bin/bash
 
 function parseFullImage {
-   fullImage="$1"
-   unset REGISTRY REPOS IMAGE VERSION
+	fullImage="$1"
+	unset REGISTRY REPOS IMAGE VERSION
 
-   if [[ "$1" =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
-      echo "ALL:      ${BASH_REMATCH[0]}"
-      REGISTRY="${BASH_REMATCH[1]}"
-      REPOS="${BASH_REMATCH[2]}"
-      IMAGE="${BASH_REMATCH[3]}"
-      VERSION="${BASH_REMATCH[4]}"
-   else
-      echo "no match"
-   fi
+	if [[ $1 =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
+		echo "ALL:      ${BASH_REMATCH[0]}"
+		REGISTRY="${BASH_REMATCH[1]}"
+		REPOS="${BASH_REMATCH[2]}"
+		IMAGE="${BASH_REMATCH[3]}"
+		VERSION="${BASH_REMATCH[4]}"
+	else
+		echo "no match"
+	fi
 }
 
-
 function v4m_replace {
 
-    if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-      sed -i '' s/"$1"/"$2"/g  "$3"
-    else
-      sed -i  s/"$1"/"$2"/g  "$3"
-    fi
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' s/"$1"/"$2"/g "$3"
+	else
+		sed -i s/"$1"/"$2"/g "$3"
+	fi
 }
 
 FB_FULL_IMAGE="cr.fluentbit.io/fluent/fluent-bit:2.1.10"
 parseFullImage "$FB_FULL_IMAGE"
 
-rm -f  /tmp/container_image.yaml
+rm -f /tmp/container_image.yaml
 cp logging/fb/container_image.template /tmp/container_image.yaml
 
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-   REGISTRY="$AIRGAP_REGISTRY"
+	REGISTRY="$AIRGAP_REGISTRY"
 fi
 
 v4m_replace "__IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml"
@@ -46,15 +45,15 @@
 OS_FULL_IMAGE="docker.io/opensearchproject/opensearch:2.10.0"
 parseFullImage "$OS_FULL_IMAGE"
 
-rm -f  /tmp/container_image.yaml
+rm -f /tmp/container_image.yaml
 cp logging/opensearch/os_container_image.template /tmp/container_image.yaml
 
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-   REGISTRY="$AIRGAP_REGISTRY"
+	REGISTRY="$AIRGAP_REGISTRY"
 fi
 
 v4m_replace "__GLOBAL_REGISTRY__" "$REGISTRY" "/tmp/container_image.yaml"
-v4m_replace "__IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml"    #No Registry since we set Global?
+v4m_replace "__IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml" #No Registry since we set Global?
 v4m_replace "__IMAGE_TAG__" "$VERSION" "/tmp/container_image.yaml"
 v4m_replace "__IMAGE_PULL_POLICY__" "Always" "/tmp/container_image.yaml"
 v4m_replace "__IMAGE_PULL_SECRETS__" "[]" "/tmp/container_image.yaml"
@@ -62,20 +61,20 @@
 OS_SYSCTL_FULL_IMAGE="docker.io/library/busybox:latest"
 parseFullImage "$OS_SYSCTL_FULL_IMAGE"
 
-v4m_replace "__OS_SYSCTL_IMAGE__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml" 
+v4m_replace "__OS_SYSCTL_IMAGE__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml"
 v4m_replace "__OS_SYSCTL_TAG__" "$VERSION" "/tmp/container_image.yaml"
 
 cat /tmp/container_image.yaml
 
-#3rd times the charm 
+#3rd times the charm
 OSD_FULL_IMAGE="docker.io/opensearchproject/opensearch-dashboards:2.10.0"
 parseFullImage "$OSD_FULL_IMAGE"
 
-rm -f  /tmp/container_image.yaml
+rm -f /tmp/container_image.yaml
 cp logging/opensearch/osd_container_image.template /tmp/container_image.yaml
 
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-   REGISTRY="$AIRGAP_REGISTRY"
+	REGISTRY="$AIRGAP_REGISTRY"
 fi
 
 #v4m_replace "__GLOBAL_REGISTRY__" "$REGISTRY" "/tmp/container_image.yaml"  #NOT NEEDED
@@ -90,72 +89,72 @@
 ES_EXPORTER_FULL_IMAGE="quay.io/prometheuscommunity/elasticsearch-exporter:v1.6.0"
 parseFullImage "$ES_EXPORTER_FULL_IMAGE"
 
-rm -f  /tmp/container_image.yaml
+rm -f /tmp/container_image.yaml
 cp logging/esexporter/es-exporter_container_image.template /tmp/container_image.yaml
 
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-   REGISTRY="$AIRGAP_REGISTRY"
+	REGISTRY="$AIRGAP_REGISTRY"
 fi
 
 #v4m_replace "__GLOBAL_REGISTRY__" "$REGISTRY" "/tmp/container_image.yaml"  #NOT NEEDED
 v4m_replace "__IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "/tmp/container_image.yaml"
 v4m_replace "__IMAGE_TAG__" "$VERSION" "/tmp/container_image.yaml"
 v4m_replace "__IMAGE_PULL_POLICY__" "Always" "/tmp/container_image.yaml"
-v4m_replace "__IMAGE_PULL_SECRET__" "null" "/tmp/container_image.yaml"      #Single Image Pull Secret 
+v4m_replace "__IMAGE_PULL_SECRET__" "null" "/tmp/container_image.yaml" #Single Image Pull Secret
 
 cat /tmp/container_image.yaml
 
 #Function, function what's your (er) function?
 function doitall {
 
-   #arg1 Full container image
-   #arg2 name of template file
-   #arg3 prefix to insert in placeholders
-   #prefix="_"
-   parseFullImage "$1"
-   prefix=${3:-""}
+	#arg1 Full container image
+	#arg2 name of template file
+	#arg3 prefix to insert in placeholders
+	#prefix="_"
+	parseFullImage "$1"
+	prefix=${3:-""}
 
-   tempfile="/tmp/container_image.yaml"
-   template_file=$2
+	tempfile="/tmp/container_image.yaml"
+	template_file=$2
 
-   if [ "$template_file" != "TEMPFILE" ]; then
-      rm -f  $tempfile
-      cp $template_file  $tempfile
-   else
-      echo "DEBUG: modifying existing file"
-   fi
+	if [ "$template_file" != "TEMPFILE" ]; then
+		rm -f $tempfile
+		cp $template_file $tempfile
+	else
+		echo "DEBUG: modifying existing file"
+	fi
 
-   if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-      REGISTRY="$AIRGAP_REGISTRY"
-   fi
-   v4m_replace "__${prefix}IMAGE_REGISTRY__"     "$REGISTRY"                 "$tempfile"
-   v4m_replace "__${prefix}GLOBAL_REGISTRY__"    "$REGISTRY"                 "$tempfile"
-   v4m_replace "__${prefix}IMAGE_REPO__"         "$REGISTRY\/$REPOS\/$IMAGE" "$tempfile"
-   v4m_replace "__${prefix}IMAGE__"              "$IMAGE"                    "$tempfile"
-   v4m_replace "__${prefix}IMAGE_TAG__"          "$VERSION"                  "$tempfile"
-   v4m_replace "__${prefix}IMAGE_PULL_POLICY__"  "Always"                    "$tempfile"
-   v4m_replace "__${prefix}IMAGE_PULL_SECRET__"  "null"                      "$tempfile"       #Handle Single Image Pull Secret
-   v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]"                        "$tempfile"       #Handle Multiple Image Pull Secrets
+	if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
+		REGISTRY="$AIRGAP_REGISTRY"
+	fi
+	v4m_replace "__${prefix}IMAGE_REGISTRY__" "$REGISTRY" "$tempfile"
+	v4m_replace "__${prefix}GLOBAL_REGISTRY__" "$REGISTRY" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "$tempfile"
+	v4m_replace "__${prefix}IMAGE__" "$IMAGE" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_TAG__" "$VERSION" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_PULL_POLICY__" "Always" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_PULL_SECRET__" "null" "$tempfile" #Handle Single Image Pull Secret
+	v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]" "$tempfile"  #Handle Multiple Image Pull Secrets
 
-   cat $tempfile
+	cat $tempfile
 
 }
 
 echo "*****************"
 
-doitall "$FB_FULL_IMAGE"          "logging/fb/container_image.template"
+doitall "$FB_FULL_IMAGE" "logging/fb/container_image.template"
 
-doitall "$OS_FULL_IMAGE"          "logging/opensearch/os_container_image.template"
-doitall "$OS_SYSCTL_FULL_IMAGE"   "TEMPFILE"  "OS_SYSCTL_"
+doitall "$OS_FULL_IMAGE" "logging/opensearch/os_container_image.template"
+doitall "$OS_SYSCTL_FULL_IMAGE" "TEMPFILE" "OS_SYSCTL_"
 
-doitall "$OSD_FULL_IMAGE"         "logging/opensearch/osd_container_image.template"
+doitall "$OSD_FULL_IMAGE" "logging/opensearch/osd_container_image.template"
 
 doitall "$ES_EXPORTER_FULL_IMAGE" "logging/esexporter/es-exporter_container_image.template"
 
 GRAFANA_FULL_IMAGE="docker.io/grafana/grafana:10.2.1"
 GRAFANA_SIDECAR_FULL_IMAGE="quay.io/kiwigrid/k8s-sidecar:1.25.2"
-doitall "$GRAFANA_FULL_IMAGE"     "monitoring/grafana_container_image.template"
-doitall "$GRAFANA_SIDECAR_FULL_IMAGE"   "TEMPFILE"  "SIDECAR_"
+doitall "$GRAFANA_FULL_IMAGE" "monitoring/grafana_container_image.template"
+doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE" "SIDECAR_"
 
 ALERTMANAGER_FULL_IMAGE="quay.io/prometheus/alertmanager:v0.26.0"
 GRAFANA_FULL_IMAGE="docker.io/grafana/grafana:10.2.1"
@@ -167,18 +166,16 @@
 PROMOP_FULL_IMAGE="quay.io/prometheus-operator/prometheus-operator:v0.69.1"
 CONFIGRELOAD_FULL_IMAGE="quay.io/prometheus-operator/prometheus-config-reloader:v0.69.1"
 
-doitall "$PROMOP_FULL_IMAGE"          "TEMPFILE"  "monitoring/prom-operator_container_image.template"
-doitall "$ALERTMANAGER_FULL_IMAGE"    "TEMPFILE"  "ALERTMANAGER_"
-doitall "$ADMWEBHOOK_FULL_IMAGE"      "TEMPFILE"  "ADMWEBHOOK_"
-doitall "$KSM_FULL_IMAGE"             "TEMPFILE"  "KSM_"
-doitall "$NODEXPORT_FULL_IMAGE"       "TEMPFILE"  "NODEXPORT_"
-doitall "$PROMETHEUS_FULL_IMAGE"      "TEMPFILE"  "PROMETHEUS_"
-doitall "$CONFIGRELOAD_FULL_IMAGE"    "TEMPFILE"  "CONFIGRELOAD_"
-doitall "$GRAFANA_FULL_IMAGE"         "TEMPFILE"  "GRAFANA_"
-doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE"  "SIDECAR_"
+doitall "$PROMOP_FULL_IMAGE" "TEMPFILE" "monitoring/prom-operator_container_image.template"
+doitall "$ALERTMANAGER_FULL_IMAGE" "TEMPFILE" "ALERTMANAGER_"
+doitall "$ADMWEBHOOK_FULL_IMAGE" "TEMPFILE" "ADMWEBHOOK_"
+doitall "$KSM_FULL_IMAGE" "TEMPFILE" "KSM_"
+doitall "$NODEXPORT_FULL_IMAGE" "TEMPFILE" "NODEXPORT_"
+doitall "$PROMETHEUS_FULL_IMAGE" "TEMPFILE" "PROMETHEUS_"
+doitall "$CONFIGRELOAD_FULL_IMAGE" "TEMPFILE" "CONFIGRELOAD_"
+doitall "$GRAFANA_FULL_IMAGE" "TEMPFILE" "GRAFANA_"
+doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE" "SIDECAR_"
 
-
-
 #### REMOVE FOLLOWING
 exit
 LOG_NS=foo
@@ -186,11 +183,10 @@
 touch /tmp/empty.yaml
 FB_OPENSEARCH_USER_YAML=/tmp/empty.yaml
 set -x
-helm $helmDebug upgrade --install --namespace $LOG_NS fb-testing  \
-  --version $FLUENTBIT_HELM_CHART_VERSION \
-  --values /tmp/container_image.yaml \
-  --values logging/fb/fluent-bit_helm_values_opensearch.yaml  \
-  --values $FB_OPENSEARCH_USER_YAML   \
-  --set fullnameOverride=v4m-fb \
-  fluent/fluent-bit
- 
+helm $helmDebug upgrade --install --namespace $LOG_NS fb-testing \
+	--version $FLUENTBIT_HELM_CHART_VERSION \
+	--values /tmp/container_image.yaml \
+	--values logging/fb/fluent-bit_helm_values_opensearch.yaml \
+	--values $FB_OPENSEARCH_USER_YAML \
+	--set fullnameOverride=v4m-fb \
+	fluent/fluent-bit
--- bin/test-fb-image2.sh.orig
+++ bin/test-fb-image2.sh
@@ -1,113 +1,109 @@
 #! /bin/bash
 
 function parseFullImage {
-   fullImage="$1"
-   unset REGISTRY REPOS IMAGE VERSION
+	fullImage="$1"
+	unset REGISTRY REPOS IMAGE VERSION
 
-   if [[ "$1" =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
-      ###echo "DEBUG:  ${BASH_REMATCH[0]}"
+	if [[ $1 =~ (.*)\/(.*)\/(.*)\:(.*) ]]; then
+		###echo "DEBUG:  ${BASH_REMATCH[0]}"
 
-      REGISTRY="${BASH_REMATCH[1]}"
-      REPOS="${BASH_REMATCH[2]}"
-      IMAGE="${BASH_REMATCH[3]}"
-      VERSION="${BASH_REMATCH[4]}"
-      return 0
-   else
-      ###echo "no match"
-      return 1
-   fi
+		REGISTRY="${BASH_REMATCH[1]}"
+		REPOS="${BASH_REMATCH[2]}"
+		IMAGE="${BASH_REMATCH[3]}"
+		VERSION="${BASH_REMATCH[4]}"
+		return 0
+	else
+		###echo "no match"
+		return 1
+	fi
 }
 
-
 function v4m_replace {
 
-    if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-      sed -i '' s/"$1"/"$2"/g  "$3"
-    else
-      sed -i  s/"$1"/"$2"/g  "$3"
-    fi
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' s/"$1"/"$2"/g "$3"
+	else
+		sed -i s/"$1"/"$2"/g "$3"
+	fi
 }
 
-
-
 #Function, function what's your (er) function?
 function doitall {
 
-   #arg1 Full container image
-   #arg2 name of template file
-   #arg3 prefix to insert in placeholders
+	#arg1 Full container image
+	#arg2 name of template file
+	#arg3 prefix to insert in placeholders
 
-   if ! parseFullImage "$1";  then
-      echo "ERROR: unable to parse full image [$1]"
-      return 1
-   fi
+	if ! parseFullImage "$1"; then
+		echo "ERROR: unable to parse full image [$1]"
+		return 1
+	fi
 
-   prefix=${3:-""}
+	prefix=${3:-""}
 
-   tempfile="/tmp/container_image.yaml"
-   template_file=$2
+	tempfile="/tmp/container_image.yaml"
+	template_file=$2
 
-   if [ "$template_file" != "TEMPFILE" ]; then
-      rm -f  $tempfile
-      cp $template_file  $tempfile
-   else
-      echo "DEBUG: modifying existing file"
-   fi
+	if [ "$template_file" != "TEMPFILE" ]; then
+		rm -f $tempfile
+		cp $template_file $tempfile
+	else
+		echo "DEBUG: modifying existing file"
+	fi
 
-   if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-      REGISTRY="$AIRGAP_REGISTRY"
-   fi
+	if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
+		REGISTRY="$AIRGAP_REGISTRY"
+	fi
 
-   v4m_replace "__${prefix}IMAGE_REGISTRY__"     "$REGISTRY"                 "$tempfile"
-   v4m_replace "__${prefix}GLOBAL_REGISTRY__"    "$REGISTRY"                 "$tempfile"
-   v4m_replace "__${prefix}IMAGE_REPO__"         "$REGISTRY\/$REPOS\/$IMAGE" "$tempfile"
-   v4m_replace "__${prefix}IMAGE__"              "$IMAGE"                    "$tempfile"
-   v4m_replace "__${prefix}IMAGE_TAG__"          "$VERSION"                  "$tempfile"
-   v4m_replace "__${prefix}IMAGE_PULL_POLICY__"  "Always"                    "$tempfile"
-   v4m_replace "__${prefix}IMAGE_PULL_SECRET__"  "null"                      "$tempfile"       #Handle Single Image Pull Secret
-   v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]"                        "$tempfile"       #Handle Multiple Image Pull Secrets
+	v4m_replace "__${prefix}IMAGE_REGISTRY__" "$REGISTRY" "$tempfile"
+	v4m_replace "__${prefix}GLOBAL_REGISTRY__" "$REGISTRY" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_REPO__" "$REGISTRY\/$REPOS\/$IMAGE" "$tempfile"
+	v4m_replace "__${prefix}IMAGE__" "$IMAGE" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_TAG__" "$VERSION" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_PULL_POLICY__" "Always" "$tempfile"
+	v4m_replace "__${prefix}IMAGE_PULL_SECRET__" "null" "$tempfile" #Handle Single Image Pull Secret
+	v4m_replace "__${prefix}IMAGE_PULL_SECRETS__" "[]" "$tempfile"  #Handle Multiple Image Pull Secrets
 
-   return 0
+	return 0
 }
 
+if [ -f "component_versions.env" ]; then
+	userEnv=$(grep -v '^[[:blank:]]*$' component_versions.env | grep -v '^#' | xargs)
+	if [ "$userEnv" != "" ]; then
+		echo "DEBUG: Loading global user environment file: component_versions.env"
+		if [ "$userEnv" != "" ]; then
+			export $userEnv
+		fi
+	fi
+else
+	echo "DEBUG No component_versions.env file found"
+fi
 
-    if [ -f "component_versions.env" ]; then
-        userEnv=$(grep -v '^[[:blank:]]*$' component_versions.env | grep -v '^#' | xargs)
-        if [ "$userEnv" != "" ]; then
-           echo "DEBUG: Loading global user environment file: component_versions.env"
-          if [ "$userEnv" != "" ]; then
-            export $userEnv
-          fi
-        fi
-    else
-        echo "DEBUG No component_versions.env file found"
-    fi
-
-
 echo "*****************"
 TEMPFILE="/tmp/container_image.yaml"
 
 ###FB_FULL_IMAGE="cr.fluentbit.io/fluent/fluent-bit:2.1.10"
-if doitall "$FB_FULL_IMAGE"          "logging/fb/container_image.template"; then
-   cat $TEMPFILE
+if doitall "$FB_FULL_IMAGE" "logging/fb/container_image.template"; then
+	cat $TEMPFILE
 else
-   echo "ERROR"
+	echo "ERROR"
 fi
 
 ###OS_FULL_IMAGE="docker.io/opensearchproject/opensearch:2.10.0"
 ###OS_SYSCTL_FULL_IMAGE="docker.io/library/busybox:latest"
-if doitall "$OS_FULL_IMAGE"          "logging/opensearch/os_container_image.template"; then
-   if doitall "$OS_SYSCTL_FULL_IMAGE"   "TEMPFILE"  "OS_SYSCTL_"; then
-      cat $TEMPFILE
-   else echo "ERROR: Failed on [OS_SYSCT]"
-   fi
+if doitall "$OS_FULL_IMAGE" "logging/opensearch/os_container_image.template"; then
+	if doitall "$OS_SYSCTL_FULL_IMAGE" "TEMPFILE" "OS_SYSCTL_"; then
+		cat $TEMPFILE
+	else
+		echo "ERROR: Failed on [OS_SYSCT]"
+	fi
 else
-   echo "ERROR: Failed on [OS]"
+	echo "ERROR: Failed on [OS]"
 fi
 exit
 
 ###OSD_FULL_IMAGE="docker.io/opensearchproject/opensearch-dashboards:2.10.0"
-doitall "$OSD_FULL_IMAGE"         "logging/opensearch/osd_container_image.template"
+doitall "$OSD_FULL_IMAGE" "logging/opensearch/osd_container_image.template"
 cat $TEMPFILE
 
 ###ES_EXPORTER_FULL_IMAGE="quay.io/prometheuscommunity/elasticsearch-exporter:v1.6.0"
@@ -116,8 +112,8 @@
 
 ###GRAFANA_FULL_IMAGE="docker.io/grafana/grafana:10.2.1"
 ###GRAFANA_SIDECAR_FULL_IMAGE="quay.io/kiwigrid/k8s-sidecar:1.25.2"
-doitall "$GRAFANA_FULL_IMAGE"     "monitoring/grafana_container_image.template"
-doitall "$GRAFANA_SIDECAR_FULL_IMAGE"   "TEMPFILE"  "SIDECAR_"
+doitall "$GRAFANA_FULL_IMAGE" "monitoring/grafana_container_image.template"
+doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE" "SIDECAR_"
 cat $TEMPFILE
 
 ###ALERTMANAGER_FULL_IMAGE="quay.io/prometheus/alertmanager:v0.26.0"
@@ -130,15 +126,15 @@
 ###PROMOP_FULL_IMAGE="quay.io/prometheus-operator/prometheus-operator:v0.69.1"
 ###CONFIGRELOAD_FULL_IMAGE="quay.io/prometheus-operator/prometheus-config-reloader:v0.69.1"
 
-doitall "$PROMOP_FULL_IMAGE"          "monitoring/prom-operator_container_image.template"
-doitall "$ALERTMANAGER_FULL_IMAGE"    "TEMPFILE"  "ALERTMANAGER_"
-doitall "$ADMWEBHOOK_FULL_IMAGE"      "TEMPFILE"  "ADMWEBHOOK_"
-doitall "$KSM_FULL_IMAGE"             "TEMPFILE"  "KSM_"
-doitall "$NODEXPORT_FULL_IMAGE"       "TEMPFILE"  "NODEXPORT_"
-doitall "$PROMETHEUS_FULL_IMAGE"      "TEMPFILE"  "PROMETHEUS_"
-doitall "$CONFIGRELOAD_FULL_IMAGE"    "TEMPFILE"  "CONFIGRELOAD_"
-doitall "$GRAFANA_FULL_IMAGE"         "TEMPFILE"  "GRAFANA_"
-doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE"  "SIDECAR_"
+doitall "$PROMOP_FULL_IMAGE" "monitoring/prom-operator_container_image.template"
+doitall "$ALERTMANAGER_FULL_IMAGE" "TEMPFILE" "ALERTMANAGER_"
+doitall "$ADMWEBHOOK_FULL_IMAGE" "TEMPFILE" "ADMWEBHOOK_"
+doitall "$KSM_FULL_IMAGE" "TEMPFILE" "KSM_"
+doitall "$NODEXPORT_FULL_IMAGE" "TEMPFILE" "NODEXPORT_"
+doitall "$PROMETHEUS_FULL_IMAGE" "TEMPFILE" "PROMETHEUS_"
+doitall "$CONFIGRELOAD_FULL_IMAGE" "TEMPFILE" "CONFIGRELOAD_"
+doitall "$GRAFANA_FULL_IMAGE" "TEMPFILE" "GRAFANA_"
+doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE" "SIDECAR_"
 cat $TEMPFILE
 
 #TEMPO_FULL_IMAGE="docker.io/grafana/tempo:2.2.0"
@@ -148,5 +144,3 @@
 #PUSHGATEWAY_FULL_IMAGE="quay.io/prom/pushgateway:v1.6.2"
 doitall "$PUSHGATEWAY_FULL_IMAGE" "monitoring/pushgateway_container_image.template"
 cat $TEMPFILE
-
- 
--- logging/bin/deploy_esexporter.sh.orig
+++ logging/bin/deploy_esexporter.sh
@@ -7,15 +7,15 @@
 source logging/bin/common.sh
 source logging/bin/secrets-include.sh
 
-this_script=`basename "$0"`
+this_script=$(basename "$0")
 
 log_debug "Script [$this_script] has started [$(date)]"
 
 ELASTICSEARCH_EXPORTER_ENABLED=${ELASTICSEARCH_EXPORTER_ENABLED:-true}
 
 if [ "$ELASTICSEARCH_EXPORTER_ENABLED" != "true" ]; then
-  log_verbose "Environment variable [ELASTICSEARCH_EXPORTER_ENABLED] is not set to 'true'; exiting WITHOUT deploying Elasticsearch Exporter"
-  exit
+	log_verbose "Environment variable [ELASTICSEARCH_EXPORTER_ENABLED] is not set to 'true'; exiting WITHOUT deploying Elasticsearch Exporter"
+	exit
 fi
 
 set -e
@@ -29,31 +29,33 @@
 
 # Confirm namespace exists
 if [ "$(kubectl get ns $LOG_NS -o name 2>/dev/null)" == "" ]; then
-  log_error "Namespace [$LOG_NS] does NOT exist."
-  exit 1
+	log_error "Namespace [$LOG_NS] does NOT exist."
+	exit 1
 fi
 
 # get credentials
 get_credentials_from_secret metricgetter
 rc=$?
-if [ "$rc" != "0" ] ;then log_debug "RC=$rc"; exit $rc;fi
+if [ "$rc" != "0" ]; then
+	log_debug "RC=$rc"
+	exit $rc
+fi
 
-
 if helm3ReleaseExists es-exporter $LOG_NS; then
-   #remove an existing instance if it does NOT target OPENSEARCH (i.e. targets ODFE)
-   if [ -z $(kubectl -n $LOG_NS get pods -l "app=prometheus-elasticsearch-exporter,searchbackend=opensearch" -o name 2>/dev/null) ]; then
-      log_debug "Removing an outdated version of Helm release [es-exporter]"
-      helm -n $LOG_NS delete es-exporter
-   fi
+	#remove an existing instance if it does NOT target OPENSEARCH (i.e. targets ODFE)
+	if [ -z $(kubectl -n $LOG_NS get pods -l "app=prometheus-elasticsearch-exporter,searchbackend=opensearch" -o name 2>/dev/null) ]; then
+		log_debug "Removing an outdated version of Helm release [es-exporter]"
+		helm -n $LOG_NS delete es-exporter
+	fi
 else
-   log_debug "No existing Helm release [es-exporter] found."
+	log_debug "No existing Helm release [es-exporter] found."
 fi
 
 # enable debug on Helm via env var
 export HELM_DEBUG="${HELM_DEBUG:-false}"
 
 if [ "$HELM_DEBUG" == "true" ]; then
-  helmDebug="--debug"
+	helmDebug="--debug"
 fi
 
 helmRepoAdd prometheus-community https://prometheus-community.github.io/helm-charts
@@ -67,10 +69,10 @@
 
 ## Check for air gap deployment
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-  source bin/airgap-include.sh
+	source bin/airgap-include.sh
 
-  # Check for the image pull secret for the air gap environment and replace placeholders
-  checkForAirgapSecretInNamespace "$AIRGAP_IMAGE_PULL_SECRET_NAME" "$LOG_NS"
+	# Check for the image pull secret for the air gap environment and replace placeholders
+	checkForAirgapSecretInNamespace "$AIRGAP_IMAGE_PULL_SECRET_NAME" "$LOG_NS"
 ###   replaceAirgapValuesInFiles "logging/airgap/airgap-values-es-exporter.yaml"
 
 ###   airgapValuesFile=$updatedAirgapValuesFile
@@ -79,18 +81,16 @@
 fi
 
 ########
-echo "DDDDDDD"           #DEBUGGING-REMOVE
+echo "DDDDDDD" #DEBUGGING-REMOVE
 doitall "$ES_EXPORTER_FULL_IMAGE" "logging/esexporter/es-exporter_container_image.template"
-cat "$imageKeysFile"     #DEBUGGING-REMOVE
-echo "DDDDDDD"           #DEBUGGING-REMOVE
+cat "$imageKeysFile" #DEBUGGING-REMOVE
+echo "DDDDDDD"       #DEBUGGING-REMOVE
 
-
-
 # Load any user customizations/overrides
 ES_OPEN_EXPORTER_USER_YAML="${ES_OPEN_EXPORTER_USER_YAML:-$USER_DIR/logging/user-values-es-exporter.yaml}"
 if [ ! -f "$ES_OPEN_EXPORTER_USER_YAML" ]; then
-  log_debug "[$ES_OPEN_EXPORTER_USER_YAML] not found. Using $TMP_DIR/empty.yaml"
-  ES_OPEN_EXPORTER_USER_YAML=$TMP_DIR/empty.yaml
+	log_debug "[$ES_OPEN_EXPORTER_USER_YAML] not found. Using $TMP_DIR/empty.yaml"
+	ES_OPEN_EXPORTER_USER_YAML=$TMP_DIR/empty.yaml
 fi
 
 # Enable workload node placement?
@@ -98,42 +98,40 @@
 
 # Optional workload node placement support
 if [ "$LOG_NODE_PLACEMENT_ENABLE" == "true" ]; then
-  log_verbose "Enabling elasticsearch exporter for workload node placement"
-  wnpValuesFile="logging/node-placement/values-elasticsearch-exporter-wnp.yaml"
+	log_verbose "Enabling elasticsearch exporter for workload node placement"
+	wnpValuesFile="logging/node-placement/values-elasticsearch-exporter-wnp.yaml"
 else
-  log_debug "Workload node placement support is disabled for the elasticsearch exporter"
-  wnpValuesFile="$TMP_DIR/empty.yaml"
+	log_debug "Workload node placement support is disabled for the elasticsearch exporter"
+	wnpValuesFile="$TMP_DIR/empty.yaml"
 fi
 
-
 # Point to OpenShift response file or dummy as appropriate
 if [ "$OPENSHIFT_CLUSTER" == "true" ]; then
-  log_verbose "Deploying Elasticsearch metric exporter onto OpenShift cluster"
-  openshiftValuesFile="logging/openshift/values-elasticsearch-exporter.yaml"
+	log_verbose "Deploying Elasticsearch metric exporter onto OpenShift cluster"
+	openshiftValuesFile="logging/openshift/values-elasticsearch-exporter.yaml"
 else
-  log_debug "Elasticsearch metric exporter is NOT being deployed on OpenShift cluster"
-  openshiftValuesFile="$TMP_DIR/empty.yaml"
+	log_debug "Elasticsearch metric exporter is NOT being deployed on OpenShift cluster"
+	openshiftValuesFile="$TMP_DIR/empty.yaml"
 fi
 
 # Elasticsearch metric exporter
 helm2ReleaseCheck es-exporter-$LOG_NS
 
-
 ## Get Helm Chart Name
 log_debug "Elasticsearch Exporter Helm Chart: repo [$ESEXPORTER_HELM_CHART_REPO] name [$ESEXPORTER_HELM_CHART_NAME] version [$ESEXPORTER_HELM_CHART_VERSION]"
 chart2install="$(get_helmchart_reference $ESEXPORTER_HELM_CHART_REPO $ESEXPORTER_HELM_CHART_NAME $ESEXPORTER_HELM_CHART_VERSION)"
 log_debug "Installing Helm chart from artifact [$chart2install]"
 
 helm $helmDebug upgrade --install es-exporter \
- --namespace $LOG_NS \
- --version $ESEXPORTER_HELM_CHART_VERSION \
- -f $imageKeysFile \
- -f $primaryValuesFile \
- -f $wnpValuesFile \
- -f $openshiftValuesFile \
- -f $ES_OPEN_EXPORTER_USER_YAML \
- --set fullnameOverride=v4m-es-exporter  \
- $chart2install
+	--namespace $LOG_NS \
+	--version $ESEXPORTER_HELM_CHART_VERSION \
+	-f $imageKeysFile \
+	-f $primaryValuesFile \
+	-f $wnpValuesFile \
+	-f $openshiftValuesFile \
+	-f $ES_OPEN_EXPORTER_USER_YAML \
+	--set fullnameOverride=v4m-es-exporter \
+	$chart2install
 
 log_info "Elasticsearch metric exporter has been deployed"
 
--- monitoring/bin/deploy_monitoring_cluster.sh.orig
+++ monitoring/bin/deploy_monitoring_cluster.sh
@@ -8,19 +8,19 @@
 source bin/service-url-include.sh
 
 if [ "$OPENSHIFT_CLUSTER" == "true" ]; then
-  if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
-    log_error "This script should not be run on OpenShift clusters"
-    log_error "Run monitoring/bin/deploy_monitoring_openshift.sh instead"
-    exit 1
-  fi
+	if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
+		log_error "This script should not be run on OpenShift clusters"
+		log_error "Run monitoring/bin/deploy_monitoring_openshift.sh instead"
+		exit 1
+	fi
 fi
 
 source bin/tls-include.sh
 if verify_cert_generator $MON_NS prometheus alertmanager grafana; then
-  log_debug "cert generator check OK [$cert_generator_ok]"
+	log_debug "cert generator check OK [$cert_generator_ok]"
 else
-  log_error "One or more required TLS certs do not exist and the expected certificate generator mechanism [$cert_generator] is not available to create the missing certs"
-  exit 1
+	log_error "One or more required TLS certs do not exist and the expected certificate generator mechanism [$cert_generator] is not available to create the missing certs"
+	exit 1
 fi
 
 helm2ReleaseCheck v4m-$MON_NS
@@ -32,26 +32,26 @@
 
 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"
-  PROM_OPER_USER_YAML=$TMP_DIR/empty.yaml
+	log_debug "[$PROM_OPER_USER_YAML] not found. Using $TMP_DIR/empty.yaml"
+	PROM_OPER_USER_YAML=$TMP_DIR/empty.yaml
 fi
 
 if [ "$HELM_DEBUG" == "true" ]; then
-  helmDebug="--debug"
+	helmDebug="--debug"
 fi
 
 if [ -z "$(kubectl get ns $MON_NS -o name 2>/dev/null)" ]; then
-  kubectl create ns $MON_NS
+	kubectl create ns $MON_NS
 
-  #Container Security: Disable serviceAccount Token Automounting
-  disable_sa_token_automount $MON_NS default
+	#Container Security: Disable serviceAccount Token Automounting
+	disable_sa_token_automount $MON_NS default
 fi
 
 if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-  source bin/airgap-include.sh
+	source bin/airgap-include.sh
 
-  # Check for the image pull secret for the air gap environment and replace placeholders
-  checkForAirgapSecretInNamespace "$AIRGAP_IMAGE_PULL_SECRET_NAME" "$MON_NS"
+	# Check for the image pull secret for the air gap environment and replace placeholders
+	checkForAirgapSecretInNamespace "$AIRGAP_IMAGE_PULL_SECRET_NAME" "$MON_NS"
 ###  replaceAirgapValuesInFiles "monitoring/airgap/airgap-values-prom-operator.yaml"
 
 ###  airgapValuesFile=$updatedAirgapValuesFile
@@ -68,20 +68,19 @@
 fi
 
 ######
-echo " DDDDDDDD"      #DEBUGGING-REMOVE
-doitall "$PROMOP_FULL_IMAGE"          "monitoring/prom-operator_container_image.template"
-doitall "$ALERTMANAGER_FULL_IMAGE"    "TEMPFILE"  "ALERTMANAGER_"
-doitall "$ADMWEBHOOK_FULL_IMAGE"      "TEMPFILE"  "ADMWEBHOOK_"
-doitall "$KSM_FULL_IMAGE"             "TEMPFILE"  "KSM_"
-doitall "$NODEXPORT_FULL_IMAGE"       "TEMPFILE"  "NODEXPORT_"
-doitall "$PROMETHEUS_FULL_IMAGE"      "TEMPFILE"  "PROMETHEUS_"
-doitall "$CONFIGRELOAD_FULL_IMAGE"    "TEMPFILE"  "CONFIGRELOAD_"
-doitall "$GRAFANA_FULL_IMAGE"         "TEMPFILE"  "GRAFANA_"
-doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE"  "SIDECAR_"
-cat "$imageKeysFile"  #DEBUGGING-REMOVE
-echo " DDDDDDDD"      #DEBUGGING-REMOVE
+echo " DDDDDDDD" #DEBUGGING-REMOVE
+doitall "$PROMOP_FULL_IMAGE" "monitoring/prom-operator_container_image.template"
+doitall "$ALERTMANAGER_FULL_IMAGE" "TEMPFILE" "ALERTMANAGER_"
+doitall "$ADMWEBHOOK_FULL_IMAGE" "TEMPFILE" "ADMWEBHOOK_"
+doitall "$KSM_FULL_IMAGE" "TEMPFILE" "KSM_"
+doitall "$NODEXPORT_FULL_IMAGE" "TEMPFILE" "NODEXPORT_"
+doitall "$PROMETHEUS_FULL_IMAGE" "TEMPFILE" "PROMETHEUS_"
+doitall "$CONFIGRELOAD_FULL_IMAGE" "TEMPFILE" "CONFIGRELOAD_"
+doitall "$GRAFANA_FULL_IMAGE" "TEMPFILE" "GRAFANA_"
+doitall "$GRAFANA_SIDECAR_FULL_IMAGE" "TEMPFILE" "SIDECAR_"
+cat "$imageKeysFile" #DEBUGGING-REMOVE
+echo " DDDDDDDD"     #DEBUGGING-REMOVE
 
-
 set -e
 log_notice "Deploying monitoring to the [$MON_NS] namespace..."
 
@@ -91,43 +90,43 @@
 istioValuesFile=$TMP_DIR/empty.yaml
 # Istio - Federate data from Istio's Prometheus instance
 if [ "$ISTIO_ENABLED" == "true" ]; then
-  log_verbose "Including Istio metric federation"
-  istioValuesFile=$TMP_DIR/values-prom-operator-tmp.yaml
+	log_verbose "Including Istio metric federation"
+	istioValuesFile=$TMP_DIR/values-prom-operator-tmp.yaml
 else
-  log_debug "ISTIO_ENABLED flag not set"
-  log_debug "Skipping deployment of federated scrape of Istio Prometheus instance"
+	log_debug "ISTIO_ENABLED flag not set"
+	log_debug "Skipping deployment of federated scrape of Istio Prometheus instance"
 fi
 
 # Check if Prometheus Operator CRDs are already installed
 PROM_OPERATOR_CRD_UPDATE=${PROM_OPERATOR_CRD_UPDATE:-true}
 if [ "$PROM_OPERATOR_CRD_UPDATE" == "true" ]; then
-  log_verbose "Updating Prometheus Operator custom resource definitions"
-  crds=( alertmanagerconfigs alertmanagers prometheuses prometheusrules podmonitors servicemonitors thanosrulers probes )
-  for crd in "${crds[@]}"; do
-    
-    ## Determine CRD URL - if in an airgap environment, look for them in USER_DIR.
-    if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-      crdURL=$USER_DIR/monitoring/prometheus-operator-crd/$PROM_OPERATOR_CRD_VERSION/monitoring.coreos.com_$crd.yaml
+	log_verbose "Updating Prometheus Operator custom resource definitions"
+	crds=(alertmanagerconfigs alertmanagers prometheuses prometheusrules podmonitors servicemonitors thanosrulers probes)
+	for crd in "${crds[@]}"; do
 
-      ## Fail if the CRDs could not be located.
-      if [ ! -f "$crdURL" ]; then
-        log_error "Unable to locate file: [monitoring.coreos.com_$crd.yaml] in"
-        log_error "[$USER_DIR/monitoring/prometheus-operator-crd/$PROM_OPERATOR_CRD_VERSION] directory"
-        log_error "Please make sure to provide all Prometheus Operator CRDs before running the deployment"
-        exit 1
-      fi
-    else
-      crdURL="https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/$PROM_OPERATOR_CRD_VERSION/example/prometheus-operator-crd/monitoring.coreos.com_$crd.yaml"
-    fi 
+		## Determine CRD URL - if in an airgap environment, look for them in USER_DIR.
+		if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
+			crdURL=$USER_DIR/monitoring/prometheus-operator-crd/$PROM_OPERATOR_CRD_VERSION/monitoring.coreos.com_$crd.yaml
 
-    if kubectl get crd $crd.monitoring.coreos.com 1>/dev/null 2>&1; then
-      kubectl replace -f $crdURL
-    else
-      kubectl create -f $crdURL
-    fi
-  done
+			## Fail if the CRDs could not be located.
+			if [ ! -f "$crdURL" ]; then
+				log_error "Unable to locate file: [monitoring.coreos.com_$crd.yaml] in"
+				log_error "[$USER_DIR/monitoring/prometheus-operator-crd/$PROM_OPERATOR_CRD_VERSION] directory"
+				log_error "Please make sure to provide all Prometheus Operator CRDs before running the deployment"
+				exit 1
+			fi
+		else
+			crdURL="https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/$PROM_OPERATOR_CRD_VERSION/example/prometheus-operator-crd/monitoring.coreos.com_$crd.yaml"
+		fi
+
+		if kubectl get crd $crd.monitoring.coreos.com 1>/dev/null 2>&1; then
+			kubectl replace -f $crdURL
+		else
+			kubectl create -f $crdURL
+		fi
+	done
 else
-  log_debug "Prometheus Operator CRD update disabled"
+	log_debug "Prometheus Operator CRD update disabled"
 fi
 
 # Remove existing DaemonSets in case of an upgrade-in-place
@@ -136,88 +135,88 @@
 # Optional workload node placement support
 MON_NODE_PLACEMENT_ENABLE=${MON_NODE_PLACEMENT_ENABLE:-${NODE_PLACEMENT_ENABLE:-false}}
 if [ "$MON_NODE_PLACEMENT_ENABLE" == "true" ]; then
-  log_verbose "Enabling monitoring components for workload node placement"
-  wnpValuesFile="monitoring/node-placement/values-prom-operator-wnp.yaml"
+	log_verbose "Enabling monitoring components for workload node placement"
+	wnpValuesFile="monitoring/node-placement/values-prom-operator-wnp.yaml"
 else
-  log_debug "Workload node placement support is disabled"
-  wnpValuesFile="$TMP_DIR/empty.yaml"
+	log_debug "Workload node placement support is disabled"
+	wnpValuesFile="$TMP_DIR/empty.yaml"
 fi
 
 # Optional TLS Support
 tlsValuesFile=$TMP_DIR/empty.yaml
 tlsPromAlertingEndpointFile=$TMP_DIR/empty.yaml
 if [ "$TLS_ENABLE" == "true" ]; then
-  apps=( prometheus alertmanager grafana )
-  create_tls_certs $MON_NS monitoring ${apps[@]}
+	apps=(prometheus alertmanager grafana)
+	create_tls_certs $MON_NS monitoring ${apps[@]}
 
-  tlsValuesFile=monitoring/tls/values-prom-operator-tls.yaml
-  tlsPromAlertingEndpointFile=monitoring/tls/prom-alertendpoint-host-https.yaml
-  log_debug "Including TLS response file $tlsValuesFile"
+	tlsValuesFile=monitoring/tls/values-prom-operator-tls.yaml
+	tlsPromAlertingEndpointFile=monitoring/tls/prom-alertendpoint-host-https.yaml
+	log_debug "Including TLS response file $tlsValuesFile"
 
-  log_verbose "Provisioning TLS-enabled Prometheus datasource for Grafana"
-  grafanaDS=grafana-datasource-prom-https.yaml
-  if [ "$MON_TLS_PATH_INGRESS" == "true" ]; then
-    grafanaDS=grafana-datasource-prom-https-path.yaml
-    tlsPromAlertingEndpointFile=monitoring/tls/prom-alertendpoint-path-https.yaml
-  fi
-  kubectl delete cm -n $MON_NS --ignore-not-found grafana-datasource-prom-https
-  kubectl create cm -n $MON_NS grafana-datasource-prom-https --from-file monitoring/tls/$grafanaDS
-  kubectl label cm -n $MON_NS grafana-datasource-prom-https grafana_datasource=1 sas.com/monitoring-base=kube-viya-monitoring
+	log_verbose "Provisioning TLS-enabled Prometheus datasource for Grafana"
+	grafanaDS=grafana-datasource-prom-https.yaml
+	if [ "$MON_TLS_PATH_INGRESS" == "true" ]; then
+		grafanaDS=grafana-datasource-prom-https-path.yaml
+		tlsPromAlertingEndpointFile=monitoring/tls/prom-alertendpoint-path-https.yaml
+	fi
+	kubectl delete cm -n $MON_NS --ignore-not-found grafana-datasource-prom-https
+	kubectl create cm -n $MON_NS grafana-datasource-prom-https --from-file monitoring/tls/$grafanaDS
+	kubectl label cm -n $MON_NS grafana-datasource-prom-https grafana_datasource=1 sas.com/monitoring-base=kube-viya-monitoring
 
-  # node-exporter TLS
-  log_verbose "Enabling Prometheus node-exporter for TLS"
-  kubectl delete cm -n $MON_NS node-exporter-tls-web-config --ignore-not-found
-  sleep 1
-  kubectl create cm -n $MON_NS node-exporter-tls-web-config --from-file monitoring/tls/node-exporter-web.yaml
-  kubectl label cm -n $MON_NS node-exporter-tls-web-config sas.com/monitoring-base=kube-viya-monitoring
+	# node-exporter TLS
+	log_verbose "Enabling Prometheus node-exporter for TLS"
+	kubectl delete cm -n $MON_NS node-exporter-tls-web-config --ignore-not-found
+	sleep 1
+	kubectl create cm -n $MON_NS node-exporter-tls-web-config --from-file monitoring/tls/node-exporter-web.yaml
+	kubectl label cm -n $MON_NS node-exporter-tls-web-config sas.com/monitoring-base=kube-viya-monitoring
 fi
 
 nodePortValuesFile=$TMP_DIR/empty.yaml
 PROM_NODEPORT_ENABLE=${PROM_NODEPORT_ENABLE:-false}
 if [ "$PROM_NODEPORT_ENABLE" == "true" ]; then
-  log_debug "Enabling NodePort access for Prometheus and Alertmanager"
-  nodePortValuesFile=monitoring/values-prom-nodeport.yaml
+	log_debug "Enabling NodePort access for Prometheus and Alertmanager"
+	nodePortValuesFile=monitoring/values-prom-nodeport.yaml
 fi
 
 if helm3ReleaseExists prometheus-operator $MON_NS; then
-  promRelease=prometheus-operator
-  promName=prometheus-operator
+	promRelease=prometheus-operator
+	promName=prometheus-operator
 else
-  promRelease=v4m-prometheus-operator
-  promName=v4m
+	promRelease=v4m-prometheus-operator
+	promName=v4m
 fi
 log_verbose "User response file: [$PROM_OPER_USER_YAML]"
 log_info "Deploying the kube-prometheus stack. This may take a few minutes ..."
 if helm3ReleaseExists $promRelease $MON_NS; then
-  log_verbose "Upgrading via Helm ($(date) - timeout 20m)"
+	log_verbose "Upgrading via Helm ($(date) - timeout 20m)"
 else
-  grafanaPwd="$GRAFANA_ADMIN_PASSWORD"
-  if [ "$grafanaPwd" == "" ]; then
-    log_debug "Generating random Grafana admin password"
-    showPass="true"
-    grafanaPwd="$(randomPassword)"
-  fi
-  log_verbose "Installing via Helm ($(date) - timeout 20m)"
+	grafanaPwd="$GRAFANA_ADMIN_PASSWORD"
+	if [ "$grafanaPwd" == "" ]; then
+		log_debug "Generating random Grafana admin password"
+		showPass="true"
+		grafanaPwd="$(randomPassword)"
+	fi
+	log_verbose "Installing via Helm ($(date) - timeout 20m)"
 fi
 
 # See https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#from-21x-to-22x
-if [ "$V4M_CURRENT_VERSION_MAJOR" == "1" ] && [[ "$V4M_CURRENT_VERSION_MINOR" =~ [0-5] ]]; then
-  kubectl delete -n $MON_NS --ignore-not-found \
-    deployments.apps \
-    -l app.kubernetes.io/instance=v4m-prometheus-operator,app.kubernetes.io/name=kube-state-metrics
+if [ "$V4M_CURRENT_VERSION_MAJOR" == "1" ] && [[ $V4M_CURRENT_VERSION_MINOR =~ [0-5] ]]; then
+	kubectl delete -n $MON_NS --ignore-not-found \
+		deployments.apps \
+		-l app.kubernetes.io/instance=v4m-prometheus-operator,app.kubernetes.io/name=kube-state-metrics
 fi
 
 TRACING_ENABLE="${TRACING_ENABLE:-false}"
 if [ "$TRACING_ENABLE" == "false" ]; then
-  tempoDSFile=$TMP_DIR/empty.yaml
+	tempoDSFile=$TMP_DIR/empty.yaml
 else
-  TEMPO_USER_YAML="${TEMPO_USER_YAML:-$USER_DIR/monitoring/user-values-tempo.yaml}"
-  if [ ! -f "$TEMPO_USER_YAML" ]; then
-    log_debug "[$TEMPO_USER_YAML] not found. Using $TMP_DIR/empty.yaml"
-    TEMPO_USER_YAML=$TMP_DIR/empty.yaml
-  fi
-  tempoDSFile="monitoring/grafana-datasource-tempo.yaml"
-fi 
+	TEMPO_USER_YAML="${TEMPO_USER_YAML:-$USER_DIR/monitoring/user-values-tempo.yaml}"
+	if [ ! -f "$TEMPO_USER_YAML" ]; then
+		log_debug "[$TEMPO_USER_YAML] not found. Using $TMP_DIR/empty.yaml"
+		TEMPO_USER_YAML=$TMP_DIR/empty.yaml
+	fi
+	tempoDSFile="monitoring/grafana-datasource-tempo.yaml"
+fi
 
 # Get Helm Chart Name
 log_debug "Kube-Prometheus Stack Helm Chart: repo [$KUBE_PROM_STACK_CHART_REPO] name [$KUBE_PROM_STACK_CHART_NAME] version [$KUBE_PROM_STACK_CHART_VERSION]"
@@ -225,39 +224,39 @@
 log_debug "Installing Helm chart from artifact [$chart2install]"
 
 helm $helmDebug upgrade --install $promRelease \
-  --namespace $MON_NS \
-  -f $imageKeysFile \
-  -f monitoring/values-prom-operator.yaml \
-  -f $istioValuesFile \
-  -f $tlsValuesFile \
-  -f $tlsPromAlertingEndpointFile \
-  -f $nodePortValuesFile \
-  -f $wnpValuesFile \
-  -f $PROM_OPER_USER_YAML \
-  -f $tempoDSFile \
-  --atomic \
-  --timeout 20m \
-  --set nameOverride=$promName \
-  --set fullnameOverride=$promName \
-  --set prometheus-node-exporter.fullnameOverride=$promName-node-exporter \
-  --set kube-state-metrics.fullnameOverride=$promName-kube-state-metrics \
-  --set grafana.fullnameOverride=$promName-grafana \
-  --set grafana.adminPassword="$grafanaPwd" \
-  --set prometheus.prometheusSpec.alertingEndpoints[0].namespace="$MON_NS" \
-  --version $KUBE_PROM_STACK_CHART_VERSION \
-  $chart2install
+	--namespace $MON_NS \
+	-f $imageKeysFile \
+	-f monitoring/values-prom-operator.yaml \
+	-f $istioValuesFile \
+	-f $tlsValuesFile \
+	-f $tlsPromAlertingEndpointFile \
+	-f $nodePortValuesFile \
+	-f $wnpValuesFile \
+	-f $PROM_OPER_USER_YAML \
+	-f $tempoDSFile \
+	--atomic \
+	--timeout 20m \
+	--set nameOverride=$promName \
+	--set fullnameOverride=$promName \
+	--set prometheus-node-exporter.fullnameOverride=$promName-node-exporter \
+	--set kube-state-metrics.fullnameOverride=$promName-kube-state-metrics \
+	--set grafana.fullnameOverride=$promName-grafana \
+	--set grafana.adminPassword="$grafanaPwd" \
+	--set prometheus.prometheusSpec.alertingEndpoints[0].namespace="$MON_NS" \
+	--version $KUBE_PROM_STACK_CHART_VERSION \
+	$chart2install
 
 sleep 2
 
 if [ "$TLS_ENABLE" == "true" ]; then
-  log_verbose "Patching Grafana ServiceMonitor for TLS"
-  kubectl patch servicemonitor -n $MON_NS $promName-grafana --type=json \
-    -p='[{"op": "replace", "path": "/spec/endpoints/0/scheme", "value":"https"},{"op": "replace", "path": "/spec/endpoints/0/tlsConfig", "value":{}},{"op": "replace", "path": "/spec/endpoints/0/tlsConfig/insecureSkipVerify", "value":true}]'
+	log_verbose "Patching Grafana ServiceMonitor for TLS"
+	kubectl patch servicemonitor -n $MON_NS $promName-grafana --type=json \
+		-p='[{"op": "replace", "path": "/spec/endpoints/0/scheme", "value":"https"},{"op": "replace", "path": "/spec/endpoints/0/tlsConfig", "value":{}},{"op": "replace", "path": "/spec/endpoints/0/tlsConfig/insecureSkipVerify", "value":true}]'
 fi
 
 #Container Security: Disable serviceAccount Token Automounting
 disable_sa_token_automount $MON_NS v4m-grafana
-disable_sa_token_automount $MON_NS sas-ops-acct      #Used w/Prometheus
+disable_sa_token_automount $MON_NS sas-ops-acct #Used w/Prometheus
 disable_sa_token_automount $MON_NS v4m-node-exporter
 disable_sa_token_automount $MON_NS v4m-alertmanager
 
@@ -271,57 +270,57 @@
 log_verbose "Deploying cluster ServiceMonitors"
 
 if [ "$TRACING_ENABLE" == "true" ]; then
-  log_info "Tracing enabled..."
+	log_info "Tracing enabled..."
 
-  ## Check for air gap deployment
-  if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
-    source bin/airgap-include.sh
+	## Check for air gap deployment
+	if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
+		source bin/airgap-include.sh
 
-    # Check for the image pull secret for the air gap environment and replace placeholders
-    checkForAirgapSecretInNamespace "$AIRGAP_IMAGE_PULL_SECRET_NAME" "$MON_NS"
-###    replaceAirgapValuesInFiles "monitoring/airgap/airgap-tempo-values.yaml"
-###
-###    airgapValuesFile=$updatedAirgapValuesFile
-###  else
-###    airgapValuesFile=$TMP_DIR/empty.yaml
-  fi
+		# Check for the image pull secret for the air gap environment and replace placeholders
+		checkForAirgapSecretInNamespace "$AIRGAP_IMAGE_PULL_SECRET_NAME" "$MON_NS"
+		###    replaceAirgapValuesInFiles "monitoring/airgap/airgap-tempo-values.yaml"
+		###
+		###    airgapValuesFile=$updatedAirgapValuesFile
+		###  else
+		###    airgapValuesFile=$TMP_DIR/empty.yaml
+	fi
 
-  ######
-  echo " DDDDDDDD"      #DEBUGGING-REMOVE
-  doitall "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
-  cat "$imageKeysFile"  #DEBUGGING-REMOVE
-  echo " DDDDDDDD"      #DEBUGGING-REMOVE
+	######
+	echo " DDDDDDDD" #DEBUGGING-REMOVE
+	doitall "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
+	cat "$imageKeysFile" #DEBUGGING-REMOVE
+	echo " DDDDDDDD"     #DEBUGGING-REMOVE
 
-  # Add the grafana helm chart repo
-  helmRepoAdd grafana https://grafana.github.io/helm-charts
-  helm repo update
+	# Add the grafana helm chart repo
+	helmRepoAdd grafana https://grafana.github.io/helm-charts
+	helm repo update
 
-  # Get Helm Chart Name
-  log_debug "Tempo Helm Chart: repo [$TEMPO_CHART_REPO] name [$TEMPO_CHART_NAME] version [$TEMPO_CHART_VERSION]"
-  chart2install="$(get_helmchart_reference $TEMPO_CHART_REPO $TEMPO_CHART_NAME $TEMPO_CHART_VERSION)"
-  log_debug "Installing Helm chart from artifact [$chart2install]"
+	# Get Helm Chart Name
+	log_debug "Tempo Helm Chart: repo [$TEMPO_CHART_REPO] name [$TEMPO_CHART_NAME] version [$TEMPO_CHART_VERSION]"
+	chart2install="$(get_helmchart_reference $TEMPO_CHART_REPO $TEMPO_CHART_NAME $TEMPO_CHART_VERSION)"
+	log_debug "Installing Helm chart from artifact [$chart2install]"
 
-  log_info "Installing tempo"
-  helm upgrade --install v4m-tempo \
-    -n "$MON_NS" \
-    -f $imageKeysFile \
-    -f monitoring/values-tempo.yaml \
-    -f "$TEMPO_USER_YAML" \
-    --version "$TEMPO_CHART_VERSION" \
-    $chart2install
+	log_info "Installing tempo"
+	helm upgrade --install v4m-tempo \
+		-n "$MON_NS" \
+		-f $imageKeysFile \
+		-f monitoring/values-tempo.yaml \
+		-f "$TEMPO_USER_YAML" \
+		--version "$TEMPO_CHART_VERSION" \
+		$chart2install
 fi
 
 # NGINX
 set +e
 kubectl get ns $NGINX_NS 2>/dev/null
 if [ $? == 0 ]; then
-  nginxFound=true
+	nginxFound=true
 fi
 set -e
 
 if [ "$nginxFound" == "true" ]; then
-  log_verbose "NGINX found. Deploying podMonitor to [$NGINX_NS] namespace"
-  kubectl apply -n $NGINX_NS -f monitoring/monitors/kube/podMonitor-nginx.yaml 2>/dev/null
+	log_verbose "NGINX found. Deploying podMonitor to [$NGINX_NS] namespace"
+	kubectl apply -n $NGINX_NS -f monitoring/monitors/kube/podMonitor-nginx.yaml 2>/dev/null
 fi
 
 # Eventrouter ServiceMonitor
@@ -337,25 +336,25 @@
 # Rules
 log_verbose "Adding Prometheus recording rules"
 for f in monitoring/rules/viya/rules-*.yaml; do
-  kubectl apply -n $MON_NS -f $f
+	kubectl apply -n $MON_NS -f $f
 done
 
 # Elasticsearch Datasource for Grafana
 LOGGING_DATASOURCE="${LOGGING_DATASOURCE:-false}"
 if [ "$LOGGING_DATASOURCE" == "true" ]; then
-  set +e
-  log_debug "Creating the logging data source using the create_logging_datasource script"
-  monitoring/bin/create_logging_datasource.sh
+	set +e
+	log_debug "Creating the logging data source using the create_logging_datasource script"
+	monitoring/bin/create_logging_datasource.sh
 
-  if (( $? == 1 )); then
-    log_warn "Unable to configure the logging data source at this time."
-    log_warn "Please address the errors and re-run the follow command to create the data source at a later time:"
-    log_warn "monitoring/bin/create_logging_datasource.sh"
-  fi
-  set -e
+	if (($? == 1)); then
+		log_warn "Unable to configure the logging data source at this time."
+		log_warn "Please address the errors and re-run the follow command to create the data source at a later time:"
+		log_warn "monitoring/bin/create_logging_datasource.sh"
+	fi
+	set -e
 else
-  log_debug "LOGGING_DATASOURCE not set"
-  log_debug "Skipping creation of logging data source for Grafana"
+	log_debug "LOGGING_DATASOURCE not set"
+	log_debug "Skipping creation of logging data source for Grafana"
 fi
 
 echo ""
@@ -366,32 +365,32 @@
 get_ingress_ports
 
 # get URLs for Grafana, Prometheus and AlertManager
-gf_url=$(get_service_url $MON_NS v4m-grafana  "$TLS_ENABLE")
+gf_url=$(get_service_url $MON_NS v4m-grafana "$TLS_ENABLE")
 # pr_url=$(get_url $MON_NS v4m-prometheus  "$TLS_ENABLE")
 # am_url=$(get_url $MON_NS v4m-alertmanager  "$TLS_ENABLE")
 set -e
 
 # If a deployment with the old name exists, remove it first
 if helm3ReleaseExists v4m $MON_NS; then
-  log_verbose "Removing outdated SAS Viya Monitoring Helm chart release from [$MON_NS] namespace"
-  helm uninstall -n "$MON_NS" "v4m"
+	log_verbose "Removing outdated SAS Viya Monitoring Helm chart release from [$MON_NS] namespace"
+	helm uninstall -n "$MON_NS" "v4m"
 fi
 
 if ! deployV4MInfo "$MON_NS" "v4m-metrics"; then
-  log_warn "Unable to update SAS Viya Monitoring Helm chart release"
+	log_warn "Unable to update SAS Viya Monitoring Helm chart release"
 fi
 
 # Print URL to access web apps
 log_notice ""
 log_notice "GRAFANA: "
 if [ ! -z "$gf_url" ]; then
-   log_notice "  $gf_url"
+	log_notice "  $gf_url"
 else
-   log_notice " It was not possible to determine the URL needed to access Grafana. Note  "
-   log_notice " that this is not necessarily a sign of a problem; it may only reflect an "
-   log_notice " ingress or network access configuration that this script does not handle."
+	log_notice " It was not possible to determine the URL needed to access Grafana. Note  "
+	log_notice " that this is not necessarily a sign of a problem; it may only reflect an "
+	log_notice " ingress or network access configuration that this script does not handle."
 fi
-   log_notice ""
+log_notice ""
 
 #log_notice ""
 #log_notice "================================================================================"
@@ -414,14 +413,12 @@
 #log_notice ""
 
 if [ "$showPass" == "true" ]; then
-  # Find the grafana pod
- 
-  log_notice " Generated Grafana admin password is: $grafanaPwd"
-  log_notice " To change the password, run the following script (replace myNewPassword with an updated password):"
-  log_notice " monitoring/bin/change_grafana_admin_password.sh -p myNewPassword"
+	# Find the grafana pod
+
+	log_notice " Generated Grafana admin password is: $grafanaPwd"
+	log_notice " To change the password, run the following script (replace myNewPassword with an updated password):"
+	log_notice " monitoring/bin/change_grafana_admin_password.sh -p myNewPassword"
 fi
 
 log_message ""
 log_notice " Successfully deployed components to the [$MON_NS] namespace"
-
-
----------

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

  shfmt -s -w filename


@gsmith-sas
Copy link
Member Author

Abandoning this PR since it was only part of a research effort. The actual implementation is being handled in a separate PR (superseded by #605).

@gsmith-sas gsmith-sas closed this Jan 31, 2024
@gsmith-sas gsmith-sas deleted the containerimg branch January 31, 2024 22:53
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.

1 participant