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

[FIX] Update deploy_monitoring_openshift.sh for OCP 4.16+ #672

Merged
merged 6 commits into from
Sep 12, 2024

Conversation

gsmith-sas
Copy link
Member

No description provided.

@gsmith-sas gsmith-sas requested a review from ceelias August 28, 2024 19:31
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 monitoring/bin/deploy_monitoring_openshift.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_openshift.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_openshift.sh line 24:
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_openshift.sh line 25:
  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_openshift.sh line 28:
  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_openshift.sh line 29:
  disable_sa_token_automount $MON_NS builder
                             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  disable_sa_token_automount "$MON_NS" builder


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

Did you mean: 
  disable_sa_token_automount "$MON_NS" deployer


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 80:
  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create serviceaccount -n "$MON_NS" grafana-serviceaccount


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 85:
  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create serviceaccount -n "$MON_NS" grafana-serviceaccount


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 92:
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n $MON_NS
                                                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n "$MON_NS"


In monitoring/bin/deploy_monitoring_openshift.sh line 100:
    token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')
                                ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    token=$(kubectl describe -n "$MON_NS" serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')


In monitoring/bin/deploy_monitoring_openshift.sh line 102:
    kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
               ^-----^ 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 "$MON_NS" patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'"$token"'"}}]'


In monitoring/bin/deploy_monitoring_openshift.sh line 110:
   grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 600s)
                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   grafanaToken=$(oc create token grafana-serviceaccount -n "$MON_NS" --duration 600s)


In monitoring/bin/deploy_monitoring_openshift.sh line 112:
   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
                                                                         ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n "$MON_NS")


In monitoring/bin/deploy_monitoring_openshift.sh line 129:
cp monitoring/openshift/grafana-values.yaml $grafanaYAML
                                            ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cp monitoring/openshift/grafana-values.yaml "$grafanaYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 131:
  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
                                                 ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" "$grafanaYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 133:
  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
                                              ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" "$grafanaYAML"


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 155:
generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE"   "$imageKeysFile"  "SIDECAR_"
                                                       ^------------^ SC2154 (warning): imageKeysFile is referenced but not assigned.


In monitoring/bin/deploy_monitoring_openshift.sh line 165:
  kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/v4m-grafana-svc.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 197:
chart2install="$(get_helmchart_reference $OPENSHIFT_GRAFANA_CHART_REPO $OPENSHIFT_GRAFANA_CHART_NAME $OPENSHIFT_GRAFANA_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 "$OPENSHIFT_GRAFANA_CHART_REPO" "$OPENSHIFT_GRAFANA_CHART_NAME" "$OPENSHIFT_GRAFANA_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_openshift.sh line 198:
versionstring="$(get_helm_versionstring $OPENSHIFT_GRAFANA_CHART_VERSION)"
                                        ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
versionstring="$(get_helm_versionstring "$OPENSHIFT_GRAFANA_CHART_VERSION")"


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

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


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

Did you mean: 
  -f "$tempoDSFile" \


In monitoring/bin/deploy_monitoring_openshift.sh line 209:
  --set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
                                     ^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --set 'grafana\.ini'.server.domain="$OPENSHIFT_ROUTE_DOMAIN" \


In monitoring/bin/deploy_monitoring_openshift.sh line 210:
  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
                                                           ^-----^ 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: 
  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-"$MON_NS"."$OPENSHIFT_ROUTE_DOMAIN""$OPENSHIFT_ROUTE_PATH_GRAFANA" \


In monitoring/bin/deploy_monitoring_openshift.sh line 212:
  $versionstring \
  ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$versionstring" \


In monitoring/bin/deploy_monitoring_openshift.sh line 214:
  $grafanaPwd \
  ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$grafanaPwd" \


In monitoring/bin/deploy_monitoring_openshift.sh line 215:
  $extraArgs \
  ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$extraArgs" \


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

Did you mean: 
  "$chart2install"


In monitoring/bin/deploy_monitoring_openshift.sh line 222:
  kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
                                     ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl annotate serviceaccount -n "$MON_NS" --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'


In monitoring/bin/deploy_monitoring_openshift.sh line 226:
  cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
                                                              ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  cp monitoring/openshift/grafana-serviceaccount-binding.yaml "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 228:
    sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
                                       ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    sed -i '' "s/__MON_NS__/$MON_NS/g" "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 230:
    sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
                                    ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    sed -i "s/__MON_NS__/$MON_NS/g" "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 233:
  kubectl apply -f $crbYAML
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -f "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 235:
  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/grafana-proxy-secret.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 245:
    cp $imageKeysFile $grafanaProxyPatchYAML
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                      ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

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


In monitoring/bin/deploy_monitoring_openshift.sh line 252:
    cp $imageKeysFile $grafanaProxyPatchYAML
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                      ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

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


In monitoring/bin/deploy_monitoring_openshift.sh line 256:
  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/grafana-trusted-ca-bundle.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 259:
  kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl annotate service -n "$MON_NS" --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'


In monitoring/bin/deploy_monitoring_openshift.sh line 262:
  kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                 ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl patch deployment -n "$MON_NS" v4m-grafana --patch "$(cat "$grafanaProxyPatchYAML")"


In monitoring/bin/deploy_monitoring_openshift.sh line 273:
  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_openshift.sh line 281:
if ! kubectl get route -n $MON_NS v4m-grafana 1>/dev/null 2>&1; then
                          ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if ! kubectl get route -n "$MON_NS" v4m-grafana 1>/dev/null 2>&1; then


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

Did you mean: 
      -n "$MON_NS" \


In monitoring/bin/deploy_monitoring_openshift.sh line 288:
      --path $OPENSHIFT_ROUTE_PATH_GRAFANA
             ^---------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      --path "$OPENSHIFT_ROUTE_PATH_GRAFANA"


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

Did you mean: 
      -n "$MON_NS" \


In monitoring/bin/deploy_monitoring_openshift.sh line 305:
  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_openshift.sh line 306:
  versionstring="$(get_helm_versionstring $TEMPO_CHART_VERSION)"
                                          ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  versionstring="$(get_helm_versionstring "$TEMPO_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_openshift.sh line 315:
    $versionstring \
    ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    "$versionstring" \


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

Did you mean: 
    "$chart2install"


In monitoring/bin/deploy_monitoring_openshift.sh line 320:
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_openshift.sh line 329:
scheme="https"
^----^ SC2034 (warning): scheme appears unused. Verify use (or export if used externally).


In monitoring/bin/deploy_monitoring_openshift.sh line 334:
      log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
                                                                                     ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it.
                                                                                                          ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it.

For more information:
  https://www.shellcheck.net/wiki/SC1083 -- This { is literal. Check expressi...
  https://www.shellcheck.net/wiki/SC2034 -- scheme appears unused. Verify use...
  https://www.shellcheck.net/wiki/SC2128 -- Expanding an array without an ind...
----------

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:

----------
--- monitoring/bin/deploy_monitoring_openshift.sh.orig
+++ monitoring/bin/deploy_monitoring_openshift.sh
@@ -7,27 +7,27 @@
 source monitoring/bin/common.sh
 
 if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
-  if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
-    log_error "This script should only be run on OpenShift clusters"
-    log_error "Run monitoring/bin/deploy_monitoring_cluster.sh instead"
-    exit 1
-  fi
+	if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
+		log_error "This script should only be run on OpenShift clusters"
+		log_error "Run monitoring/bin/deploy_monitoring_cluster.sh instead"
+		exit 1
+	fi
 fi
 
 checkDefaultStorageClass
 
 export HELM_DEBUG="${HELM_DEBUG:-false}"
 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
-  disable_sa_token_automount $MON_NS builder
-  disable_sa_token_automount $MON_NS deployer
+	#Container Security: Disable serviceAccount Token Automounting
+	disable_sa_token_automount $MON_NS default
+	disable_sa_token_automount $MON_NS builder
+	disable_sa_token_automount $MON_NS deployer
 
 fi
 
@@ -40,49 +40,49 @@
 helm repo update
 
 if kubectl get cm -n openshift-monitoring cluster-monitoring-config 1>/dev/null 2>&1; then
-  log_debug "Configmap [openshift-monitoring/cluster-monitoring-config] exists"
-  log_debug "The configmap may need to be modified to enable user workload monitoring"
+	log_debug "Configmap [openshift-monitoring/cluster-monitoring-config] exists"
+	log_debug "The configmap may need to be modified to enable user workload monitoring"
 else
-  log_info "Enabling OpenShift user workload monitoring..."
-  kubectl apply -f monitoring/openshift/cluster-monitoring-config.yaml
-  log_info "Waiting 30 seconds for pods to deploy..."
-  sleep 30
+	log_info "Enabling OpenShift user workload monitoring..."
+	kubectl apply -f monitoring/openshift/cluster-monitoring-config.yaml
+	log_info "Waiting 30 seconds for pods to deploy..."
+	sleep 30
 fi
 
 # TODO: Retries + fail?
 if [ -n "$(kubectl get po -n openshift-user-workload-monitoring 2>/dev/null)" ]; then
-  log_debug "User workload monitoring is ready"
+	log_debug "User workload monitoring is ready"
 else
-  log_warn "User workload monitoring pods not detected in the openshift-user-workload-monitoring namespace"
-  log_warn "Ensure that user workload monitoring is enabled"
+	log_warn "User workload monitoring pods not detected in the openshift-user-workload-monitoring namespace"
+	log_warn "Ensure that user workload monitoring is enabled"
 fi
 
 # Elasticsearch Datasource for Grafana
 LOGGING_DATASOURCE="${LOGGING_DATASOURCE:-false}"
 if [ "$LOGGING_DATASOURCE" == "true" ]; then
-  set +e
-  log_debug "Creating the logging datasource 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
+	set +e
+	log_debug "Creating the logging datasource 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
 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
 
 log_info "Enabling Grafana to access OpenShift Prometheus instances..."
 if [ -z "$(kubectl get serviceAccount -n $MON_NS grafana-serviceaccount -o name 2>/dev/null)" ]; then
-  log_info "Creating Grafana serviceAccount..."
-  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
+	log_info "Creating Grafana serviceAccount..."
+	kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
 fi
 
 if [ -z "$(kubectl get serviceAccount -n $MON_NS grafana-serviceaccount -o name 2>/dev/null)" ]; then
-  log_info "Creating Grafana serviceAccount..."
-  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
+	log_info "Creating Grafana serviceAccount..."
+	kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
 fi
 
 #Container Security: Disable serviceAccount Token Automounting
@@ -91,103 +91,101 @@
 log_debug "Adding cluster role..."
 oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n $MON_NS
 
-if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "10" ] && [ "$OSHIFT_MINOR_VERSION" -lt "16" ] ; then
+if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "10" ] && [ "$OSHIFT_MINOR_VERSION" -lt "16" ]; then
 
-    # OCP versions 4.11-4.15: We need to patch service account to add API Token
+	# OCP versions 4.11-4.15: We need to patch service account to add API Token
 
-    # NOTE: $token below is the *name* of the Kubernetes secret
-    #       containing the autogenerated serviceaccount token
-    token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')
-    log_debug "Patching serviceAccount to link to token...[$token]"
-    kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
+	# NOTE: $token below is the *name* of the Kubernetes secret
+	#       containing the autogenerated serviceaccount token
+	token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount | grep "Tokens:" | awk '{print $2}')
+	log_debug "Patching serviceAccount to link to token...[$token]"
+	kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
 fi
 
 log_debug "Obtaining token..."
 # NOTE: $grafanaToken is an actual token and NOT the name of a k8s resouce
 if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "15" ]; then
-   # OCP 4.16: removed deprecated oc serviceaccounts get-token command
-   # NOTE: 12000 hours = 500 days although OpenShift *may* expire token after 12 months
-   grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 600s)
+	# OCP 4.16: removed deprecated oc serviceaccounts get-token command
+	# NOTE: 12000 hours = 500 days although OpenShift *may* expire token after 12 months
+	grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 600s)
 else
-   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
+	grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
 fi
 
 if [ "$grafanaToken" == "" ]; then
-  log_error "Unable to obtain authentication token for [grafana-serviceaccount]"
-  exit 1
+	log_error "Unable to obtain authentication token for [grafana-serviceaccount]"
+	exit 1
 fi
 
 log_info "Deploying monitoring components for OpenShift..."
 userGrafanaYAML=$TMP_DIR/empty.yaml
 if [ -f "$USER_DIR/monitoring/user-values-openshift-grafana.yaml" ]; then
-  userGrafanaYAML="$USER_DIR/monitoring/user-values-openshift-grafana.yaml"
-  log_debug "User response file for Grafana found at [$userGrafanaYAML]"
+	userGrafanaYAML="$USER_DIR/monitoring/user-values-openshift-grafana.yaml"
+	log_debug "User response file for Grafana found at [$userGrafanaYAML]"
 fi
 
 # Access token to OpenShift Prometheus instances
 grafanaYAML=$TMP_DIR/grafana-values.yaml
 cp monitoring/openshift/grafana-values.yaml $grafanaYAML
-if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
+if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+	sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
 else
-  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
+	sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
 fi
 
 if ! helm3ReleaseExists v4m-grafana $MON_NS; then
-  firstTimeGrafana=true
+	firstTimeGrafana=true
 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"
+	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
 
-
 #Generate yaml file with all container-related keys
-generateImageKeysFile "$GRAFANA_FULL_IMAGE"     "monitoring/openshift/grafana_container_image.template"
-generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE"   "$imageKeysFile"  "SIDECAR_"
+generateImageKeysFile "$GRAFANA_FULL_IMAGE" "monitoring/openshift/grafana_container_image.template"
+generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE" "$imageKeysFile" "SIDECAR_"
 
