From d3f632612537cc4d6f85470438cc49ebfab5b3d5 Mon Sep 17 00:00:00 2001 From: Jason Deal Date: Thu, 5 Oct 2023 11:42:23 -0700 Subject: [PATCH] fix: use inputs for composite action (#4753) --- .github/actions/e2e/install-karpenter/action.yaml | 12 +++++++++--- .github/workflows/e2e-upgrade.yaml | 4 ++++ .github/workflows/e2e.yaml | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/actions/e2e/install-karpenter/action.yaml b/.github/actions/e2e/install-karpenter/action.yaml index 34261cd362a3..05e13ee4ebe6 100644 --- a/.github/actions/e2e/install-karpenter/action.yaml +++ b/.github/actions/e2e/install-karpenter/action.yaml @@ -10,6 +10,12 @@ inputs: region: description: "Region to access AWS" required: true + ecr_account_id: + description: "Account ID for the ECR repo" + required: true + ecr_region: + description: "Region for the ECR repo" + required: true cluster_name: description: 'Name of the cluster to be launched by eksctl' required: true @@ -37,13 +43,13 @@ runs: - name: login to ecr via docker uses: docker/login-action@v3 with: - registry: ${{ vars.ECR_ACCOUNT_ID }}.dkr.ecr.${{ vars.ECR_REGION }}.amazonaws.com + registry: ${{ inputs.ecr_account_id }}.dkr.ecr.${{ inputs.ecr_region }}.amazonaws.com logout: true - name: install-karpenter shell: bash run: | aws eks update-kubeconfig --name "${{ inputs.cluster_name }}" - helm upgrade --install karpenter oci://${{ vars.ECR_ACCOUNT_ID }}.dkr.ecr.${{ vars.ECR_REGION }}.amazonaws.com/karpenter/snapshot/karpenter \ + helm upgrade --install karpenter oci://${{ inputs.ecr_account_id }}.dkr.ecr.${{ inputs.ecr_region }}.amazonaws.com/karpenter/snapshot/karpenter \ -n karpenter \ --version "v0-$(git rev-parse HEAD)" \ --set serviceAccount.annotations."eks\.amazonaws\.com/role-arn"="arn:aws:iam::${{ inputs.account_id }}:role/karpenter-irsa-${{ inputs.cluster_name }}" \ @@ -69,6 +75,6 @@ runs: shell: bash run: | helm diff upgrade --namespace karpenter \ - karpenter oci://${{ vars.ECR_ACCOUNT_ID }}.dkr.ecr.${{ vars.ECR_REGION }}.amazonaws.com/karpenter/snapshot/karpenter \ + karpenter oci://${{ inputs.ecr_account_id }}.dkr.ecr.${{ inputs.ecr_region }}.amazonaws.com/karpenter/snapshot/karpenter \ --version v0-$(git rev-parse HEAD) \ --reuse-values --three-way-merge --detailed-exitcode diff --git a/.github/workflows/e2e-upgrade.yaml b/.github/workflows/e2e-upgrade.yaml index 3ec8e546424a..d0f7897b7414 100644 --- a/.github/workflows/e2e-upgrade.yaml +++ b/.github/workflows/e2e-upgrade.yaml @@ -104,6 +104,8 @@ jobs: account_id: ${{ vars.ACCOUNT_ID }} role: ${{ vars.ROLE_NAME }} region: ${{ inputs.region }} + ecr_account_id: ${{ vars.ECR_ACCOUNT_ID }} + ecr_region: ${{ vars.ECR_REGION }} cluster_name: ${{ env.CLUSTER_NAME }} git_ref: ${{ inputs.from_git_ref }} - uses: actions/checkout@v4 @@ -143,6 +145,8 @@ jobs: account_id: ${{ vars.ACCOUNT_ID }} role: ${{ vars.ROLE_NAME }} region: ${{ inputs.region }} + ecr_account_id: ${{ vars.ECR_ACCOUNT_ID }} + ecr_region: ${{ vars.ECR_REGION }} cluster_name: ${{ env.CLUSTER_NAME }} git_ref: ${{ inputs.to_git_ref }} - name: run the Upgrade test suite diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 06df993ab42d..e779c8782542 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -124,6 +124,8 @@ jobs: account_id: ${{ vars.ACCOUNT_ID }} role: ${{ vars.ROLE_NAME }} region: ${{ inputs.region }} + ecr_account_id: ${{ vars.ECR_ACCOUNT_ID }} + ecr_region: ${{ vars.ECR_REGION }} cluster_name: ${{ env.CLUSTER_NAME }} git_ref: ${{ inputs.git_ref }} - name: run the ${{ inputs.suite }} test suite