Skip to content

Commit

Permalink
ci: Handle Multiple Clean-up Script (aws#4369)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Aug 3, 2023
1 parent 00dd643 commit be60e26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/actions/e2e/cleanup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
shell:
run: |
for name in $(aws iam list-instance-profiles --query "InstanceProfiles[*].{Name:InstanceProfileName}" --output text); do
tags=$(aws iam list-instance-profile-tags --instance-profile-name $name --output json)
tags=$(aws iam list-instance-profile-tags --instance-profile-name $name --output json || true)
if [[ $(echo $tags | jq -r '.Tags[] | select(.Key == "testing.karpenter.sh/cluster") | .Value') == "${{ inputs.cluster_name }}" ]]; then
roleName=$(aws iam get-instance-profile --instance-profile-name $name --query "InstanceProfile.Roles[*].{Name:RoleName}" --output text)
aws iam remove-role-from-instance-profile --instance-profile-name $name --role-name $roleName
Expand Down

0 comments on commit be60e26

Please sign in to comment.