Browse Source

chore: fix sonar cloud issues (#5405)

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com>
Gergely Brautigam 4 months ago
parent
commit
119f3bffa4
2 changed files with 8 additions and 8 deletions
  1. 4 4
      hack/api-docs/add_eso_version.sh
  2. 4 4
      hack/helm.generate.sh

+ 4 - 4
hack/api-docs/add_eso_version.sh

@@ -15,7 +15,7 @@ fi
 
 # Assign parameters to variables
 ESO_VERSION="$1"
-K8S_VERSION="$(echo 1.$(cat $ROOT/go.mod | grep 'k8s.io/client-go' | cut -d'v' -f2 | cut -d'.' -f2))"
+K8S_VERSION="$(echo 1.$(cat "${ROOT}"/go.mod | grep 'k8s.io/client-go' | cut -d'v' -f2 | cut -d'.' -f2))"
 RELEASE_DATE=$(date +%B\ %d,\ %Y)
 
 
@@ -30,14 +30,14 @@ if [ ! -f "$FILE_PATH" ]; then
 fi
 
 echo "Checking for version: $ESO_VERSION"
-current=$(cat $ROOT/docs/introduction/stability-support.md | grep "$ESO_VERSION") || true
-if [[ $current != "" ]]; then
+current=$(cat "${ROOT}"/docs/introduction/stability-support.md | grep "$ESO_VERSION") || true
+if [[ "${current}" != "" ]]; then
 		echo "Version already exists. Nothing to do"
         exit 0
 fi
 
 # Set End of Life to "Release of next version"
-END_OF_LIFE="Release of $(echo $ESO_VERSION | awk -F. '{print $1"."$2+1}')"
+END_OF_LIFE="Release of $(echo "${ESO_VERSION}" | awk -F. '{print $1"."$2+1}')"
 
 # Create the new line to insert
 NEW_LINE="| $ESO_VERSION      | $K8S_VERSION               | $RELEASE_DATE  | $END_OF_LIFE |"

+ 4 - 4
hack/helm.generate.sh

@@ -17,18 +17,18 @@ yq e -Ns "\"${HELM_DIR}/templates/crds/\" + .spec.names.singular" ${BUNDLE_DIR}/
 
 # Add helm if statement for controlling the install of CRDs
 for i in "${HELM_DIR}"/templates/crds/*.yml; do
-  export CRDS_FLAG_NAME="create$(yq e '.spec.names.kind' $i)"
+  export CRDS_FLAG_NAME="create$(yq e '.spec.names.kind' "${i}")"
   cp "$i" "$i.bkp"
-  if [[ "$CRDS_FLAG_NAME" == *"ExternalSecret"* || "$CRDS_FLAG_NAME" == *"SecretStore"* ]]; then
+  if [[ "${CRDS_FLAG_NAME}" == *"ExternalSecret"* || "${CRDS_FLAG_NAME}" == *"SecretStore"* ]]; then
     yq e '(.spec.versions[] | select(.name == "v1alpha1")) |= ("{{- if .Values.crds.conversion.enabled }}\n \(.)\n {{- end }}")' -i "$i.bkp" || true
     $SEDPRG -i '/- |-/d' "$i.bkp"
     # Indent the remaining additionalPrinterColumn property right
     $SEDPRG -i 's/       additionalPrinterColumns:/    - additionalPrinterColumns:/' "$i.bkp"
   fi
 
-  if [[ "$CRDS_FLAG_NAME" == *"Cluster"* ]]; then
+  if [[ "${CRDS_FLAG_NAME}" == *"Cluster"* ]]; then
     echo "{{- if and (.Values.installCRDs) (.Values.crds.$CRDS_FLAG_NAME) }}" > "$i"
-  elif [[ "$CRDS_FLAG_NAME" == *"PushSecret"* ]]; then
+  elif [[ "${CRDS_FLAG_NAME}" == *"PushSecret"* ]]; then
 			echo "{{- if and (.Values.installCRDs) (.Values.crds.$CRDS_FLAG_NAME) }}" > "$i"
   else
     echo "{{- if .Values.installCRDs }}" > "$i"