-
 OPENSHIFT_AUTH_ENABLE=${OPENSHIFT_AUTH_ENABLE:-true}
 if [ "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  grafanaAuthYAML="monitoring/openshift/grafana-proxy-values.yaml"
-  extraArgs="--set service.targetPort=3001"
+	grafanaAuthYAML="monitoring/openshift/grafana-proxy-values.yaml"
+	extraArgs="--set service.targetPort=3001"
 else
-  grafanaAuthYAML="monitoring/openshift/grafana-tls-only-values.yaml"
-  log_debug "Creating the Grafana service to generate TLS certs..."
-  kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
-  log_debug "Sleeping 5 sec..."
-  sleep 5
+	grafanaAuthYAML="monitoring/openshift/grafana-tls-only-values.yaml"
+	log_debug "Creating the Grafana service to generate TLS certs..."
+	kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
+	log_debug "Sleeping 5 sec..."
+	sleep 5
 fi
 
 if [ -n "$GRAFANA_ADMIN_PASSWORD" ]; then
-  grafanaPwd="--set adminPassword=$GRAFANA_ADMIN_PASSWORD"
+	grafanaPwd="--set adminPassword=$GRAFANA_ADMIN_PASSWORD"
 fi
 
 # 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_info "Enabling monitoring components for workload node placement"
-  wnpValuesFile="monitoring/node-placement/values-grafana-wnp.yaml"
+	log_info "Enabling monitoring components for workload node placement"
+	wnpValuesFile="monitoring/node-placement/values-grafana-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
 
 if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-  OPENSHIFT_ROUTE_PATH_GRAFANA=${OPENSHIFT_ROUTE_PATH_GRAFANA:-/grafana}
+	OPENSHIFT_ROUTE_PATH_GRAFANA=${OPENSHIFT_ROUTE_PATH_GRAFANA:-/grafana}
 fi
 if [ "$OPENSHIFT_ROUTE_PATH_GRAFANA" != "" ] && [ "$OPENSHIFT_ROUTE_PATH_GRAFANA" != "/" ]; then
-  grafanaSubPath="true"
+	grafanaSubPath="true"
 else
-  grafanaSubPath="false"
+	grafanaSubPath="false"
 fi
 
 log_info "Deploying Grafana..."
@@ -199,141 +197,141 @@
 log_debug "Installing Helm chart from artifact [$chart2install]"
 
 helm upgrade --install $helmDebug \
-  -n "$MON_NS" \
-  -f "$imageKeysFile" \
-  -f "$wnpValuesFile" \
-  -f "$grafanaYAML" \
-  -f "$grafanaAuthYAML" \
-  -f "$userGrafanaYAML" \
-  -f $tempoDSFile \
-  --set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
-  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
-  --set 'grafana\.ini'.server.serve_from_sub_path=$grafanaSubPath \
-  $versionstring \
-  --atomic \
-  $grafanaPwd \
-  $extraArgs \
-  v4m-grafana \
-  $chart2install
+	-n "$MON_NS" \
+	-f "$imageKeysFile" \
+	-f "$wnpValuesFile" \
+	-f "$grafanaYAML" \
+	-f "$grafanaAuthYAML" \
+	-f "$userGrafanaYAML" \
+	-f $tempoDSFile \
+	--set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
+	--set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
+	--set 'grafana\.ini'.server.serve_from_sub_path=$grafanaSubPath \
+	$versionstring \
+	--atomic \
+	$grafanaPwd \
+	$extraArgs \
+	v4m-grafana \
+	$chart2install
 
 if [ "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  log_info "Using OpenShift authentication for Grafana"
-  log_debug "Annotating grafana-serviceaccount to auto-generate TLS certs..."
-  kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
+	log_info "Using OpenShift authentication for Grafana"
+	log_debug "Annotating grafana-serviceaccount to auto-generate TLS certs..."
+	kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
 
-  log_debug "Adding ClusterRoleBinding for grafana-serviceaccount..."
-  crbYAML=$TMP_DIR/grafana-serviceaccount-binding.yaml
-  cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
-  if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-    sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
-  else
-    sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
-  fi
+	log_debug "Adding ClusterRoleBinding for grafana-serviceaccount..."
+	crbYAML=$TMP_DIR/grafana-serviceaccount-binding.yaml
+	cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
+	else
+		sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
+	fi
 
-  kubectl apply -f $crbYAML
+	kubectl apply -f $crbYAML
 
-  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
-  
-  grafanaProxyPatchYAML=$TMP_DIR/grafana-proxy-patch.yaml
+	kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
 
-  if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-    log_debug "Using path-based version of the OpenShift Grafana proxy patch"
+	grafanaProxyPatchYAML=$TMP_DIR/grafana-proxy-patch.yaml
 
-    #Generate yaml file with all container-related keys
-    generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-path.template"
+	if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
+		log_debug "Using path-based version of the OpenShift Grafana proxy patch"
 
-    cp $imageKeysFile $grafanaProxyPatchYAML
-  else
-    log_debug "Using host-based version of the OpenShift Grafana proxy patch"
+		#Generate yaml file with all container-related keys
+		generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-path.template"
 
-    #Generate yaml file with all container-related keys
-    generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-host.template"
+		cp $imageKeysFile $grafanaProxyPatchYAML
+	else
+		log_debug "Using host-based version of the OpenShift Grafana proxy patch"
 
-    cp $imageKeysFile $grafanaProxyPatchYAML
-  fi
-    
-  log_debug "Deploying CA bundle..."
-  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
-  
-  log_info "Patching Grafana service for auto-generated TLS certs"
-  kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
+		#Generate yaml file with all container-related keys
+		generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-host.template"
 
-  log_info "Patching Grafana pod with authenticating TLS proxy..."
-  kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
+		cp $imageKeysFile $grafanaProxyPatchYAML
+	fi
+
+	log_debug "Deploying CA bundle..."
+	kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
+
+	log_info "Patching Grafana service for auto-generated TLS certs"
+	kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
+
+	log_info "Patching Grafana pod with authenticating TLS proxy..."
+	kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
 else
-  log_info "Using native Grafana authentication"
+	log_info "Using native Grafana authentication"
 fi
 
 log_info "Deploying SAS Viya Grafana dashboards..."
 DASH_NS=$MON_NS LOGGING_DASH=${LOGGING_DASH:-false} KUBE_DASH=${KUBE_DASH:-false} NGINX_DASH=${NGINX_DASH:-false} \
-  monitoring/bin/deploy_dashboards.sh
+	monitoring/bin/deploy_dashboards.sh
 
 log_info "Adding SAS Viya 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
 
 if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-  routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
+	routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
 else
-  routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
+	routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
 fi
 if ! kubectl get route -n $MON_NS v4m-grafana 1>/dev/null 2>&1; then
-  log_info "Exposing Grafana service as a route..."
-  if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-    oc create route reencrypt \
-      -n $MON_NS \
-      --service v4m-grafana \
-      --hostname "$routeHost" \
-      --path $OPENSHIFT_ROUTE_PATH_GRAFANA
-  else
-    oc create route reencrypt \
-      -n $MON_NS \
-      --service v4m-grafana \
-      --hostname "$routeHost"
-  fi
+	log_info "Exposing Grafana service as a route..."
+	if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
+		oc create route reencrypt \
+			-n $MON_NS \
+			--service v4m-grafana \
+			--hostname "$routeHost" \
+			--path $OPENSHIFT_ROUTE_PATH_GRAFANA
+	else
+		oc create route reencrypt \
+			-n $MON_NS \
+			--service v4m-grafana \
+			--hostname "$routeHost"
+	fi
 fi
 
 if [ "$TRACING_ENABLE" == "true" ]; then
-  log_info "Tracing enabled..."
+	log_info "Tracing enabled..."
 
-  #Generate yaml file with all container-related keys
-  generateImageKeysFile "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
+	#Generate yaml file with all container-related keys
+	generateImageKeysFile "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
 
-  # 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)"
-  versionstring="$(get_helm_versionstring $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)"
+	versionstring="$(get_helm_versionstring $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/openshift/tempo-values.yaml \
-    -f "$TEMPO_USER_YAML" \
-    $versionstring \
-    $chart2install
+	log_info "Installing tempo"
+	helm upgrade --install v4m-tempo \
+		-n "$MON_NS" \
+		-f "$imageKeysFile" \
+		-f monitoring/openshift/tempo-values.yaml \
+		-f "$TEMPO_USER_YAML" \
+		$versionstring \
+		$chart2install
 fi
 
 # 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
 
 scheme="https"
 if [ ! "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  if [ "$firstTimeGrafana" == "true" ]; then
-    if [ -z "$GRAFANA_ADMIN_PASSWORD" ]; then
-      log_notice "Obtain the inital Grafana password by running:"
-      log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
-    fi
-  fi
+	if [ "$firstTimeGrafana" == "true" ]; then
+		if [ -z "$GRAFANA_ADMIN_PASSWORD" ]; then
+			log_notice "Obtain the inital Grafana password by running:"
+			log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
+		fi
+	fi
 fi
 bin/show_app_url.sh GRAFANA
 # log_notice "Grafana URL: $scheme://$(kubectl get route -n $MON_NS v4m-grafana -o jsonpath='{.spec.host}{.spec.path}')"
----------

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 monitoring/bin/deploy_monitoring_openshift.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_openshift.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_openshift.sh line 24:
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_openshift.sh line 25:
  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_openshift.sh line 28:
  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_openshift.sh line 29:
  disable_sa_token_automount $MON_NS builder
                             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  disable_sa_token_automount "$MON_NS" builder


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

Did you mean: 
  disable_sa_token_automount "$MON_NS" deployer


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 80:
  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create serviceaccount -n "$MON_NS" grafana-serviceaccount


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 85:
  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create serviceaccount -n "$MON_NS" grafana-serviceaccount


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 92:
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n $MON_NS
                                                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n "$MON_NS"


In monitoring/bin/deploy_monitoring_openshift.sh line 100:
    token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')
                                ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    token=$(kubectl describe -n "$MON_NS" serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')


In monitoring/bin/deploy_monitoring_openshift.sh line 102:
    kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
               ^-----^ 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 "$MON_NS" patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'"$token"'"}}]'


In monitoring/bin/deploy_monitoring_openshift.sh line 110:
   grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 600s)
                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   grafanaToken=$(oc create token grafana-serviceaccount -n "$MON_NS" --duration 600s)


In monitoring/bin/deploy_monitoring_openshift.sh line 112:
   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
                                                                         ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n "$MON_NS")


In monitoring/bin/deploy_monitoring_openshift.sh line 129:
cp monitoring/openshift/grafana-values.yaml $grafanaYAML
                                            ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cp monitoring/openshift/grafana-values.yaml "$grafanaYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 131:
  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
                                                 ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" "$grafanaYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 133:
  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
                                              ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" "$grafanaYAML"


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 155:
generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE"   "$imageKeysFile"  "SIDECAR_"
                                                       ^------------^ SC2154 (warning): imageKeysFile is referenced but not assigned.


In monitoring/bin/deploy_monitoring_openshift.sh line 165:
  kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/v4m-grafana-svc.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 197:
chart2install="$(get_helmchart_reference $OPENSHIFT_GRAFANA_CHART_REPO $OPENSHIFT_GRAFANA_CHART_NAME $OPENSHIFT_GRAFANA_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 "$OPENSHIFT_GRAFANA_CHART_REPO" "$OPENSHIFT_GRAFANA_CHART_NAME" "$OPENSHIFT_GRAFANA_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_openshift.sh line 198:
versionstring="$(get_helm_versionstring $OPENSHIFT_GRAFANA_CHART_VERSION)"
                                        ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
versionstring="$(get_helm_versionstring "$OPENSHIFT_GRAFANA_CHART_VERSION")"


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

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


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

Did you mean: 
  -f "$tempoDSFile" \


In monitoring/bin/deploy_monitoring_openshift.sh line 209:
  --set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
                                     ^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --set 'grafana\.ini'.server.domain="$OPENSHIFT_ROUTE_DOMAIN" \


In monitoring/bin/deploy_monitoring_openshift.sh line 210:
  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
                                                           ^-----^ 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: 
  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-"$MON_NS"."$OPENSHIFT_ROUTE_DOMAIN""$OPENSHIFT_ROUTE_PATH_GRAFANA" \


In monitoring/bin/deploy_monitoring_openshift.sh line 212:
  $versionstring \
  ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$versionstring" \


In monitoring/bin/deploy_monitoring_openshift.sh line 214:
  $grafanaPwd \
  ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$grafanaPwd" \


In monitoring/bin/deploy_monitoring_openshift.sh line 215:
  $extraArgs \
  ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$extraArgs" \


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

Did you mean: 
  "$chart2install"


In monitoring/bin/deploy_monitoring_openshift.sh line 222:
  kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
                                     ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl annotate serviceaccount -n "$MON_NS" --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'


In monitoring/bin/deploy_monitoring_openshift.sh line 226:
  cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
                                                              ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  cp monitoring/openshift/grafana-serviceaccount-binding.yaml "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 228:
    sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
                                       ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    sed -i '' "s/__MON_NS__/$MON_NS/g" "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 230:
    sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
                                    ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    sed -i "s/__MON_NS__/$MON_NS/g" "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 233:
  kubectl apply -f $crbYAML
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -f "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 235:
  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/grafana-proxy-secret.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 245:
    cp $imageKeysFile $grafanaProxyPatchYAML
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                      ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

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


In monitoring/bin/deploy_monitoring_openshift.sh line 252:
    cp $imageKeysFile $grafanaProxyPatchYAML
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                      ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

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


In monitoring/bin/deploy_monitoring_openshift.sh line 256:
  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/grafana-trusted-ca-bundle.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 259:
  kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl annotate service -n "$MON_NS" --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'


In monitoring/bin/deploy_monitoring_openshift.sh line 262:
  kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                 ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl patch deployment -n "$MON_NS" v4m-grafana --patch "$(cat "$grafanaProxyPatchYAML")"


In monitoring/bin/deploy_monitoring_openshift.sh line 273:
  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_openshift.sh line 281:
if ! kubectl get route -n $MON_NS v4m-grafana 1>/dev/null 2>&1; then
                          ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if ! kubectl get route -n "$MON_NS" v4m-grafana 1>/dev/null 2>&1; then


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

Did you mean: 
      -n "$MON_NS" \


In monitoring/bin/deploy_monitoring_openshift.sh line 288:
      --path $OPENSHIFT_ROUTE_PATH_GRAFANA
             ^---------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      --path "$OPENSHIFT_ROUTE_PATH_GRAFANA"


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

Did you mean: 
      -n "$MON_NS" \


In monitoring/bin/deploy_monitoring_openshift.sh line 305:
  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_openshift.sh line 306:
  versionstring="$(get_helm_versionstring $TEMPO_CHART_VERSION)"
                                          ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  versionstring="$(get_helm_versionstring "$TEMPO_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_openshift.sh line 315:
    $versionstring \
    ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    "$versionstring" \


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

Did you mean: 
    "$chart2install"


In monitoring/bin/deploy_monitoring_openshift.sh line 320:
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_openshift.sh line 329:
scheme="https"
^----^ SC2034 (warning): scheme appears unused. Verify use (or export if used externally).


In monitoring/bin/deploy_monitoring_openshift.sh line 334:
      log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
                                                                                     ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it.
                                                                                                          ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it.

For more information:
  https://www.shellcheck.net/wiki/SC1083 -- This { is literal. Check expressi...
  https://www.shellcheck.net/wiki/SC2034 -- scheme appears unused. Verify use...
  https://www.shellcheck.net/wiki/SC2128 -- Expanding an array without an ind...
----------

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:

----------
--- monitoring/bin/deploy_monitoring_openshift.sh.orig
+++ monitoring/bin/deploy_monitoring_openshift.sh
@@ -7,27 +7,27 @@
 source monitoring/bin/common.sh
 
 if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
-  if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
-    log_error "This script should only be run on OpenShift clusters"
-    log_error "Run monitoring/bin/deploy_monitoring_cluster.sh instead"
-    exit 1
-  fi
+	if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
+		log_error "This script should only be run on OpenShift clusters"
+		log_error "Run monitoring/bin/deploy_monitoring_cluster.sh instead"
+		exit 1
+	fi
 fi
 
 checkDefaultStorageClass
 
 export HELM_DEBUG="${HELM_DEBUG:-false}"
 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
-  disable_sa_token_automount $MON_NS builder
-  disable_sa_token_automount $MON_NS deployer
+	#Container Security: Disable serviceAccount Token Automounting
+	disable_sa_token_automount $MON_NS default
+	disable_sa_token_automount $MON_NS builder
+	disable_sa_token_automount $MON_NS deployer
 
 fi
 
@@ -40,49 +40,49 @@
 helm repo update
 
 if kubectl get cm -n openshift-monitoring cluster-monitoring-config 1>/dev/null 2>&1; then
-  log_debug "Configmap [openshift-monitoring/cluster-monitoring-config] exists"
-  log_debug "The configmap may need to be modified to enable user workload monitoring"
+	log_debug "Configmap [openshift-monitoring/cluster-monitoring-config] exists"
+	log_debug "The configmap may need to be modified to enable user workload monitoring"
 else
-  log_info "Enabling OpenShift user workload monitoring..."
-  kubectl apply -f monitoring/openshift/cluster-monitoring-config.yaml
-  log_info "Waiting 30 seconds for pods to deploy..."
-  sleep 30
+	log_info "Enabling OpenShift user workload monitoring..."
+	kubectl apply -f monitoring/openshift/cluster-monitoring-config.yaml
+	log_info "Waiting 30 seconds for pods to deploy..."
+	sleep 30
 fi
 
 # TODO: Retries + fail?
 if [ -n "$(kubectl get po -n openshift-user-workload-monitoring 2>/dev/null)" ]; then
-  log_debug "User workload monitoring is ready"
+	log_debug "User workload monitoring is ready"
 else
-  log_warn "User workload monitoring pods not detected in the openshift-user-workload-monitoring namespace"
-  log_warn "Ensure that user workload monitoring is enabled"
+	log_warn "User workload monitoring pods not detected in the openshift-user-workload-monitoring namespace"
+	log_warn "Ensure that user workload monitoring is enabled"
 fi
 
 # Elasticsearch Datasource for Grafana
 LOGGING_DATASOURCE="${LOGGING_DATASOURCE:-false}"
 if [ "$LOGGING_DATASOURCE" == "true" ]; then
-  set +e
-  log_debug "Creating the logging datasource 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
+	set +e
+	log_debug "Creating the logging datasource 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
 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
 
 log_info "Enabling Grafana to access OpenShift Prometheus instances..."
 if [ -z "$(kubectl get serviceAccount -n $MON_NS grafana-serviceaccount -o name 2>/dev/null)" ]; then
-  log_info "Creating Grafana serviceAccount..."
-  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
+	log_info "Creating Grafana serviceAccount..."
+	kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
 fi
 
 if [ -z "$(kubectl get serviceAccount -n $MON_NS grafana-serviceaccount -o name 2>/dev/null)" ]; then
-  log_info "Creating Grafana serviceAccount..."
-  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
+	log_info "Creating Grafana serviceAccount..."
+	kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
 fi
 
 #Container Security: Disable serviceAccount Token Automounting
@@ -91,103 +91,101 @@
 log_debug "Adding cluster role..."
 oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n $MON_NS
 
-if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "10" ] && [ "$OSHIFT_MINOR_VERSION" -lt "16" ] ; then
+if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "10" ] && [ "$OSHIFT_MINOR_VERSION" -lt "16" ]; then
 
