Skip to content

Commit 1c47ba5

Browse files
committed
fix: shell style
Signed-off-by: matttrach <matt.trachier@suse.com>
1 parent 23da134 commit 1c47ba5

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

run_tests.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ EOT
2121
esac
2222
done
2323

24+
# shellcheck disable=SC2143
2425
if [ -n "$cleanup_id" ]; then
2526
export IDENTIFIER="$cleanup_id"
2627
fi
@@ -72,11 +73,13 @@ EOF
7273
fi
7374

7475
local specific_test_flag=""
76+
# shellcheck disable=SC2143
7577
if [ -n "$specific_test" ]; then
7678
specific_test_flag="-run=$specific_test"
7779
fi
7880

7981
local package_pattern=""
82+
# shellcheck disable=SC2143
8083
if [ -n "$specific_package" ]; then
8184
package_pattern="$specific_package"
8285
else
@@ -143,6 +146,7 @@ fi
143146

144147
echo "Clearing leftovers with Id $IDENTIFIER in $AWS_REGION..."
145148

149+
# shellcheck disable=SC2143
146150
if [ -n "$IDENTIFIER" ]; then
147151
attempts=0
148152
# shellcheck disable=SC2143
@@ -171,8 +175,8 @@ if [ -n "$IDENTIFIER" ]; then
171175

172176
# remove s3 storage
173177
attempts=0
174-
# shellcheck disable=SC2143
175178
ID="$(aws s3 ls | grep -i "$IDENTIFIER" | awk '{print $3}')"
179+
# shellcheck disable=SC2143
176180
while [ -n "$(aws s3 ls | grep -i "$IDENTIFIER")" ] && [ $attempts -lt 3 ]; do
177181
echo "found s3 bucket $ID, removing..."
178182
while read -r v; do
@@ -202,11 +206,11 @@ if [ -n "$IDENTIFIER" ]; then
202206
while read -r line; do
203207
if [ -z "$line" ]; then continue; fi
204208
echo "removing load balancer target group, $line..."
205-
aws elbv2 delete-target-group --target-group-arn $line;
209+
aws elbv2 delete-target-group --target-group-arn "$line";
206210
done <<<"$(
207211
while read -r line; do
208212
if [ -z "$line" ]; then continue; fi
209-
aws elbv2 describe-tags --resource-arns $line | jq -r --arg id "$IDENTIFIER" '.TagDescriptions[] | select(any(.Tags[]; .Key == "Id" and .Value == $id)) | .ResourceArn // ""';
213+
aws elbv2 describe-tags --resource-arns "$line" | jq -r --arg id "$IDENTIFIER" '.TagDescriptions[] | select(any(.Tags[]; .Key == "Id" and .Value == $id)) | .ResourceArn // ""';
210214
done <<<"$(aws elbv2 describe-target-groups | jq -r '.TargetGroups[]?.TargetGroupArn')"
211215
)"
212216
sleep 10

0 commit comments

Comments
 (0)