6
6
cd " $( dirname " $BASH_SOURCE " ) /../.." || exit 1
7
7
source logging/bin/common.sh
8
8
9
- # Fix SC2155: Declare and assign separately
10
9
this_script=$( basename " $0 " )
11
10
12
11
log_debug " Script [$this_script ] has started [$( date) ]"
@@ -27,11 +26,6 @@ if [ "$HELM_DEBUG" == "true" ]; then
27
26
helmDebug=" --debug"
28
27
fi
29
28
30
- # Address SC2154: Ensure variables from common.sh are available or defined
31
- # The following variables are expected to be set in common.sh:
32
- # LOG_NS, TMP_DIR, USER_DIR, FB_FULL_IMAGE, FB_INITCONTAINER_FULL_IMAGE
33
- # imageKeysFile, FLUENTBIT_HELM_CHART_REPO, FLUENTBIT_HELM_CHART_NAME, FLUENTBIT_HELM_CHART_VERSION
34
-
35
29
helm2ReleaseCheck " fb-$LOG_NS "
36
30
37
31
helmRepoAdd fluent https://fluent.github.io/helm-charts
@@ -84,7 +78,6 @@ if [ "$(kubectl -n "$LOG_NS" get secret connection-info-azmonitor -o name 2> /de
84
78
fi
85
79
else
86
80
log_info " Obtaining connection information from existing secret [$LOG_NS /connection-info-azmonitor]"
87
- # Fix SC2155: Declare and assign separately
88
81
AZMONITOR_CUSTOMER_ID=$( kubectl -n " $LOG_NS " get secret connection-info-azmonitor -o=jsonpath=" {.data.customer_id}" | base64 --decode)
89
82
export AZMONITOR_CUSTOMER_ID
90
83
AZMONITOR_SHARED_KEY=$( kubectl -n " $LOG_NS " get secret connection-info-azmonitor -o=jsonpath=" {.data.shared_key}" | base64 --decode)
@@ -96,7 +89,6 @@ if helm3ReleaseExists fbaz "$LOG_NS"; then
96
89
log_info " Removing an existing release of deprecated stable/fluent-bit Helm chart from from the [$LOG_NS ] namespace [$( date) ]"
97
90
helm " $helmDebug " delete -n " $LOG_NS " fbaz
98
91
99
- # Fix SC2155: Declare and assign separately
100
92
num_service_monitors_v2=$( kubectl get servicemonitors -A | grep -c fluent-bit-v2 || true)
101
93
if [ " $num_service_monitors_v2 " -ge 1 ]; then
102
94
log_debug " Updated serviceMonitor [fluent-bit-v2] appears to be deployed."
145
137
# Check for Kubernetes container runtime log format info
146
138
KUBERNETES_RUNTIME_LOGFMT=" ${KUBERNETES_RUNTIME_LOGFMT:- } "
147
139
if [ -z " $KUBERNETES_RUNTIME_LOGFMT " ]; then
148
- # Fix SC2155: Declare and assign separately
149
140
somenode=$( kubectl get nodes | awk ' NR==2 { print $1 }' )
150
141
runtime=$( kubectl get node " $somenode " -o " jsonpath={.status.nodeInfo.containerRuntimeVersion}" | awk -F: ' {print $1}' )
151
142
log_debug " Kubernetes container runtime [$runtime ] found on node [$somenode ]"
@@ -187,7 +178,6 @@ kubectl -n "$LOG_NS" label configmap fbaz-dbmigrate-script managed-by=v4m-es-scr
187
178
188
179
# # Get Helm Chart Name
189
180
log_debug " Fluent Bit Helm Chart: repo [$FLUENTBIT_HELM_CHART_REPO ] name [$FLUENTBIT_HELM_CHART_NAME ] version [$FLUENTBIT_HELM_CHART_VERSION ]"
190
- # Fix SC2155: Declare and assign separately
191
181
chart2install=$( get_helmchart_reference " $FLUENTBIT_HELM_CHART_REPO " " $FLUENTBIT_HELM_CHART_NAME " " $FLUENTBIT_HELM_CHART_VERSION " )
192
182
versionstring=$( get_helm_versionstring " $FLUENTBIT_HELM_CHART_VERSION " )
193
183
log_debug " Installing Helm chart from artifact [$chart2install ]"
0 commit comments