-    # OCP versions 4.11-4.15: We need to patch service account to add API Token
+	# OCP versions 4.11-4.15: We need to patch service account to add API Token
 
-    # NOTE: $token below is the *name* of the Kubernetes secret
-    #       containing the autogenerated serviceaccount token
-    token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')
-    log_debug "Patching serviceAccount to link to token...[$token]"
-    kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
+	# NOTE: $token below is the *name* of the Kubernetes secret
+	#       containing the autogenerated serviceaccount token
+	token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount | grep "Tokens:" | awk '{print $2}')
+	log_debug "Patching serviceAccount to link to token...[$token]"
+	kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
 fi
 
 log_debug "Obtaining token..."
 # NOTE: $grafanaToken is an actual token and NOT the name of a k8s resouce
 if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "15" ]; then
-   # OCP 4.16: removed deprecated oc serviceaccounts get-token command
-   # NOTE: 12000 hours = 500 days although OpenShift *may* expire token after 12 months
-   grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 600s)
+	# OCP 4.16: removed deprecated oc serviceaccounts get-token command
+	# NOTE: 12000 hours = 500 days although OpenShift *may* expire token after 12 months
+	grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 600s)
 else
-   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
+	grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
 fi
 
 if [ "$grafanaToken" == "" ]; then
-  log_error "Unable to obtain authentication token for [grafana-serviceaccount]"
-  exit 1
+	log_error "Unable to obtain authentication token for [grafana-serviceaccount]"
+	exit 1
 fi
 
 log_info "Deploying monitoring components for OpenShift..."
 userGrafanaYAML=$TMP_DIR/empty.yaml
 if [ -f "$USER_DIR/monitoring/user-values-openshift-grafana.yaml" ]; then
-  userGrafanaYAML="$USER_DIR/monitoring/user-values-openshift-grafana.yaml"
-  log_debug "User response file for Grafana found at [$userGrafanaYAML]"
+	userGrafanaYAML="$USER_DIR/monitoring/user-values-openshift-grafana.yaml"
+	log_debug "User response file for Grafana found at [$userGrafanaYAML]"
 fi
 
 # Access token to OpenShift Prometheus instances
 grafanaYAML=$TMP_DIR/grafana-values.yaml
 cp monitoring/openshift/grafana-values.yaml $grafanaYAML
-if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
+if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+	sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
 else
-  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
+	sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
 fi
 
 if ! helm3ReleaseExists v4m-grafana $MON_NS; then
-  firstTimeGrafana=true
+	firstTimeGrafana=true
 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"
+	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
 
-
 #Generate yaml file with all container-related keys
-generateImageKeysFile "$GRAFANA_FULL_IMAGE"     "monitoring/openshift/grafana_container_image.template"
-generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE"   "$imageKeysFile"  "SIDECAR_"
+generateImageKeysFile "$GRAFANA_FULL_IMAGE" "monitoring/openshift/grafana_container_image.template"
+generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE" "$imageKeysFile" "SIDECAR_"
 
-
 OPENSHIFT_AUTH_ENABLE=${OPENSHIFT_AUTH_ENABLE:-true}
 if [ "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  grafanaAuthYAML="monitoring/openshift/grafana-proxy-values.yaml"
-  extraArgs="--set service.targetPort=3001"
+	grafanaAuthYAML="monitoring/openshift/grafana-proxy-values.yaml"
+	extraArgs="--set service.targetPort=3001"
 else
-  grafanaAuthYAML="monitoring/openshift/grafana-tls-only-values.yaml"
-  log_debug "Creating the Grafana service to generate TLS certs..."
-  kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
-  log_debug "Sleeping 5 sec..."
-  sleep 5
+	grafanaAuthYAML="monitoring/openshift/grafana-tls-only-values.yaml"
+	log_debug "Creating the Grafana service to generate TLS certs..."
+	kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
+	log_debug "Sleeping 5 sec..."
+	sleep 5
 fi
 
 if [ -n "$GRAFANA_ADMIN_PASSWORD" ]; then
-  grafanaPwd="--set adminPassword=$GRAFANA_ADMIN_PASSWORD"
+	grafanaPwd="--set adminPassword=$GRAFANA_ADMIN_PASSWORD"
 fi
 
 # 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_info "Enabling monitoring components for workload node placement"
-  wnpValuesFile="monitoring/node-placement/values-grafana-wnp.yaml"
+	log_info "Enabling monitoring components for workload node placement"
+	wnpValuesFile="monitoring/node-placement/values-grafana-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
 
 if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-  OPENSHIFT_ROUTE_PATH_GRAFANA=${OPENSHIFT_ROUTE_PATH_GRAFANA:-/grafana}
+	OPENSHIFT_ROUTE_PATH_GRAFANA=${OPENSHIFT_ROUTE_PATH_GRAFANA:-/grafana}
 fi
 if [ "$OPENSHIFT_ROUTE_PATH_GRAFANA" != "" ] && [ "$OPENSHIFT_ROUTE_PATH_GRAFANA" != "/" ]; then
-  grafanaSubPath="true"
+	grafanaSubPath="true"
 else
-  grafanaSubPath="false"
+	grafanaSubPath="false"
 fi
 
 log_info "Deploying Grafana..."
@@ -199,141 +197,141 @@
 log_debug "Installing Helm chart from artifact [$chart2install]"
 
 helm upgrade --install $helmDebug \
-  -n "$MON_NS" \
-  -f "$imageKeysFile" \
-  -f "$wnpValuesFile" \
-  -f "$grafanaYAML" \
-  -f "$grafanaAuthYAML" \
-  -f "$userGrafanaYAML" \
-  -f $tempoDSFile \
-  --set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
-  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
-  --set 'grafana\.ini'.server.serve_from_sub_path=$grafanaSubPath \
-  $versionstring \
-  --atomic \
-  $grafanaPwd \
-  $extraArgs \
-  v4m-grafana \
-  $chart2install
+	-n "$MON_NS" \
+	-f "$imageKeysFile" \
+	-f "$wnpValuesFile" \
+	-f "$grafanaYAML" \
+	-f "$grafanaAuthYAML" \
+	-f "$userGrafanaYAML" \
+	-f $tempoDSFile \
+	--set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
+	--set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
+	--set 'grafana\.ini'.server.serve_from_sub_path=$grafanaSubPath \
+	$versionstring \
+	--atomic \
+	$grafanaPwd \
+	$extraArgs \
+	v4m-grafana \
+	$chart2install
 
 if [ "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  log_info "Using OpenShift authentication for Grafana"
-  log_debug "Annotating grafana-serviceaccount to auto-generate TLS certs..."
-  kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
+	log_info "Using OpenShift authentication for Grafana"
+	log_debug "Annotating grafana-serviceaccount to auto-generate TLS certs..."
+	kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
 
-  log_debug "Adding ClusterRoleBinding for grafana-serviceaccount..."
-  crbYAML=$TMP_DIR/grafana-serviceaccount-binding.yaml
-  cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
-  if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-    sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
-  else
-    sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
-  fi
+	log_debug "Adding ClusterRoleBinding for grafana-serviceaccount..."
+	crbYAML=$TMP_DIR/grafana-serviceaccount-binding.yaml
+	cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
+	else
+		sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
+	fi
 
-  kubectl apply -f $crbYAML
+	kubectl apply -f $crbYAML
 
-  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
-  
-  grafanaProxyPatchYAML=$TMP_DIR/grafana-proxy-patch.yaml
+	kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
 
-  if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-    log_debug "Using path-based version of the OpenShift Grafana proxy patch"
+	grafanaProxyPatchYAML=$TMP_DIR/grafana-proxy-patch.yaml
 
-    #Generate yaml file with all container-related keys
-    generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-path.template"
+	if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
+		log_debug "Using path-based version of the OpenShift Grafana proxy patch"
 
-    cp $imageKeysFile $grafanaProxyPatchYAML
-  else
-    log_debug "Using host-based version of the OpenShift Grafana proxy patch"
+		#Generate yaml file with all container-related keys
+		generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-path.template"
 
-    #Generate yaml file with all container-related keys
-    generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-host.template"
+		cp $imageKeysFile $grafanaProxyPatchYAML
+	else
+		log_debug "Using host-based version of the OpenShift Grafana proxy patch"
 
-    cp $imageKeysFile $grafanaProxyPatchYAML
-  fi
-    
-  log_debug "Deploying CA bundle..."
-  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
-  
-  log_info "Patching Grafana service for auto-generated TLS certs"
-  kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
+		#Generate yaml file with all container-related keys
+		generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-host.template"
 
-  log_info "Patching Grafana pod with authenticating TLS proxy..."
-  kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
+		cp $imageKeysFile $grafanaProxyPatchYAML
+	fi
+
+	log_debug "Deploying CA bundle..."
+	kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
+
+	log_info "Patching Grafana service for auto-generated TLS certs"
+	kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
+
+	log_info "Patching Grafana pod with authenticating TLS proxy..."
+	kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
 else
-  log_info "Using native Grafana authentication"
+	log_info "Using native Grafana authentication"
 fi
 
 log_info "Deploying SAS Viya Grafana dashboards..."
 DASH_NS=$MON_NS LOGGING_DASH=${LOGGING_DASH:-false} KUBE_DASH=${KUBE_DASH:-false} NGINX_DASH=${NGINX_DASH:-false} \
-  monitoring/bin/deploy_dashboards.sh
+	monitoring/bin/deploy_dashboards.sh
 
 log_info "Adding SAS Viya 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
 
 if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-  routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
+	routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
 else
-  routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
+	routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
 fi
 if ! kubectl get route -n $MON_NS v4m-grafana 1>/dev/null 2>&1; then
-  log_info "Exposing Grafana service as a route..."
-  if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-    oc create route reencrypt \
-      -n $MON_NS \
-      --service v4m-grafana \
-      --hostname "$routeHost" \
-      --path $OPENSHIFT_ROUTE_PATH_GRAFANA
-  else
-    oc create route reencrypt \
-      -n $MON_NS \
-      --service v4m-grafana \
-      --hostname "$routeHost"
-  fi
+	log_info "Exposing Grafana service as a route..."
+	if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
+		oc create route reencrypt \
+			-n $MON_NS \
+			--service v4m-grafana \
+			--hostname "$routeHost" \
+			--path $OPENSHIFT_ROUTE_PATH_GRAFANA
+	else
+		oc create route reencrypt \
+			-n $MON_NS \
+			--service v4m-grafana \
+			--hostname "$routeHost"
+	fi
 fi
 
 if [ "$TRACING_ENABLE" == "true" ]; then
-  log_info "Tracing enabled..."
+	log_info "Tracing enabled..."
 
-  #Generate yaml file with all container-related keys
-  generateImageKeysFile "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
+	#Generate yaml file with all container-related keys
+	generateImageKeysFile "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
 
-  # 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)"
-  versionstring="$(get_helm_versionstring $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)"
+	versionstring="$(get_helm_versionstring $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/openshift/tempo-values.yaml \
-    -f "$TEMPO_USER_YAML" \
-    $versionstring \
-    $chart2install
+	log_info "Installing tempo"
+	helm upgrade --install v4m-tempo \
+		-n "$MON_NS" \
+		-f "$imageKeysFile" \
+		-f monitoring/openshift/tempo-values.yaml \
+		-f "$TEMPO_USER_YAML" \
+		$versionstring \
+		$chart2install
 fi
 
 # 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
 
 scheme="https"
 if [ ! "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  if [ "$firstTimeGrafana" == "true" ]; then
-    if [ -z "$GRAFANA_ADMIN_PASSWORD" ]; then
-      log_notice "Obtain the inital Grafana password by running:"
-      log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
-    fi
-  fi
+	if [ "$firstTimeGrafana" == "true" ]; then
+		if [ -z "$GRAFANA_ADMIN_PASSWORD" ]; then
+			log_notice "Obtain the inital Grafana password by running:"
+			log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
+		fi
+	fi
 fi
 bin/show_app_url.sh GRAFANA
 # log_notice "Grafana URL: $scheme://$(kubectl get route -n $MON_NS v4m-grafana -o jsonpath='{.spec.host}{.spec.path}')"
----------

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 monitoring/bin/deploy_monitoring_openshift.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_openshift.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_openshift.sh line 24:
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_openshift.sh line 25:
  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_openshift.sh line 28:
  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_openshift.sh line 29:
  disable_sa_token_automount $MON_NS builder
                             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  disable_sa_token_automount "$MON_NS" builder


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

Did you mean: 
  disable_sa_token_automount "$MON_NS" deployer


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 80:
  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create serviceaccount -n "$MON_NS" grafana-serviceaccount


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 85:
  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create serviceaccount -n "$MON_NS" grafana-serviceaccount


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 92:
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n $MON_NS
                                                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n "$MON_NS"


In monitoring/bin/deploy_monitoring_openshift.sh line 100:
    token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')
                                ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    token=$(kubectl describe -n "$MON_NS" serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')


In monitoring/bin/deploy_monitoring_openshift.sh line 102:
    kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
               ^-----^ 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 "$MON_NS" patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'"$token"'"}}]'


In monitoring/bin/deploy_monitoring_openshift.sh line 110:
   grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 600s)
                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   grafanaToken=$(oc create token grafana-serviceaccount -n "$MON_NS" --duration 600s)


In monitoring/bin/deploy_monitoring_openshift.sh line 112:
   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
                                                                         ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n "$MON_NS")


In monitoring/bin/deploy_monitoring_openshift.sh line 129:
cp monitoring/openshift/grafana-values.yaml $grafanaYAML
                                            ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cp monitoring/openshift/grafana-values.yaml "$grafanaYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 131:
  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
                                                 ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" "$grafanaYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 133:
  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
                                              ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" "$grafanaYAML"


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 155:
generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE"   "$imageKeysFile"  "SIDECAR_"
                                                       ^------------^ SC2154 (warning): imageKeysFile is referenced but not assigned.


In monitoring/bin/deploy_monitoring_openshift.sh line 165:
  kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/v4m-grafana-svc.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 197:
chart2install="$(get_helmchart_reference $OPENSHIFT_GRAFANA_CHART_REPO $OPENSHIFT_GRAFANA_CHART_NAME $OPENSHIFT_GRAFANA_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 "$OPENSHIFT_GRAFANA_CHART_REPO" "$OPENSHIFT_GRAFANA_CHART_NAME" "$OPENSHIFT_GRAFANA_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_openshift.sh line 198:
versionstring="$(get_helm_versionstring $OPENSHIFT_GRAFANA_CHART_VERSION)"
                                        ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
versionstring="$(get_helm_versionstring "$OPENSHIFT_GRAFANA_CHART_VERSION")"


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

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


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

Did you mean: 
  -f "$tempoDSFile" \


In monitoring/bin/deploy_monitoring_openshift.sh line 209:
  --set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
                                     ^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --set 'grafana\.ini'.server.domain="$OPENSHIFT_ROUTE_DOMAIN" \


In monitoring/bin/deploy_monitoring_openshift.sh line 210:
  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
                                                           ^-----^ 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: 
  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-"$MON_NS"."$OPENSHIFT_ROUTE_DOMAIN""$OPENSHIFT_ROUTE_PATH_GRAFANA" \


In monitoring/bin/deploy_monitoring_openshift.sh line 212:
  $versionstring \
  ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$versionstring" \


In monitoring/bin/deploy_monitoring_openshift.sh line 214:
  $grafanaPwd \
  ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$grafanaPwd" \


In monitoring/bin/deploy_monitoring_openshift.sh line 215:
  $extraArgs \
  ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$extraArgs" \


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

Did you mean: 
  "$chart2install"


In monitoring/bin/deploy_monitoring_openshift.sh line 222:
  kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
                                     ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl annotate serviceaccount -n "$MON_NS" --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'


In monitoring/bin/deploy_monitoring_openshift.sh line 226:
  cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
                                                              ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  cp monitoring/openshift/grafana-serviceaccount-binding.yaml "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 228:
    sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
                                       ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    sed -i '' "s/__MON_NS__/$MON_NS/g" "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 230:
    sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
                                    ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    sed -i "s/__MON_NS__/$MON_NS/g" "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 233:
  kubectl apply -f $crbYAML
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -f "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 235:
  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/grafana-proxy-secret.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 245:
    cp $imageKeysFile $grafanaProxyPatchYAML
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                      ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

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


In monitoring/bin/deploy_monitoring_openshift.sh line 252:
    cp $imageKeysFile $grafanaProxyPatchYAML
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                      ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

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


In monitoring/bin/deploy_monitoring_openshift.sh line 256:
  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/grafana-trusted-ca-bundle.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 259:
  kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl annotate service -n "$MON_NS" --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'


In monitoring/bin/deploy_monitoring_openshift.sh line 262:
  kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                 ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl patch deployment -n "$MON_NS" v4m-grafana --patch "$(cat "$grafanaProxyPatchYAML")"


In monitoring/bin/deploy_monitoring_openshift.sh line 273:
  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_openshift.sh line 281:
if ! kubectl get route -n $MON_NS v4m-grafana 1>/dev/null 2>&1; then
                          ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if ! kubectl get route -n "$MON_NS" v4m-grafana 1>/dev/null 2>&1; then


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

Did you mean: 
      -n "$MON_NS" \


In monitoring/bin/deploy_monitoring_openshift.sh line 288:
      --path $OPENSHIFT_ROUTE_PATH_GRAFANA
             ^---------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      --path "$OPENSHIFT_ROUTE_PATH_GRAFANA"


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

Did you mean: 
      -n "$MON_NS" \


In monitoring/bin/deploy_monitoring_openshift.sh line 305:
  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_openshift.sh line 306:
  versionstring="$(get_helm_versionstring $TEMPO_CHART_VERSION)"
                                          ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  versionstring="$(get_helm_versionstring "$TEMPO_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_openshift.sh line 315:
    $versionstring \
    ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    "$versionstring" \


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

Did you mean: 
    "$chart2install"


In monitoring/bin/deploy_monitoring_openshift.sh line 320:
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_openshift.sh line 329:
scheme="https"
^----^ SC2034 (warning): scheme appears unused. Verify use (or export if used externally).


In monitoring/bin/deploy_monitoring_openshift.sh line 334:
      log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
                                                                                     ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it.
                                                                                                          ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it.

For more information:
  https://www.shellcheck.net/wiki/SC1083 -- This { is literal. Check expressi...
  https://www.shellcheck.net/wiki/SC2034 -- scheme appears unused. Verify use...
  https://www.shellcheck.net/wiki/SC2128 -- Expanding an array without an ind...
----------

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:

----------
--- monitoring/bin/deploy_monitoring_openshift.sh.orig
+++ monitoring/bin/deploy_monitoring_openshift.sh
@@ -7,27 +7,27 @@
 source monitoring/bin/common.sh
 
 if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
-  if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
-    log_error "This script should only be run on OpenShift clusters"
-    log_error "Run monitoring/bin/deploy_monitoring_cluster.sh instead"
-    exit 1
-  fi
+	if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
+		log_error "This script should only be run on OpenShift clusters"
+		log_error "Run monitoring/bin/deploy_monitoring_cluster.sh instead"
+		exit 1
+	fi
 fi
 
 checkDefaultStorageClass
 
 export HELM_DEBUG="${HELM_DEBUG:-false}"
 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
-  disable_sa_token_automount $MON_NS builder
-  disable_sa_token_automount $MON_NS deployer
+	#Container Security: Disable serviceAccount Token Automounting
+	disable_sa_token_automount $MON_NS default
+	disable_sa_token_automount $MON_NS builder
+	disable_sa_token_automount $MON_NS deployer
 
 fi
 
@@ -40,49 +40,49 @@
 helm repo update
 
 if kubectl get cm -n openshift-monitoring cluster-monitoring-config 1>/dev/null 2>&1; then
-  log_debug "Configmap [openshift-monitoring/cluster-monitoring-config] exists"
-  log_debug "The configmap may need to be modified to enable user workload monitoring"
+	log_debug "Configmap [openshift-monitoring/cluster-monitoring-config] exists"
+	log_debug "The configmap may need to be modified to enable user workload monitoring"
 else
-  log_info "Enabling OpenShift user workload monitoring..."
-  kubectl apply -f monitoring/openshift/cluster-monitoring-config.yaml
-  log_info "Waiting 30 seconds for pods to deploy..."
-  sleep 30
+	log_info "Enabling OpenShift user workload monitoring..."
+	kubectl apply -f monitoring/openshift/cluster-monitoring-config.yaml
+	log_info "Waiting 30 seconds for pods to deploy..."
+	sleep 30
 fi
 
 # TODO: Retries + fail?
 if [ -n "$(kubectl get po -n openshift-user-workload-monitoring 2>/dev/null)" ]; then
-  log_debug "User workload monitoring is ready"
+	log_debug "User workload monitoring is ready"
 else
-  log_warn "User workload monitoring pods not detected in the openshift-user-workload-monitoring namespace"
-  log_warn "Ensure that user workload monitoring is enabled"
+	log_warn "User workload monitoring pods not detected in the openshift-user-workload-monitoring namespace"
+	log_warn "Ensure that user workload monitoring is enabled"
 fi
 
 # Elasticsearch Datasource for Grafana
 LOGGING_DATASOURCE="${LOGGING_DATASOURCE:-false}"
 if [ "$LOGGING_DATASOURCE" == "true" ]; then
-  set +e
-  log_debug "Creating the logging datasource 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
+	set +e
+	log_debug "Creating the logging datasource 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
 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
 
 log_info "Enabling Grafana to access OpenShift Prometheus instances..."
 if [ -z "$(kubectl get serviceAccount -n $MON_NS grafana-serviceaccount -o name 2>/dev/null)" ]; then
-  log_info "Creating Grafana serviceAccount..."
-  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
+	log_info "Creating Grafana serviceAccount..."
+	kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
 fi
 
 if [ -z "$(kubectl get serviceAccount -n $MON_NS grafana-serviceaccount -o name 2>/dev/null)" ]; then
-  log_info "Creating Grafana serviceAccount..."
-  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
+	log_info "Creating Grafana serviceAccount..."
+	kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
 fi
 
 #Container Security: Disable serviceAccount Token Automounting
@@ -91,103 +91,101 @@
 log_debug "Adding cluster role..."
 oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n $MON_NS
 
-if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "10" ] && [ "$OSHIFT_MINOR_VERSION" -lt "16" ] ; then
+if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "10" ] && [ "$OSHIFT_MINOR_VERSION" -lt "16" ]; then
 
-    # OCP versions 4.11-4.15: We need to patch service account to add API Token
+	# OCP versions 4.11-4.15: We need to patch service account to add API Token
 
-    # NOTE: $token below is the *name* of the Kubernetes secret
-    #       containing the autogenerated serviceaccount token
-    token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')
-    log_debug "Patching serviceAccount to link to token...[$token]"
-    kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
+	# NOTE: $token below is the *name* of the Kubernetes secret
+	#       containing the autogenerated serviceaccount token
+	token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount | grep "Tokens:" | awk '{print $2}')
+	log_debug "Patching serviceAccount to link to token...[$token]"
+	kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
 fi
 
 log_debug "Obtaining token..."
 # NOTE: $grafanaToken is an actual token and NOT the name of a k8s resouce
 if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "15" ]; then
-   # OCP 4.16: removed deprecated oc serviceaccounts get-token command
-   # NOTE: 12000 hours = 500 days although OpenShift *may* expire token after 12 months
-   grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 600s)
+	# OCP 4.16: removed deprecated oc serviceaccounts get-token command
+	# NOTE: 12000 hours = 500 days although OpenShift *may* expire token after 12 months
+	grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 600s)
 else
-   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
+	grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
 fi
 
 if [ "$grafanaToken" == "" ]; then
-  log_error "Unable to obtain authentication token for [grafana-serviceaccount]"
-  exit 1
+	log_error "Unable to obtain authentication token for [grafana-serviceaccount]"
+	exit 1
 fi
 
 log_info "Deploying monitoring components for OpenShift..."
 userGrafanaYAML=$TMP_DIR/empty.yaml
 if [ -f "$USER_DIR/monitoring/user-values-openshift-grafana.yaml" ]; then
-  userGrafanaYAML="$USER_DIR/monitoring/user-values-openshift-grafana.yaml"
-  log_debug "User response file for Grafana found at [$userGrafanaYAML]"
+	userGrafanaYAML="$USER_DIR/monitoring/user-values-openshift-grafana.yaml"
+	log_debug "User response file for Grafana found at [$userGrafanaYAML]"
 fi
 
 # Access token to OpenShift Prometheus instances
 grafanaYAML=$TMP_DIR/grafana-values.yaml
 cp monitoring/openshift/grafana-values.yaml $grafanaYAML
-if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
+if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+	sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
 else
-  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
+	sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
 fi
 
 if ! helm3ReleaseExists v4m-grafana $MON_NS; then
-  firstTimeGrafana=true
+	firstTimeGrafana=true
 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"
