Skip to content

Commit

Permalink
feat: Add cloudformation describe stack step on create cluster failure (
Browse files Browse the repository at this point in the history
#4556)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
aman0408 and dependabot[bot] committed Sep 8, 2023
1 parent 0563f1e commit dc0e340
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/actions/e2e/create-cluster/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ runs:
--template-file $CLOUDFORMATION_PATH \
--capabilities CAPABILITY_NAMED_IAM \
--parameter-overrides "ClusterName=${{ inputs.cluster_name }}" \
--tags "testing.karpenter.sh/type=e2e" "github.com/run-url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
--tags "testing.karpenter.sh/type=e2e" "github.com/run-url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" "karpenter.sh/discovery=${{ inputs.cluster_name }}"
- name: create or upgrade cluster
shell: bash
run: |
Expand Down Expand Up @@ -141,4 +141,13 @@ runs:
--cluster "${{ inputs.cluster_name }}" \
--arn "arn:aws:iam::${{ inputs.account_id }}:role/KarpenterNodeRole-${{ inputs.cluster_name }}" \
--group system:bootstrappers \
--group system:nodes
--group system:nodes
- name: cloudformation describe stack events
shell: bash
if: failure()
run: |
stack_names=$(aws cloudformation describe-stacks --query 'Stacks[?Tags[?Key == `karpenter.sh/discovery` && Value == `${{ inputs.CLUSTER_NAME }}`]].{StackName: StackName}' --output text)
for stack_name in $stack_names; do
echo "Stack Events for $stack_name:"
aws cloudformation describe-stack-events --stack-name $stack_name
done

0 comments on commit dc0e340

Please sign in to comment.