diff --git a/.github/actions/e2e/setup-cluster/action.yaml b/.github/actions/e2e/setup-cluster/action.yaml index 84414f41393f..5a78144a0d30 100644 --- a/.github/actions/e2e/setup-cluster/action.yaml +++ b/.github/actions/e2e/setup-cluster/action.yaml @@ -39,10 +39,11 @@ inputs: default: 'false' git_ref: description: "The git commit, tag, or branch to check out. Requires a corresponding Karpenter snapshot release" - required: false enable_local_zones: description: "Whether to include local zones in the VPC created for the cluster." - required: false + default: 'false' + cleanup: + description: "Whether to cleanup resources on failure" default: 'false' runs: using: "composite" @@ -86,6 +87,7 @@ runs: PRIVATE_CLUSTER: ${{ inputs.private_cluster }} GIT_REF: ${{ inputs.git_ref }} ENABLE_LOCAL_ZONES: ${{ inputs.enable_local_zones }} + CLEANUP: ${{ inputs.cleanup }} run: | if [[ "$GIT_REF" == '' ]]; then GIT_REF=$(git rev-parse HEAD) @@ -195,7 +197,12 @@ runs: yq -i '.managedNodeGroups[0].privateNetworking=true' clusterconfig.yaml fi - eksctl ${cmd} cluster -f clusterconfig.yaml + # Disable rollback of the CloudFormation on Create if we aren't cleaning up the run + if [[ $CLEANUP == 'false' ]] && [[ $cmd == 'create' ]]; then + eksctl ${cmd} cluster -f clusterconfig.yaml --cfn-disable-rollback + else + eksctl ${cmd} cluster -f clusterconfig.yaml + fi # Add the SQS and SSM VPC endpoints if we are creating a private cluster # We need to grab all of the VPC details for the cluster in order to add the endpoint diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index cf055d11735a..95cc85246409 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -137,6 +137,7 @@ jobs: prometheus_workspace_id: ${{ vars.WORKSPACE_ID }} prometheus_region: ${{ vars.PROMETHEUS_REGION }} enable_local_zones: ${{ inputs.suite == 'LocalZone' }} + cleanup: ${{ inputs.cleanup }} - name: run the ${{ inputs.suite }} test suite env: SUITE: ${{ inputs.suite }}