From c18905f5ec0070d1da15795b4a84472c5397fccf Mon Sep 17 00:00:00 2001 From: Amanuel Engeda Date: Fri, 4 Aug 2023 15:22:33 -0700 Subject: [PATCH] remove OIDC tagging --- .../actions/e2e/create-cluster/action.yaml | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/actions/e2e/create-cluster/action.yaml b/.github/actions/e2e/create-cluster/action.yaml index ef9841ff5369..f255044a0c3f 100644 --- a/.github/actions/e2e/create-cluster/action.yaml +++ b/.github/actions/e2e/create-cluster/action.yaml @@ -125,18 +125,14 @@ runs: wellKnownPolicies: ebsCSIController: true EOF - - name: tag oidc provider of the cluster - if: always() - shell: bash - run: | - for arn in $(aws iam list-open-id-connect-providers --query "OpenIDConnectProviderList[*].{ARN:Arn}" --output text); do - tags=$(aws iam list-open-id-connect-provider-tags --open-id-connect-provider-arn $arn --output json) - if [[ $(echo $tags | jq -r '.Tags[] | select(.Key == "alpha.eksctl.io/cluster-name") | .Value') == "${{ inputs.cluster_name }}" ]]; then - aws iam tag-open-id-connect-provider --open-id-connect-provider-arn $arn \ - --tags Key=testing.karpenter.sh/type,Value=e2e Key=github.com/run-url,Value=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - break - fi - done + - name: tag oidc provider of the cluster + if: always() + shell: bash + run: | + oidc_id=$(aws eks describe-cluster --name ${{ inputs.cluster_name }} --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 3,4,5) + arn=arn:aws:iam::857221689048:oidc-provider/${oidc_id} + aws iam tag-open-id-connect-provider --open-id-connect-provider-arn $arn \ + --tags Key=testing.karpenter.sh/type,Value=e2e Key=github.com/run-url,Value=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - name: give KarpenterNodeRole permission to bootstrap shell: bash run: |