+	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
 
-
 #Generate yaml file with all container-related keys
-generateImageKeysFile "$GRAFANA_FULL_IMAGE"     "monitoring/openshift/grafana_container_image.template"
-generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE"   "$imageKeysFile"  "SIDECAR_"
+generateImageKeysFile "$GRAFANA_FULL_IMAGE" "monitoring/openshift/grafana_container_image.template"
+generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE" "$imageKeysFile" "SIDECAR_"
 
-
 OPENSHIFT_AUTH_ENABLE=${OPENSHIFT_AUTH_ENABLE:-true}
 if [ "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  grafanaAuthYAML="monitoring/openshift/grafana-proxy-values.yaml"
-  extraArgs="--set service.targetPort=3001"
+	grafanaAuthYAML="monitoring/openshift/grafana-proxy-values.yaml"
+	extraArgs="--set service.targetPort=3001"
 else
-  grafanaAuthYAML="monitoring/openshift/grafana-tls-only-values.yaml"
-  log_debug "Creating the Grafana service to generate TLS certs..."
-  kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
-  log_debug "Sleeping 5 sec..."
-  sleep 5
+	grafanaAuthYAML="monitoring/openshift/grafana-tls-only-values.yaml"
+	log_debug "Creating the Grafana service to generate TLS certs..."
+	kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
+	log_debug "Sleeping 5 sec..."
+	sleep 5
 fi
 
 if [ -n "$GRAFANA_ADMIN_PASSWORD" ]; then
-  grafanaPwd="--set adminPassword=$GRAFANA_ADMIN_PASSWORD"
+	grafanaPwd="--set adminPassword=$GRAFANA_ADMIN_PASSWORD"
 fi
 
 # 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_info "Enabling monitoring components for workload node placement"
-  wnpValuesFile="monitoring/node-placement/values-grafana-wnp.yaml"
+	log_info "Enabling monitoring components for workload node placement"
+	wnpValuesFile="monitoring/node-placement/values-grafana-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
 
 if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-  OPENSHIFT_ROUTE_PATH_GRAFANA=${OPENSHIFT_ROUTE_PATH_GRAFANA:-/grafana}
+	OPENSHIFT_ROUTE_PATH_GRAFANA=${OPENSHIFT_ROUTE_PATH_GRAFANA:-/grafana}
 fi
 if [ "$OPENSHIFT_ROUTE_PATH_GRAFANA" != "" ] && [ "$OPENSHIFT_ROUTE_PATH_GRAFANA" != "/" ]; then
-  grafanaSubPath="true"
+	grafanaSubPath="true"
 else
-  grafanaSubPath="false"
+	grafanaSubPath="false"
 fi
 
 log_info "Deploying Grafana..."
@@ -199,141 +197,141 @@
 log_debug "Installing Helm chart from artifact [$chart2install]"
 
 helm upgrade --install $helmDebug \
-  -n "$MON_NS" \
-  -f "$imageKeysFile" \
-  -f "$wnpValuesFile" \
-  -f "$grafanaYAML" \
-  -f "$grafanaAuthYAML" \
-  -f "$userGrafanaYAML" \
-  -f $tempoDSFile \
-  --set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
-  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
-  --set 'grafana\.ini'.server.serve_from_sub_path=$grafanaSubPath \
-  $versionstring \
-  --atomic \
-  $grafanaPwd \
-  $extraArgs \
-  v4m-grafana \
-  $chart2install
+	-n "$MON_NS" \
+	-f "$imageKeysFile" \
+	-f "$wnpValuesFile" \
+	-f "$grafanaYAML" \
+	-f "$grafanaAuthYAML" \
+	-f "$userGrafanaYAML" \
+	-f $tempoDSFile \
+	--set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
+	--set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
+	--set 'grafana\.ini'.server.serve_from_sub_path=$grafanaSubPath \
+	$versionstring \
+	--atomic \
+	$grafanaPwd \
+	$extraArgs \
+	v4m-grafana \
+	$chart2install
 
 if [ "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  log_info "Using OpenShift authentication for Grafana"
-  log_debug "Annotating grafana-serviceaccount to auto-generate TLS certs..."
-  kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
+	log_info "Using OpenShift authentication for Grafana"
+	log_debug "Annotating grafana-serviceaccount to auto-generate TLS certs..."
+	kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
 
-  log_debug "Adding ClusterRoleBinding for grafana-serviceaccount..."
-  crbYAML=$TMP_DIR/grafana-serviceaccount-binding.yaml
-  cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
-  if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-    sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
-  else
-    sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
-  fi
+	log_debug "Adding ClusterRoleBinding for grafana-serviceaccount..."
+	crbYAML=$TMP_DIR/grafana-serviceaccount-binding.yaml
+	cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
+	else
+		sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
+	fi
 
-  kubectl apply -f $crbYAML
+	kubectl apply -f $crbYAML
 
-  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
-  
-  grafanaProxyPatchYAML=$TMP_DIR/grafana-proxy-patch.yaml
+	kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
 
-  if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-    log_debug "Using path-based version of the OpenShift Grafana proxy patch"
+	grafanaProxyPatchYAML=$TMP_DIR/grafana-proxy-patch.yaml
 
-    #Generate yaml file with all container-related keys
-    generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-path.template"
+	if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
+		log_debug "Using path-based version of the OpenShift Grafana proxy patch"
 
-    cp $imageKeysFile $grafanaProxyPatchYAML
-  else
-    log_debug "Using host-based version of the OpenShift Grafana proxy patch"
+		#Generate yaml file with all container-related keys
+		generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-path.template"
 
-    #Generate yaml file with all container-related keys
-    generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-host.template"
+		cp $imageKeysFile $grafanaProxyPatchYAML
+	else
+		log_debug "Using host-based version of the OpenShift Grafana proxy patch"
 
-    cp $imageKeysFile $grafanaProxyPatchYAML
-  fi
-    
-  log_debug "Deploying CA bundle..."
-  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
-  
-  log_info "Patching Grafana service for auto-generated TLS certs"
-  kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
+		#Generate yaml file with all container-related keys
+		generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-host.template"
 
-  log_info "Patching Grafana pod with authenticating TLS proxy..."
-  kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
+		cp $imageKeysFile $grafanaProxyPatchYAML
+	fi
+
+	log_debug "Deploying CA bundle..."
+	kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
+
+	log_info "Patching Grafana service for auto-generated TLS certs"
+	kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
+
+	log_info "Patching Grafana pod with authenticating TLS proxy..."
+	kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
 else
-  log_info "Using native Grafana authentication"
+	log_info "Using native Grafana authentication"
 fi
 
 log_info "Deploying SAS Viya Grafana dashboards..."
 DASH_NS=$MON_NS LOGGING_DASH=${LOGGING_DASH:-false} KUBE_DASH=${KUBE_DASH:-false} NGINX_DASH=${NGINX_DASH:-false} \
-  monitoring/bin/deploy_dashboards.sh
+	monitoring/bin/deploy_dashboards.sh
 
 log_info "Adding SAS Viya 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
 
 if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-  routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
+	routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
 else
-  routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
+	routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
 fi
 if ! kubectl get route -n $MON_NS v4m-grafana 1>/dev/null 2>&1; then
-  log_info "Exposing Grafana service as a route..."
-  if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-    oc create route reencrypt \
-      -n $MON_NS \
-      --service v4m-grafana \
-      --hostname "$routeHost" \
-      --path $OPENSHIFT_ROUTE_PATH_GRAFANA
-  else
-    oc create route reencrypt \
-      -n $MON_NS \
-      --service v4m-grafana \
-      --hostname "$routeHost"
-  fi
+	log_info "Exposing Grafana service as a route..."
+	if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
+		oc create route reencrypt \
+			-n $MON_NS \
+			--service v4m-grafana \
+			--hostname "$routeHost" \
+			--path $OPENSHIFT_ROUTE_PATH_GRAFANA
+	else
+		oc create route reencrypt \
+			-n $MON_NS \
+			--service v4m-grafana \
+			--hostname "$routeHost"
+	fi
 fi
 
 if [ "$TRACING_ENABLE" == "true" ]; then
-  log_info "Tracing enabled..."
+	log_info "Tracing enabled..."
 
-  #Generate yaml file with all container-related keys
-  generateImageKeysFile "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
+	#Generate yaml file with all container-related keys
+	generateImageKeysFile "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
 
-  # 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)"
-  versionstring="$(get_helm_versionstring $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)"
+	versionstring="$(get_helm_versionstring $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/openshift/tempo-values.yaml \
-    -f "$TEMPO_USER_YAML" \
-    $versionstring \
-    $chart2install
+	log_info "Installing tempo"
+	helm upgrade --install v4m-tempo \
+		-n "$MON_NS" \
+		-f "$imageKeysFile" \
+		-f monitoring/openshift/tempo-values.yaml \
+		-f "$TEMPO_USER_YAML" \
+		$versionstring \
+		$chart2install
 fi
 
 # 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
 
 scheme="https"
 if [ ! "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  if [ "$firstTimeGrafana" == "true" ]; then
-    if [ -z "$GRAFANA_ADMIN_PASSWORD" ]; then
-      log_notice "Obtain the inital Grafana password by running:"
-      log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
-    fi
-  fi
+	if [ "$firstTimeGrafana" == "true" ]; then
+		if [ -z "$GRAFANA_ADMIN_PASSWORD" ]; then
+			log_notice "Obtain the inital Grafana password by running:"
+			log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
+		fi
+	fi
 fi
 bin/show_app_url.sh GRAFANA
 # log_notice "Grafana URL: $scheme://$(kubectl get route -n $MON_NS v4m-grafana -o jsonpath='{.spec.host}{.spec.path}')"
----------

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 monitoring/bin/deploy_monitoring_openshift.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_openshift.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_openshift.sh line 24:
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_openshift.sh line 25:
  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_openshift.sh line 28:
  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_openshift.sh line 29:
  disable_sa_token_automount $MON_NS builder
                             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  disable_sa_token_automount "$MON_NS" builder


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

Did you mean: 
  disable_sa_token_automount "$MON_NS" deployer


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 80:
  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create serviceaccount -n "$MON_NS" grafana-serviceaccount


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 85:
  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create serviceaccount -n "$MON_NS" grafana-serviceaccount


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 92:
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n $MON_NS
                                                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n "$MON_NS"


In monitoring/bin/deploy_monitoring_openshift.sh line 100:
    token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')
                                ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    token=$(kubectl describe -n "$MON_NS" serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')


In monitoring/bin/deploy_monitoring_openshift.sh line 102:
    kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
               ^-----^ 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 "$MON_NS" patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'"$token"'"}}]'


In monitoring/bin/deploy_monitoring_openshift.sh line 110:
   grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 12000h)
                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   grafanaToken=$(oc create token grafana-serviceaccount -n "$MON_NS" --duration 12000h)


In monitoring/bin/deploy_monitoring_openshift.sh line 112:
   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
                                                                         ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n "$MON_NS")


In monitoring/bin/deploy_monitoring_openshift.sh line 129:
cp monitoring/openshift/grafana-values.yaml $grafanaYAML
                                            ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cp monitoring/openshift/grafana-values.yaml "$grafanaYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 131:
  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
                                                 ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" "$grafanaYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 133:
  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
                                              ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" "$grafanaYAML"


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 155:
generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE"   "$imageKeysFile"  "SIDECAR_"
                                                       ^------------^ SC2154 (warning): imageKeysFile is referenced but not assigned.


In monitoring/bin/deploy_monitoring_openshift.sh line 165:
  kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/v4m-grafana-svc.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 197:
chart2install="$(get_helmchart_reference $OPENSHIFT_GRAFANA_CHART_REPO $OPENSHIFT_GRAFANA_CHART_NAME $OPENSHIFT_GRAFANA_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 "$OPENSHIFT_GRAFANA_CHART_REPO" "$OPENSHIFT_GRAFANA_CHART_NAME" "$OPENSHIFT_GRAFANA_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_openshift.sh line 198:
versionstring="$(get_helm_versionstring $OPENSHIFT_GRAFANA_CHART_VERSION)"
                                        ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
versionstring="$(get_helm_versionstring "$OPENSHIFT_GRAFANA_CHART_VERSION")"


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

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


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

Did you mean: 
  -f "$tempoDSFile" \


In monitoring/bin/deploy_monitoring_openshift.sh line 209:
  --set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
                                     ^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --set 'grafana\.ini'.server.domain="$OPENSHIFT_ROUTE_DOMAIN" \


In monitoring/bin/deploy_monitoring_openshift.sh line 210:
  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
                                                           ^-----^ 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: 
  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-"$MON_NS"."$OPENSHIFT_ROUTE_DOMAIN""$OPENSHIFT_ROUTE_PATH_GRAFANA" \


In monitoring/bin/deploy_monitoring_openshift.sh line 212:
  $versionstring \
  ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$versionstring" \


In monitoring/bin/deploy_monitoring_openshift.sh line 214:
  $grafanaPwd \
  ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$grafanaPwd" \


In monitoring/bin/deploy_monitoring_openshift.sh line 215:
  $extraArgs \
  ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$extraArgs" \


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

Did you mean: 
  "$chart2install"


In monitoring/bin/deploy_monitoring_openshift.sh line 222:
  kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
                                     ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl annotate serviceaccount -n "$MON_NS" --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'


In monitoring/bin/deploy_monitoring_openshift.sh line 226:
  cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
                                                              ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  cp monitoring/openshift/grafana-serviceaccount-binding.yaml "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 228:
    sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
                                       ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    sed -i '' "s/__MON_NS__/$MON_NS/g" "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 230:
    sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
                                    ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    sed -i "s/__MON_NS__/$MON_NS/g" "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 233:
  kubectl apply -f $crbYAML
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -f "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 235:
  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/grafana-proxy-secret.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 245:
    cp $imageKeysFile $grafanaProxyPatchYAML
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                      ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

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


In monitoring/bin/deploy_monitoring_openshift.sh line 252:
    cp $imageKeysFile $grafanaProxyPatchYAML
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                      ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

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


In monitoring/bin/deploy_monitoring_openshift.sh line 256:
  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/grafana-trusted-ca-bundle.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 259:
  kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl annotate service -n "$MON_NS" --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'


In monitoring/bin/deploy_monitoring_openshift.sh line 262:
  kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                 ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl patch deployment -n "$MON_NS" v4m-grafana --patch "$(cat "$grafanaProxyPatchYAML")"


In monitoring/bin/deploy_monitoring_openshift.sh line 273:
  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_openshift.sh line 281:
if ! kubectl get route -n $MON_NS v4m-grafana 1>/dev/null 2>&1; then
                          ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if ! kubectl get route -n "$MON_NS" v4m-grafana 1>/dev/null 2>&1; then


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

Did you mean: 
      -n "$MON_NS" \


In monitoring/bin/deploy_monitoring_openshift.sh line 288:
      --path $OPENSHIFT_ROUTE_PATH_GRAFANA
             ^---------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      --path "$OPENSHIFT_ROUTE_PATH_GRAFANA"


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

Did you mean: 
      -n "$MON_NS" \


In monitoring/bin/deploy_monitoring_openshift.sh line 305:
  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_openshift.sh line 306:
  versionstring="$(get_helm_versionstring $TEMPO_CHART_VERSION)"
                                          ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  versionstring="$(get_helm_versionstring "$TEMPO_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_openshift.sh line 315:
    $versionstring \
    ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    "$versionstring" \


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

Did you mean: 
    "$chart2install"


In monitoring/bin/deploy_monitoring_openshift.sh line 320:
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_openshift.sh line 329:
scheme="https"
^----^ SC2034 (warning): scheme appears unused. Verify use (or export if used externally).


In monitoring/bin/deploy_monitoring_openshift.sh line 334:
      log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
                                                                                     ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it.
                                                                                                          ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it.

For more information:
  https://www.shellcheck.net/wiki/SC1083 -- This { is literal. Check expressi...
  https://www.shellcheck.net/wiki/SC2034 -- scheme appears unused. Verify use...
  https://www.shellcheck.net/wiki/SC2128 -- Expanding an array without an ind...
----------

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:

----------
--- monitoring/bin/deploy_monitoring_openshift.sh.orig
+++ monitoring/bin/deploy_monitoring_openshift.sh
@@ -7,27 +7,27 @@
 source monitoring/bin/common.sh
 
 if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
-  if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
-    log_error "This script should only be run on OpenShift clusters"
-    log_error "Run monitoring/bin/deploy_monitoring_cluster.sh instead"
-    exit 1
-  fi
+	if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
+		log_error "This script should only be run on OpenShift clusters"
+		log_error "Run monitoring/bin/deploy_monitoring_cluster.sh instead"
+		exit 1
+	fi
 fi
 
 checkDefaultStorageClass
 
 export HELM_DEBUG="${HELM_DEBUG:-false}"
 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
-  disable_sa_token_automount $MON_NS builder
-  disable_sa_token_automount $MON_NS deployer
+	#Container Security: Disable serviceAccount Token Automounting
+	disable_sa_token_automount $MON_NS default
+	disable_sa_token_automount $MON_NS builder
+	disable_sa_token_automount $MON_NS deployer
 
 fi
 
@@ -40,49 +40,49 @@
 helm repo update
 
 if kubectl get cm -n openshift-monitoring cluster-monitoring-config 1>/dev/null 2>&1; then
-  log_debug "Configmap [openshift-monitoring/cluster-monitoring-config] exists"
-  log_debug "The configmap may need to be modified to enable user workload monitoring"
+	log_debug "Configmap [openshift-monitoring/cluster-monitoring-config] exists"
+	log_debug "The configmap may need to be modified to enable user workload monitoring"
 else
-  log_info "Enabling OpenShift user workload monitoring..."
-  kubectl apply -f monitoring/openshift/cluster-monitoring-config.yaml
-  log_info "Waiting 30 seconds for pods to deploy..."
-  sleep 30
+	log_info "Enabling OpenShift user workload monitoring..."
+	kubectl apply -f monitoring/openshift/cluster-monitoring-config.yaml
+	log_info "Waiting 30 seconds for pods to deploy..."
+	sleep 30
 fi
 
 # TODO: Retries + fail?
 if [ -n "$(kubectl get po -n openshift-user-workload-monitoring 2>/dev/null)" ]; then
-  log_debug "User workload monitoring is ready"
+	log_debug "User workload monitoring is ready"
 else
-  log_warn "User workload monitoring pods not detected in the openshift-user-workload-monitoring namespace"
-  log_warn "Ensure that user workload monitoring is enabled"
+	log_warn "User workload monitoring pods not detected in the openshift-user-workload-monitoring namespace"
+	log_warn "Ensure that user workload monitoring is enabled"
 fi
 
 # Elasticsearch Datasource for Grafana
 LOGGING_DATASOURCE="${LOGGING_DATASOURCE:-false}"
 if [ "$LOGGING_DATASOURCE" == "true" ]; then
-  set +e
-  log_debug "Creating the logging datasource 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
+	set +e
+	log_debug "Creating the logging datasource 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
 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
 
 log_info "Enabling Grafana to access OpenShift Prometheus instances..."
 if [ -z "$(kubectl get serviceAccount -n $MON_NS grafana-serviceaccount -o name 2>/dev/null)" ]; then
-  log_info "Creating Grafana serviceAccount..."
-  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
+	log_info "Creating Grafana serviceAccount..."
+	kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
 fi
 
 if [ -z "$(kubectl get serviceAccount -n $MON_NS grafana-serviceaccount -o name 2>/dev/null)" ]; then
-  log_info "Creating Grafana serviceAccount..."
-  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
+	log_info "Creating Grafana serviceAccount..."
+	kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
 fi
 
 #Container Security: Disable serviceAccount Token Automounting
@@ -91,103 +91,101 @@
 log_debug "Adding cluster role..."
 oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n $MON_NS
 
-if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "10" ] && [ "$OSHIFT_MINOR_VERSION" -lt "16" ] ; then
+if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "10" ] && [ "$OSHIFT_MINOR_VERSION" -lt "16" ]; then
 
