Skip to content

Commit

Permalink
ci: Ensure that instance profile creation and assignment is idempotent (
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Oct 11, 2023
1 parent f04c64e commit a45c1fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/actions/e2e/create-cluster/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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: |
Expand Down

0 comments on commit a45c1fe

Please sign in to comment.