Skip to content

Commit

Permalink
Ignore CFN cleanup when flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Feb 19, 2024
1 parent ccbc1b0 commit e3f572e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/actions/e2e/setup-cluster/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit e3f572e

Please sign in to comment.