Skip to content

Commit

Permalink
[fixup] head bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Dec 13, 2024
1 parent f6e5c90 commit fa9d831
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/scripts/e2e_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,14 @@ log_and_run kubectl delete -f cosi-examples/bucketclaim-deletion-policy.yaml

log_and_run echo "Verifying bucket deletion with name '$BUCKET_TO_BE_DELETED'..."

BUCKET_HEAD_RESULT=$(aws --endpoint-url "$S3_ENDPOINT" s3api head-bucket --bucket "$BUCKET_TO_BE_DELETED" --retry-mode standard --max-attempts $ATTEMPTS --delay $DELAY 2>&1 || true)

# Check if the bucket has been deleted
log_and_run aws s3 ls --endpoint-url "$S3_ENDPOINT"
BUCKET_HEAD_RESULT=$(log_and_run AWS_MAX_ATTEMPTS=$ATTEMPTS AWS_RETRY_DELAY=$DELAY aws --endpoint-url "$S3_ENDPOINT" s3api head-bucket --bucket "$BUCKET_TO_BE_DELETED" --profile iam 2>&1 || true)

# Check if the result contains the "Not Found" error message
if [[ "$BUCKET_HEAD_RESULT" == *"Not Found"* ]]; then
log_and_run echo "Bucket with name '$BUCKET_TO_BE_DELETED' not found. Bucket deletion successful."
log_and_run echo "Bucket with name '$BUCKET_TO_BE_DELETED' was successfully deleted (Not Found error)."
else
log_and_run echo "Bucket with name '$BUCKET_TO_BE_DELETED' was not deleted after $ATTEMPTS attempts."
exit 1
fi

log_and_run echo "Bucket deletion verified successfully."

log_and_run echo "All verifications for object-storage-access-secret passed successfully."

0 comments on commit fa9d831

Please sign in to comment.