-    # OCP versions 4.11-4.15: We need to patch service account to add API Token
+	# OCP versions 4.11-4.15: We need to patch service account to add API Token
 
-    # NOTE: $token below is the *name* of the Kubernetes secret
-    #       containing the autogenerated serviceaccount token
-    token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')
-    log_debug "Patching serviceAccount to link to token...[$token]"
-    kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
+	# NOTE: $token below is the *name* of the Kubernetes secret
+	#       containing the autogenerated serviceaccount token
+	token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount | grep "Tokens:" | awk '{print $2}')
+	log_debug "Patching serviceAccount to link to token...[$token]"
+	kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
 fi
 
 log_debug "Obtaining token..."
 # NOTE: $grafanaToken is an actual token and NOT the name of a k8s resouce
 if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "15" ]; then
-   # OCP 4.16: removed deprecated oc serviceaccounts get-token command
-   # NOTE: 12000 hours = 500 days although OpenShift *may* expire token after 12 months
-   grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 12000h)
+	# OCP 4.16: removed deprecated oc serviceaccounts get-token command
+	# NOTE: 12000 hours = 500 days although OpenShift *may* expire token after 12 months
+	grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 12000h)
 else
-   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
+	grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
 fi
 
 if [ "$grafanaToken" == "" ]; then
-  log_error "Unable to obtain authentication token for [grafana-serviceaccount]"
-  exit 1
+	log_error "Unable to obtain authentication token for [grafana-serviceaccount]"
+	exit 1
 fi
 
 log_info "Deploying monitoring components for OpenShift..."
 userGrafanaYAML=$TMP_DIR/empty.yaml
 if [ -f "$USER_DIR/monitoring/user-values-openshift-grafana.yaml" ]; then
-  userGrafanaYAML="$USER_DIR/monitoring/user-values-openshift-grafana.yaml"
-  log_debug "User response file for Grafana found at [$userGrafanaYAML]"
+	userGrafanaYAML="$USER_DIR/monitoring/user-values-openshift-grafana.yaml"
+	log_debug "User response file for Grafana found at [$userGrafanaYAML]"
 fi
 
 # Access token to OpenShift Prometheus instances
 grafanaYAML=$TMP_DIR/grafana-values.yaml
 cp monitoring/openshift/grafana-values.yaml $grafanaYAML
-if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
+if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+	sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
 else
-  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
+	sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
 fi
 
 if ! helm3ReleaseExists v4m-grafana $MON_NS; then
-  firstTimeGrafana=true
+	firstTimeGrafana=true
 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"
+	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
 
-
 #Generate yaml file with all container-related keys
-generateImageKeysFile "$GRAFANA_FULL_IMAGE"     "monitoring/openshift/grafana_container_image.template"
-generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE"   "$imageKeysFile"  "SIDECAR_"
+generateImageKeysFile "$GRAFANA_FULL_IMAGE" "monitoring/openshift/grafana_container_image.template"
+generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE" "$imageKeysFile" "SIDECAR_"
 
