From a45c1fe48876b817c41e4b147872a6f0cb5b3a8e Mon Sep 17 00:00:00 2001 From: Jonathan Innis Date: Wed, 11 Oct 2023 12:46:17 -0700 Subject: [PATCH] ci: Ensure that instance profile creation and assignment is idempotent (#4798) --- .github/actions/e2e/create-cluster/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/e2e/create-cluster/action.yaml b/.github/actions/e2e/create-cluster/action.yaml index 8ad1c7428cc7..7c4ba3a42ee1 100644 --- a/.github/actions/e2e/create-cluster/action.yaml +++ b/.github/actions/e2e/create-cluster/action.yaml @@ -64,8 +64,8 @@ runs: - name: deploy alpha instance profile shell: bash run: | - aws iam create-instance-profile --instance-profile-name "KarpenterNodeInstanceProfile-${{ inputs.cluster_name }}" --tags Key=testing/type,Value=e2e Key=testing/cluster,Value=${{ inputs.cluster_name }} - aws iam add-role-to-instance-profile --instance-profile-name "KarpenterNodeInstanceProfile-${{ inputs.cluster_name }}" --role-name "KarpenterNodeRole-${{ inputs.cluster_name }}" + aws iam create-instance-profile --instance-profile-name "KarpenterNodeInstanceProfile-${{ inputs.cluster_name }}" --tags Key=testing/type,Value=e2e Key=testing/cluster,Value=${{ inputs.cluster_name }} || true + aws iam add-role-to-instance-profile --instance-profile-name "KarpenterNodeInstanceProfile-${{ inputs.cluster_name }}" --role-name "KarpenterNodeRole-${{ inputs.cluster_name }}" || true - name: deploy alpha policy shell: bash run: | @@ -77,7 +77,7 @@ runs: POLICY_DOCUMENT=$(envsubst < .github/actions/e2e/create-cluster/alpha-controller-policy.json) POLICY_NAME="KarpenterControllerPolicy-Alpha-${CLUSTER_NAME}" echo "Creating policy $POLICY_NAME..." - aws iam create-policy --policy-name "$POLICY_NAME" --policy-document "$POLICY_DOCUMENT" + aws iam create-policy --policy-name "$POLICY_NAME" --policy-document "$POLICY_DOCUMENT" || true - name: create or upgrade cluster shell: bash run: |