diff --git a/.github/actions/e2e/cleanup/action.yaml b/.github/actions/e2e/cleanup/action.yaml index ea6a5cf86fbb..c5d56a871294 100644 --- a/.github/actions/e2e/cleanup/action.yaml +++ b/.github/actions/e2e/cleanup/action.yaml @@ -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