-
 OPENSHIFT_AUTH_ENABLE=${OPENSHIFT_AUTH_ENABLE:-true}
 if [ "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  grafanaAuthYAML="monitoring/openshift/grafana-proxy-values.yaml"
-  extraArgs="--set service.targetPort=3001"
+	grafanaAuthYAML="monitoring/openshift/grafana-proxy-values.yaml"
+	extraArgs="--set service.targetPort=3001"
 else
-  grafanaAuthYAML="monitoring/openshift/grafana-tls-only-values.yaml"
-  log_debug "Creating the Grafana service to generate TLS certs..."
-  kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
-  log_debug "Sleeping 5 sec..."
-  sleep 5
+	grafanaAuthYAML="monitoring/openshift/grafana-tls-only-values.yaml"
+	log_debug "Creating the Grafana service to generate TLS certs..."
+	kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
+	log_debug "Sleeping 5 sec..."
+	sleep 5
 fi
 
 if [ -n "$GRAFANA_ADMIN_PASSWORD" ]; then
-  grafanaPwd="--set adminPassword=$GRAFANA_ADMIN_PASSWORD"
+	grafanaPwd="--set adminPassword=$GRAFANA_ADMIN_PASSWORD"
 fi
 
 # 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_info "Enabling monitoring components for workload node placement"
-  wnpValuesFile="monitoring/node-placement/values-grafana-wnp.yaml"
+	log_info "Enabling monitoring components for workload node placement"
+	wnpValuesFile="monitoring/node-placement/values-grafana-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
 
 if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-  OPENSHIFT_ROUTE_PATH_GRAFANA=${OPENSHIFT_ROUTE_PATH_GRAFANA:-/grafana}
+	OPENSHIFT_ROUTE_PATH_GRAFANA=${OPENSHIFT_ROUTE_PATH_GRAFANA:-/grafana}
 fi
 if [ "$OPENSHIFT_ROUTE_PATH_GRAFANA" != "" ] && [ "$OPENSHIFT_ROUTE_PATH_GRAFANA" != "/" ]; then
-  grafanaSubPath="true"
+	grafanaSubPath="true"
 else
-  grafanaSubPath="false"
+	grafanaSubPath="false"
 fi
 
 log_info "Deploying Grafana..."
@@ -199,141 +197,141 @@
 log_debug "Installing Helm chart from artifact [$chart2install]"
 
 helm upgrade --install $helmDebug \
-  -n "$MON_NS" \
-  -f "$imageKeysFile" \
-  -f "$wnpValuesFile" \
-  -f "$grafanaYAML" \
-  -f "$grafanaAuthYAML" \
-  -f "$userGrafanaYAML" \
-  -f $tempoDSFile \
-  --set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
-  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
-  --set 'grafana\.ini'.server.serve_from_sub_path=$grafanaSubPath \
-  $versionstring \
-  --atomic \
-  $grafanaPwd \
-  $extraArgs \
-  v4m-grafana \
-  $chart2install
+	-n "$MON_NS" \
+	-f "$imageKeysFile" \
+	-f "$wnpValuesFile" \
+	-f "$grafanaYAML" \
+	-f "$grafanaAuthYAML" \
+	-f "$userGrafanaYAML" \
+	-f $tempoDSFile \
+	--set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
+	--set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
+	--set 'grafana\.ini'.server.serve_from_sub_path=$grafanaSubPath \
+	$versionstring \
+	--atomic \
+	$grafanaPwd \
+	$extraArgs \
+	v4m-grafana \
+	$chart2install
 
 if [ "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  log_info "Using OpenShift authentication for Grafana"
-  log_debug "Annotating grafana-serviceaccount to auto-generate TLS certs..."
-  kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
+	log_info "Using OpenShift authentication for Grafana"
+	log_debug "Annotating grafana-serviceaccount to auto-generate TLS certs..."
+	kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
 
-  log_debug "Adding ClusterRoleBinding for grafana-serviceaccount..."
-  crbYAML=$TMP_DIR/grafana-serviceaccount-binding.yaml
-  cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
-  if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-    sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
-  else
-    sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
-  fi
+	log_debug "Adding ClusterRoleBinding for grafana-serviceaccount..."
+	crbYAML=$TMP_DIR/grafana-serviceaccount-binding.yaml
+	cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
+	else
+		sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
+	fi
 
-  kubectl apply -f $crbYAML
+	kubectl apply -f $crbYAML
 
-  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
-  
-  grafanaProxyPatchYAML=$TMP_DIR/grafana-proxy-patch.yaml
+	kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
 
-  if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-    log_debug "Using path-based version of the OpenShift Grafana proxy patch"
+	grafanaProxyPatchYAML=$TMP_DIR/grafana-proxy-patch.yaml
 
-    #Generate yaml file with all container-related keys
-    generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-path.template"
+	if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
+		log_debug "Using path-based version of the OpenShift Grafana proxy patch"
 
-    cp $imageKeysFile $grafanaProxyPatchYAML
-  else
-    log_debug "Using host-based version of the OpenShift Grafana proxy patch"
+		#Generate yaml file with all container-related keys
+		generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-path.template"
 
-    #Generate yaml file with all container-related keys
-    generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-host.template"
+		cp $imageKeysFile $grafanaProxyPatchYAML
+	else
+		log_debug "Using host-based version of the OpenShift Grafana proxy patch"
 
-    cp $imageKeysFile $grafanaProxyPatchYAML
-  fi
-    
-  log_debug "Deploying CA bundle..."
-  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
-  
-  log_info "Patching Grafana service for auto-generated TLS certs"
-  kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
+		#Generate yaml file with all container-related keys
+		generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-host.template"
 
-  log_info "Patching Grafana pod with authenticating TLS proxy..."
-  kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
+		cp $imageKeysFile $grafanaProxyPatchYAML
+	fi
+
+	log_debug "Deploying CA bundle..."
+	kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
+
+	log_info "Patching Grafana service for auto-generated TLS certs"
+	kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
+
+	log_info "Patching Grafana pod with authenticating TLS proxy..."
+	kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
 else
-  log_info "Using native Grafana authentication"
+	log_info "Using native Grafana authentication"
 fi
 
 log_info "Deploying SAS Viya Grafana dashboards..."
 DASH_NS=$MON_NS LOGGING_DASH=${LOGGING_DASH:-false} KUBE_DASH=${KUBE_DASH:-false} NGINX_DASH=${NGINX_DASH:-false} \
-  monitoring/bin/deploy_dashboards.sh
+	monitoring/bin/deploy_dashboards.sh
 
 log_info "Adding SAS Viya 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
 
 if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-  routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
+	routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
 else
-  routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
+	routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
 fi
 if ! kubectl get route -n $MON_NS v4m-grafana 1>/dev/null 2>&1; then
-  log_info "Exposing Grafana service as a route..."
-  if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-    oc create route reencrypt \
-      -n $MON_NS \
-      --service v4m-grafana \
-      --hostname "$routeHost" \
-      --path $OPENSHIFT_ROUTE_PATH_GRAFANA
-  else
-    oc create route reencrypt \
-      -n $MON_NS \
-      --service v4m-grafana \
-      --hostname "$routeHost"
-  fi
+	log_info "Exposing Grafana service as a route..."
+	if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
+		oc create route reencrypt \
+			-n $MON_NS \
+			--service v4m-grafana \
+			--hostname "$routeHost" \
+			--path $OPENSHIFT_ROUTE_PATH_GRAFANA
+	else
+		oc create route reencrypt \
+			-n $MON_NS \
+			--service v4m-grafana \
+			--hostname "$routeHost"
+	fi
 fi
 
 if [ "$TRACING_ENABLE" == "true" ]; then
-  log_info "Tracing enabled..."
+	log_info "Tracing enabled..."
 
-  #Generate yaml file with all container-related keys
-  generateImageKeysFile "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
+	#Generate yaml file with all container-related keys
+	generateImageKeysFile "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
 
-  # 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)"
-  versionstring="$(get_helm_versionstring $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)"
+	versionstring="$(get_helm_versionstring $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/openshift/tempo-values.yaml \
-    -f "$TEMPO_USER_YAML" \
-    $versionstring \
-    $chart2install
+	log_info "Installing tempo"
+	helm upgrade --install v4m-tempo \
+		-n "$MON_NS" \
+		-f "$imageKeysFile" \
+		-f monitoring/openshift/tempo-values.yaml \
+		-f "$TEMPO_USER_YAML" \
+		$versionstring \
+		$chart2install
 fi
 
 # 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
 
 scheme="https"
 if [ ! "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  if [ "$firstTimeGrafana" == "true" ]; then
-    if [ -z "$GRAFANA_ADMIN_PASSWORD" ]; then
-      log_notice "Obtain the inital Grafana password by running:"
-      log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
-    fi
-  fi
+	if [ "$firstTimeGrafana" == "true" ]; then
+		if [ -z "$GRAFANA_ADMIN_PASSWORD" ]; then
+			log_notice "Obtain the inital Grafana password by running:"
+			log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
+		fi
+	fi
 fi
 bin/show_app_url.sh GRAFANA
 # log_notice "Grafana URL: $scheme://$(kubectl get route -n $MON_NS v4m-grafana -o jsonpath='{.spec.host}{.spec.path}')"
----------

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 monitoring/bin/deploy_monitoring_openshift.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_openshift.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_openshift.sh line 24:
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_openshift.sh line 25:
  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_openshift.sh line 28:
  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_openshift.sh line 29:
  disable_sa_token_automount $MON_NS builder
                             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  disable_sa_token_automount "$MON_NS" builder


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

Did you mean: 
  disable_sa_token_automount "$MON_NS" deployer


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 80:
  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create serviceaccount -n "$MON_NS" grafana-serviceaccount


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 85:
  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
                                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl create serviceaccount -n "$MON_NS" grafana-serviceaccount


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 92:
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n $MON_NS
                                                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n "$MON_NS"


In monitoring/bin/deploy_monitoring_openshift.sh line 100:
    token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')
                                ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    token=$(kubectl describe -n "$MON_NS" serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')


In monitoring/bin/deploy_monitoring_openshift.sh line 102:
    kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
               ^-----^ 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 "$MON_NS" patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'"$token"'"}}]'


In monitoring/bin/deploy_monitoring_openshift.sh line 110:
   grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 12000h)
                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   grafanaToken=$(oc create token grafana-serviceaccount -n "$MON_NS" --duration 12000h)


In monitoring/bin/deploy_monitoring_openshift.sh line 112:
   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
                                                                         ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n "$MON_NS")


In monitoring/bin/deploy_monitoring_openshift.sh line 129:
cp monitoring/openshift/grafana-values.yaml $grafanaYAML
                                            ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cp monitoring/openshift/grafana-values.yaml "$grafanaYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 131:
  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
                                                 ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" "$grafanaYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 133:
  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
                                              ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" "$grafanaYAML"


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

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


In monitoring/bin/deploy_monitoring_openshift.sh line 155:
generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE"   "$imageKeysFile"  "SIDECAR_"
                                                       ^------------^ SC2154 (warning): imageKeysFile is referenced but not assigned.


In monitoring/bin/deploy_monitoring_openshift.sh line 165:
  kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/v4m-grafana-svc.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 197:
chart2install="$(get_helmchart_reference $OPENSHIFT_GRAFANA_CHART_REPO $OPENSHIFT_GRAFANA_CHART_NAME $OPENSHIFT_GRAFANA_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 "$OPENSHIFT_GRAFANA_CHART_REPO" "$OPENSHIFT_GRAFANA_CHART_NAME" "$OPENSHIFT_GRAFANA_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_openshift.sh line 198:
versionstring="$(get_helm_versionstring $OPENSHIFT_GRAFANA_CHART_VERSION)"
                                        ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
versionstring="$(get_helm_versionstring "$OPENSHIFT_GRAFANA_CHART_VERSION")"


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

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


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

Did you mean: 
  -f "$tempoDSFile" \


In monitoring/bin/deploy_monitoring_openshift.sh line 209:
  --set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
                                     ^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  --set 'grafana\.ini'.server.domain="$OPENSHIFT_ROUTE_DOMAIN" \


In monitoring/bin/deploy_monitoring_openshift.sh line 210:
  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
                                                           ^-----^ 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: 
  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-"$MON_NS"."$OPENSHIFT_ROUTE_DOMAIN""$OPENSHIFT_ROUTE_PATH_GRAFANA" \


In monitoring/bin/deploy_monitoring_openshift.sh line 212:
  $versionstring \
  ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$versionstring" \


In monitoring/bin/deploy_monitoring_openshift.sh line 214:
  $grafanaPwd \
  ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$grafanaPwd" \


In monitoring/bin/deploy_monitoring_openshift.sh line 215:
  $extraArgs \
  ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  "$extraArgs" \


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

Did you mean: 
  "$chart2install"


In monitoring/bin/deploy_monitoring_openshift.sh line 222:
  kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
                                     ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl annotate serviceaccount -n "$MON_NS" --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'


In monitoring/bin/deploy_monitoring_openshift.sh line 226:
  cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
                                                              ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  cp monitoring/openshift/grafana-serviceaccount-binding.yaml "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 228:
    sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
                                       ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    sed -i '' "s/__MON_NS__/$MON_NS/g" "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 230:
    sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
                                    ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    sed -i "s/__MON_NS__/$MON_NS/g" "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 233:
  kubectl apply -f $crbYAML
                   ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -f "$crbYAML"


In monitoring/bin/deploy_monitoring_openshift.sh line 235:
  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/grafana-proxy-secret.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 245:
    cp $imageKeysFile $grafanaProxyPatchYAML
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                      ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

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


In monitoring/bin/deploy_monitoring_openshift.sh line 252:
    cp $imageKeysFile $grafanaProxyPatchYAML
       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                      ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

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


In monitoring/bin/deploy_monitoring_openshift.sh line 256:
  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
                   ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl apply -n "$MON_NS" -f monitoring/openshift/grafana-trusted-ca-bundle.yaml


In monitoring/bin/deploy_monitoring_openshift.sh line 259:
  kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl annotate service -n "$MON_NS" --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'


In monitoring/bin/deploy_monitoring_openshift.sh line 262:
  kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                 ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  kubectl patch deployment -n "$MON_NS" v4m-grafana --patch "$(cat "$grafanaProxyPatchYAML")"


In monitoring/bin/deploy_monitoring_openshift.sh line 273:
  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_openshift.sh line 281:
if ! kubectl get route -n $MON_NS v4m-grafana 1>/dev/null 2>&1; then
                          ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if ! kubectl get route -n "$MON_NS" v4m-grafana 1>/dev/null 2>&1; then


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

Did you mean: 
      -n "$MON_NS" \


In monitoring/bin/deploy_monitoring_openshift.sh line 288:
      --path $OPENSHIFT_ROUTE_PATH_GRAFANA
             ^---------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
      --path "$OPENSHIFT_ROUTE_PATH_GRAFANA"


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

Did you mean: 
      -n "$MON_NS" \


In monitoring/bin/deploy_monitoring_openshift.sh line 305:
  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_openshift.sh line 306:
  versionstring="$(get_helm_versionstring $TEMPO_CHART_VERSION)"
                                          ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  versionstring="$(get_helm_versionstring "$TEMPO_CHART_VERSION")"


In monitoring/bin/deploy_monitoring_openshift.sh line 315:
    $versionstring \
    ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    "$versionstring" \


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

Did you mean: 
    "$chart2install"


In monitoring/bin/deploy_monitoring_openshift.sh line 320:
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_openshift.sh line 329:
scheme="https"
^----^ SC2034 (warning): scheme appears unused. Verify use (or export if used externally).


In monitoring/bin/deploy_monitoring_openshift.sh line 334:
      log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
                                                                                     ^-- SC1083 (warning): This { is literal. Check expression (missing ;/\n?) or quote it.
                                                                                                          ^-- SC1083 (warning): This } is literal. Check expression (missing ;/\n?) or quote it.

For more information:
  https://www.shellcheck.net/wiki/SC1083 -- This { is literal. Check expressi...
  https://www.shellcheck.net/wiki/SC2034 -- scheme appears unused. Verify use...
  https://www.shellcheck.net/wiki/SC2128 -- Expanding an array without an ind...
----------

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:

----------
--- monitoring/bin/deploy_monitoring_openshift.sh.orig
+++ monitoring/bin/deploy_monitoring_openshift.sh
@@ -7,27 +7,27 @@
 source monitoring/bin/common.sh
 
 if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
-  if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
-    log_error "This script should only be run on OpenShift clusters"
-    log_error "Run monitoring/bin/deploy_monitoring_cluster.sh instead"
-    exit 1
-  fi
+	if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
+		log_error "This script should only be run on OpenShift clusters"
+		log_error "Run monitoring/bin/deploy_monitoring_cluster.sh instead"
+		exit 1
+	fi
 fi
 
 checkDefaultStorageClass
 
 export HELM_DEBUG="${HELM_DEBUG:-false}"
 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
-  disable_sa_token_automount $MON_NS builder
-  disable_sa_token_automount $MON_NS deployer
+	#Container Security: Disable serviceAccount Token Automounting
+	disable_sa_token_automount $MON_NS default
+	disable_sa_token_automount $MON_NS builder
+	disable_sa_token_automount $MON_NS deployer
 
 fi
 
@@ -40,49 +40,49 @@
 helm repo update
 
 if kubectl get cm -n openshift-monitoring cluster-monitoring-config 1>/dev/null 2>&1; then
-  log_debug "Configmap [openshift-monitoring/cluster-monitoring-config] exists"
-  log_debug "The configmap may need to be modified to enable user workload monitoring"
+	log_debug "Configmap [openshift-monitoring/cluster-monitoring-config] exists"
+	log_debug "The configmap may need to be modified to enable user workload monitoring"
 else
-  log_info "Enabling OpenShift user workload monitoring..."
-  kubectl apply -f monitoring/openshift/cluster-monitoring-config.yaml
-  log_info "Waiting 30 seconds for pods to deploy..."
-  sleep 30
+	log_info "Enabling OpenShift user workload monitoring..."
+	kubectl apply -f monitoring/openshift/cluster-monitoring-config.yaml
+	log_info "Waiting 30 seconds for pods to deploy..."
+	sleep 30
 fi
 
 # TODO: Retries + fail?
 if [ -n "$(kubectl get po -n openshift-user-workload-monitoring 2>/dev/null)" ]; then
-  log_debug "User workload monitoring is ready"
+	log_debug "User workload monitoring is ready"
 else
-  log_warn "User workload monitoring pods not detected in the openshift-user-workload-monitoring namespace"
-  log_warn "Ensure that user workload monitoring is enabled"
+	log_warn "User workload monitoring pods not detected in the openshift-user-workload-monitoring namespace"
+	log_warn "Ensure that user workload monitoring is enabled"
 fi
 
 # Elasticsearch Datasource for Grafana
 LOGGING_DATASOURCE="${LOGGING_DATASOURCE:-false}"
 if [ "$LOGGING_DATASOURCE" == "true" ]; then
-  set +e
-  log_debug "Creating the logging datasource 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
+	set +e
+	log_debug "Creating the logging datasource 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
 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
 
 log_info "Enabling Grafana to access OpenShift Prometheus instances..."
 if [ -z "$(kubectl get serviceAccount -n $MON_NS grafana-serviceaccount -o name 2>/dev/null)" ]; then
-  log_info "Creating Grafana serviceAccount..."
-  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
+	log_info "Creating Grafana serviceAccount..."
+	kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
 fi
 
 if [ -z "$(kubectl get serviceAccount -n $MON_NS grafana-serviceaccount -o name 2>/dev/null)" ]; then
-  log_info "Creating Grafana serviceAccount..."
-  kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
+	log_info "Creating Grafana serviceAccount..."
+	kubectl create serviceaccount -n $MON_NS grafana-serviceaccount
 fi
 
 #Container Security: Disable serviceAccount Token Automounting
@@ -91,103 +91,101 @@
 log_debug "Adding cluster role..."
 oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-serviceaccount -n $MON_NS
 
-if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "10" ] && [ "$OSHIFT_MINOR_VERSION" -lt "16" ] ; then
+if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "10" ] && [ "$OSHIFT_MINOR_VERSION" -lt "16" ]; then
 
-    # OCP versions 4.11-4.15: We need to patch service account to add API Token
+	# OCP versions 4.11-4.15: We need to patch service account to add API Token
 
