From 8736b8e8f3ae515eda3332f04f5ec002896b3511 Mon Sep 17 00:00:00 2001 From: "Mitch Harding (the weird one)" Date: Fri, 15 Mar 2024 15:37:19 -0400 Subject: [PATCH] CASMPET-6925: Fix shellcheck errors (cherry picked from commit 5b1c3147265b20f28d7edf028c82820adb60d3e5) --- goss-testing/scripts/k8s_kyverno_pods_running.sh | 4 ++-- goss-testing/scripts/velero_backups_check.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/goss-testing/scripts/k8s_kyverno_pods_running.sh b/goss-testing/scripts/k8s_kyverno_pods_running.sh index b468da67..aa56482e 100644 --- a/goss-testing/scripts/k8s_kyverno_pods_running.sh +++ b/goss-testing/scripts/k8s_kyverno_pods_running.sh @@ -2,7 +2,7 @@ # # MIT License # -# (C) Copyright 2022 Hewlett Packard Enterprise Development LP +# (C) Copyright 2022, 2024 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -46,7 +46,7 @@ rc=$? if [[ ${rc} -ne 0 ]] then # Split into two echo commands for code readability - echo -n "ERROR: Command pipeline failed (return code $?): " 1>&2 + echo -n "ERROR: Command pipeline failed (return code $rc): " 1>&2 echo "kubectl get pods -n kyverno -o json | jq '[.items[] | select(.metadata.labels.app == \"kyverno\").status.containerStatuses[0].state.running] | length'" 1>&2 echo "FAIL" exit 10 diff --git a/goss-testing/scripts/velero_backups_check.sh b/goss-testing/scripts/velero_backups_check.sh index f5937610..2e7e15ff 100755 --- a/goss-testing/scripts/velero_backups_check.sh +++ b/goss-testing/scripts/velero_backups_check.sh @@ -2,7 +2,7 @@ # # MIT License # -# (C) Copyright 2022-2023 Hewlett Packard Enterprise Development LP +# (C) Copyright 2022-2024 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -68,7 +68,7 @@ cleanup_velero_backups() { time_from_schedule_creation_to_backup=$(( $backup_creation_date_sec - $schedule_creation_date_sec )) if [[ ! -z $backup_creation_date_sec && ${time_from_schedule_creation_to_backup} -ge 0 && ${time_from_schedule_creation_to_backup} -lt $ten_minutes ]] then - delete_count+=1 + (( delete_count+=1 )) echo "velero backup delete ${backup_name}" velero backup delete ${backup_name} --confirm ns=$(kubectl get backups -A -o json | jq -re ".items[] | select (.metadata.name == \"${backup_name}\") | .metadata.namespace")