From fa79d6ae6d06f76cf93e75082917c6172b707658 Mon Sep 17 00:00:00 2001 From: Amanuel Engeda Date: Thu, 14 Dec 2023 14:06:59 -0800 Subject: [PATCH] Add git_ref for no ref is mentioned --- .github/actions/e2e/setup-cluster/action.yaml | 10 +++++++++- .github/workflows/e2e.yaml | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/actions/e2e/setup-cluster/action.yaml b/.github/actions/e2e/setup-cluster/action.yaml index 6d3965e0ad67..8c66511eebf4 100644 --- a/.github/actions/e2e/setup-cluster/action.yaml +++ b/.github/actions/e2e/setup-cluster/action.yaml @@ -82,6 +82,10 @@ runs: PRIVATE_CLUSTER: ${{ inputs.private_cluster }} GIT_REF: ${{ inputs.git_ref }} run: | + if [[ "$GIT_REF" == '' ]]; then + GIT_REF = $(git rev-parse --short "$GITHUB_SHA") + fi + echo "$GIT_REF" # Create or Upgrade the cluster based on whether the cluster already exists cmd="create" eksctl get cluster --name "$CLUSTER_NAME" && cmd="upgrade" @@ -188,8 +192,12 @@ runs: env: ACCOUNT_ID: ${{ inputs.account_id }} CLUSTER_NAME: ${{ inputs.cluster_name }} - GIT_REF: ${{ inputs.git_ref }} + GIT_REF: ${{ inputs.git_ref }} run: | + if [[ "$GIT_REF" == '' ]]; then + GIT_REF = $(git rev-parse --short "$GITHUB_SHA") + fi + echo "$GIT_REF" oidc_id=$(aws eks describe-cluster --name "$CLUSTER_NAME" --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 3,4,5) arn="arn:aws:iam::$ACCOUNT_ID:oidc-provider/${oidc_id}" aws iam tag-open-id-connect-provider --open-id-connect-provider-arn $arn \ diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 4663ff732335..a97aaf1d8269 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -97,10 +97,10 @@ jobs: role-to-assume: arn:aws:iam::${{ vars.CI_ACCOUNT_ID }}:role/${{ vars.CI_ROLE_NAME }} aws-region: ${{ inputs.region }} role-duration-seconds: 21600 - - name: add jitter on cluster setup - run: | - # Creating jitter so that we can stagger cluster creation to avoid throttling - sleep $(( RANDOM % 300 + 1 )) + # - name: add jitter on cluster setup + # run: | + # # Creating jitter so that we can stagger cluster creation to avoid throttling + # sleep $(( RANDOM % 300 + 1 )) - id: generate-cluster-name name: generate cluster name env: