Skip to content

Commit

Permalink
pipeline fix for 1.26 k8s, delete policy and role
Browse files Browse the repository at this point in the history
Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>
  • Loading branch information
vivekr-splunk committed Aug 22, 2023
1 parent 2705829 commit 981b95c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/deploy-eks-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ function deleteCluster() {
return 1
fi
rolename=$(echo ${TEST_CLUSTER_NAME} | awk -F- '{print "EBS_" $(NF-1) "_" $(NF)}')
role_attached_policies=$(aws iam list-attached-role-policies --role-name $rolename --query 'AttachedPolicies[*].PolicyArn' --output text)
for policy_arn in ${role_attached_policies};
do
aws iam detach-role-policy --role-name ${rolename} --policy-arn ${policy_arn}
done

aws iam delete-role --role-name ${rolename}

return 0
Expand Down

0 comments on commit 981b95c

Please sign in to comment.