-    # NOTE: $token below is the *name* of the Kubernetes secret
-    #       containing the autogenerated serviceaccount token
-    token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount |grep "Tokens:"|awk '{print $2}')
-    log_debug "Patching serviceAccount to link to token...[$token]"
-    kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
+	# NOTE: $token below is the *name* of the Kubernetes secret
+	#       containing the autogenerated serviceaccount token
+	token=$(kubectl describe -n $MON_NS serviceaccount grafana-serviceaccount | grep "Tokens:" | awk '{print $2}')
+	log_debug "Patching serviceAccount to link to token...[$token]"
+	kubectl -n $MON_NS patch serviceaccount grafana-serviceaccount --type=json -p='[{"op":"add","path":"/secrets/1","value":{"name":"'$token'"}}]'
 fi
 
 log_debug "Obtaining token..."
 # NOTE: $grafanaToken is an actual token and NOT the name of a k8s resouce
 if [ "$OSHIFT_MAJOR_VERSION" -eq "4" ] && [ "$OSHIFT_MINOR_VERSION" -gt "15" ]; then
-   # OCP 4.16: removed deprecated oc serviceaccounts get-token command
-   # NOTE: 12000 hours = 500 days although OpenShift *may* expire token after 12 months
-   grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 12000h)
+	# OCP 4.16: removed deprecated oc serviceaccounts get-token command
+	# NOTE: 12000 hours = 500 days although OpenShift *may* expire token after 12 months
+	grafanaToken=$(oc create token grafana-serviceaccount -n $MON_NS --duration 12000h)
 else
-   grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
+	grafanaToken=$(oc serviceaccounts get-token grafana-serviceaccount -n $MON_NS)
 fi
 
 if [ "$grafanaToken" == "" ]; then
-  log_error "Unable to obtain authentication token for [grafana-serviceaccount]"
-  exit 1
+	log_error "Unable to obtain authentication token for [grafana-serviceaccount]"
+	exit 1
 fi
 
 log_info "Deploying monitoring components for OpenShift..."
 userGrafanaYAML=$TMP_DIR/empty.yaml
 if [ -f "$USER_DIR/monitoring/user-values-openshift-grafana.yaml" ]; then
-  userGrafanaYAML="$USER_DIR/monitoring/user-values-openshift-grafana.yaml"
-  log_debug "User response file for Grafana found at [$userGrafanaYAML]"
+	userGrafanaYAML="$USER_DIR/monitoring/user-values-openshift-grafana.yaml"
+	log_debug "User response file for Grafana found at [$userGrafanaYAML]"
 fi
 
 # Access token to OpenShift Prometheus instances
 grafanaYAML=$TMP_DIR/grafana-values.yaml
 cp monitoring/openshift/grafana-values.yaml $grafanaYAML
-if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-  sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
+if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+	sed -i '' "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
 else
-  sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
+	sed -i "s/__BEARER_TOKEN__/$grafanaToken/g" $grafanaYAML
 fi
 
 if ! helm3ReleaseExists v4m-grafana $MON_NS; then
-  firstTimeGrafana=true
+	firstTimeGrafana=true
 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"
+	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
 
-
 #Generate yaml file with all container-related keys
-generateImageKeysFile "$GRAFANA_FULL_IMAGE"     "monitoring/openshift/grafana_container_image.template"
-generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE"   "$imageKeysFile"  "SIDECAR_"
+generateImageKeysFile "$GRAFANA_FULL_IMAGE" "monitoring/openshift/grafana_container_image.template"
+generateImageKeysFile "$GRAFANA_SIDECAR_FULL_IMAGE" "$imageKeysFile" "SIDECAR_"
 
-
 OPENSHIFT_AUTH_ENABLE=${OPENSHIFT_AUTH_ENABLE:-true}
 if [ "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  grafanaAuthYAML="monitoring/openshift/grafana-proxy-values.yaml"
-  extraArgs="--set service.targetPort=3001"
+	grafanaAuthYAML="monitoring/openshift/grafana-proxy-values.yaml"
+	extraArgs="--set service.targetPort=3001"
 else
-  grafanaAuthYAML="monitoring/openshift/grafana-tls-only-values.yaml"
-  log_debug "Creating the Grafana service to generate TLS certs..."
-  kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
-  log_debug "Sleeping 5 sec..."
-  sleep 5
+	grafanaAuthYAML="monitoring/openshift/grafana-tls-only-values.yaml"
+	log_debug "Creating the Grafana service to generate TLS certs..."
+	kubectl apply -n $MON_NS -f monitoring/openshift/v4m-grafana-svc.yaml
+	log_debug "Sleeping 5 sec..."
+	sleep 5
 fi
 
 if [ -n "$GRAFANA_ADMIN_PASSWORD" ]; then
-  grafanaPwd="--set adminPassword=$GRAFANA_ADMIN_PASSWORD"
+	grafanaPwd="--set adminPassword=$GRAFANA_ADMIN_PASSWORD"
 fi
 
 # 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_info "Enabling monitoring components for workload node placement"
-  wnpValuesFile="monitoring/node-placement/values-grafana-wnp.yaml"
+	log_info "Enabling monitoring components for workload node placement"
+	wnpValuesFile="monitoring/node-placement/values-grafana-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
 
 if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-  OPENSHIFT_ROUTE_PATH_GRAFANA=${OPENSHIFT_ROUTE_PATH_GRAFANA:-/grafana}
+	OPENSHIFT_ROUTE_PATH_GRAFANA=${OPENSHIFT_ROUTE_PATH_GRAFANA:-/grafana}
 fi
 if [ "$OPENSHIFT_ROUTE_PATH_GRAFANA" != "" ] && [ "$OPENSHIFT_ROUTE_PATH_GRAFANA" != "/" ]; then
-  grafanaSubPath="true"
+	grafanaSubPath="true"
 else
-  grafanaSubPath="false"
+	grafanaSubPath="false"
 fi
 
 log_info "Deploying Grafana..."
@@ -199,141 +197,141 @@
 log_debug "Installing Helm chart from artifact [$chart2install]"
 
 helm upgrade --install $helmDebug \
-  -n "$MON_NS" \
-  -f "$imageKeysFile" \
-  -f "$wnpValuesFile" \
-  -f "$grafanaYAML" \
-  -f "$grafanaAuthYAML" \
-  -f "$userGrafanaYAML" \
-  -f $tempoDSFile \
-  --set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
-  --set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
-  --set 'grafana\.ini'.server.serve_from_sub_path=$grafanaSubPath \
-  $versionstring \
-  --atomic \
-  $grafanaPwd \
-  $extraArgs \
-  v4m-grafana \
-  $chart2install
+	-n "$MON_NS" \
+	-f "$imageKeysFile" \
+	-f "$wnpValuesFile" \
+	-f "$grafanaYAML" \
+	-f "$grafanaAuthYAML" \
+	-f "$userGrafanaYAML" \
+	-f $tempoDSFile \
+	--set 'grafana\.ini'.server.domain=$OPENSHIFT_ROUTE_DOMAIN \
+	--set 'grafana\.ini'.server.root_url=https://v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN$OPENSHIFT_ROUTE_PATH_GRAFANA \
+	--set 'grafana\.ini'.server.serve_from_sub_path=$grafanaSubPath \
+	$versionstring \
+	--atomic \
+	$grafanaPwd \
+	$extraArgs \
+	v4m-grafana \
+	$chart2install
 
 if [ "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  log_info "Using OpenShift authentication for Grafana"
-  log_debug "Annotating grafana-serviceaccount to auto-generate TLS certs..."
-  kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
+	log_info "Using OpenShift authentication for Grafana"
+	log_debug "Annotating grafana-serviceaccount to auto-generate TLS certs..."
+	kubectl annotate serviceaccount -n $MON_NS --overwrite grafana-serviceaccount 'serviceaccounts.openshift.io/oauth-redirectreference.primary={"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"v4m-grafana"}}'
 
-  log_debug "Adding ClusterRoleBinding for grafana-serviceaccount..."
-  crbYAML=$TMP_DIR/grafana-serviceaccount-binding.yaml
-  cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
-  if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then
-    sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
-  else
-    sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
-  fi
+	log_debug "Adding ClusterRoleBinding for grafana-serviceaccount..."
+	crbYAML=$TMP_DIR/grafana-serviceaccount-binding.yaml
+	cp monitoring/openshift/grafana-serviceaccount-binding.yaml $crbYAML
+	if echo "$OSTYPE" | grep 'darwin' >/dev/null 2>&1; then
+		sed -i '' "s/__MON_NS__/$MON_NS/g" $crbYAML
+	else
+		sed -i "s/__MON_NS__/$MON_NS/g" $crbYAML
+	fi
 
-  kubectl apply -f $crbYAML
+	kubectl apply -f $crbYAML
 
-  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
-  
-  grafanaProxyPatchYAML=$TMP_DIR/grafana-proxy-patch.yaml
+	kubectl apply -n $MON_NS -f monitoring/openshift/grafana-proxy-secret.yaml
 
-  if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-    log_debug "Using path-based version of the OpenShift Grafana proxy patch"
+	grafanaProxyPatchYAML=$TMP_DIR/grafana-proxy-patch.yaml
 
-    #Generate yaml file with all container-related keys
-    generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-path.template"
+	if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
+		log_debug "Using path-based version of the OpenShift Grafana proxy patch"
 
-    cp $imageKeysFile $grafanaProxyPatchYAML
-  else
-    log_debug "Using host-based version of the OpenShift Grafana proxy patch"
+		#Generate yaml file with all container-related keys
+		generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-path.template"
 
-    #Generate yaml file with all container-related keys
-    generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-host.template"
+		cp $imageKeysFile $grafanaProxyPatchYAML
+	else
+		log_debug "Using host-based version of the OpenShift Grafana proxy patch"
 
-    cp $imageKeysFile $grafanaProxyPatchYAML
-  fi
-    
-  log_debug "Deploying CA bundle..."
-  kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
-  
-  log_info "Patching Grafana service for auto-generated TLS certs"
-  kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
+		#Generate yaml file with all container-related keys
+		generateImageKeysFile "$OPENSHIFT_OAUTHPROXY_FULL_IMAGE" "monitoring/openshift/grafana-proxy-patch-host.template"
 
-  log_info "Patching Grafana pod with authenticating TLS proxy..."
-  kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
+		cp $imageKeysFile $grafanaProxyPatchYAML
+	fi
+
+	log_debug "Deploying CA bundle..."
+	kubectl apply -n $MON_NS -f monitoring/openshift/grafana-trusted-ca-bundle.yaml
+
+	log_info "Patching Grafana service for auto-generated TLS certs"
+	kubectl annotate service -n $MON_NS --overwrite v4m-grafana 'service.beta.openshift.io/serving-cert-secret-name=grafana-tls'
+
+	log_info "Patching Grafana pod with authenticating TLS proxy..."
+	kubectl patch deployment -n $MON_NS v4m-grafana --patch "$(cat $grafanaProxyPatchYAML)"
 else
-  log_info "Using native Grafana authentication"
+	log_info "Using native Grafana authentication"
 fi
 
 log_info "Deploying SAS Viya Grafana dashboards..."
 DASH_NS=$MON_NS LOGGING_DASH=${LOGGING_DASH:-false} KUBE_DASH=${KUBE_DASH:-false} NGINX_DASH=${NGINX_DASH:-false} \
-  monitoring/bin/deploy_dashboards.sh
+	monitoring/bin/deploy_dashboards.sh
 
 log_info "Adding SAS Viya 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
 
 if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-  routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
+	routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
 else
-  routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
+	routeHost=${OPENSHIFT_ROUTE_HOST_GRAFANA:-v4m-grafana-$MON_NS.$OPENSHIFT_ROUTE_DOMAIN}
 fi
 if ! kubectl get route -n $MON_NS v4m-grafana 1>/dev/null 2>&1; then
-  log_info "Exposing Grafana service as a route..."
-  if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
-    oc create route reencrypt \
-      -n $MON_NS \
-      --service v4m-grafana \
-      --hostname "$routeHost" \
-      --path $OPENSHIFT_ROUTE_PATH_GRAFANA
-  else
-    oc create route reencrypt \
-      -n $MON_NS \
-      --service v4m-grafana \
-      --hostname "$routeHost"
-  fi
+	log_info "Exposing Grafana service as a route..."
+	if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
+		oc create route reencrypt \
+			-n $MON_NS \
+			--service v4m-grafana \
+			--hostname "$routeHost" \
+			--path $OPENSHIFT_ROUTE_PATH_GRAFANA
+	else
+		oc create route reencrypt \
+			-n $MON_NS \
+			--service v4m-grafana \
+			--hostname "$routeHost"
+	fi
 fi
 
 if [ "$TRACING_ENABLE" == "true" ]; then
-  log_info "Tracing enabled..."
+	log_info "Tracing enabled..."
 
-  #Generate yaml file with all container-related keys
-  generateImageKeysFile "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
+	#Generate yaml file with all container-related keys
+	generateImageKeysFile "$TEMPO_FULL_IMAGE" "monitoring/tempo_container_image.template"
 
-  # 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)"
-  versionstring="$(get_helm_versionstring $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)"
+	versionstring="$(get_helm_versionstring $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/openshift/tempo-values.yaml \
-    -f "$TEMPO_USER_YAML" \
-    $versionstring \
-    $chart2install
+	log_info "Installing tempo"
+	helm upgrade --install v4m-tempo \
+		-n "$MON_NS" \
+		-f "$imageKeysFile" \
+		-f monitoring/openshift/tempo-values.yaml \
+		-f "$TEMPO_USER_YAML" \
+		$versionstring \
+		$chart2install
 fi
 
 # 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
 
 scheme="https"
 if [ ! "$OPENSHIFT_AUTH_ENABLE" == "true" ]; then
-  if [ "$firstTimeGrafana" == "true" ]; then
-    if [ -z "$GRAFANA_ADMIN_PASSWORD" ]; then
-      log_notice "Obtain the inital Grafana password by running:"
-      log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
-    fi
-  fi
+	if [ "$firstTimeGrafana" == "true" ]; then
+		if [ -z "$GRAFANA_ADMIN_PASSWORD" ]; then
+			log_notice "Obtain the inital Grafana password by running:"
+			log_notice "kubectl get secret --namespace monitoring v4m-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo"
+		fi
+	fi
 fi
 bin/show_app_url.sh GRAFANA
 # log_notice "Grafana URL: $scheme://$(kubectl get route -n $MON_NS v4m-grafana -o jsonpath='{.spec.host}{.spec.path}')"
----------

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

  shfmt -s -w filename


@gsmith-sas gsmith-sas merged commit a466ef9 into main Sep 12, 2024
1 check failed
@gsmith-sas gsmith-sas deleted the ocp416debug branch September 12, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants