Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Refactor cluster teardown in EKS package
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Rodriguez committed Oct 12, 2023
1 parent acc9e24 commit 0b68424
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/test-aws-init-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,7 @@ jobs:
- name: Teardown the cluster
if: always()
run: |
zarf package deploy build/zarf-package-distro-eks-multi-0.0.3.tar.zst \
--components=teardown-eks-cluster \
--set=EKS_CLUSTER_NAME=${{ inputs.cluster_name_private || 'zarf-init-aws-private-test' }} \
--confirm
run: zarf package remove build/zarf-package-distro-eks-multi-0.0.4.tar.zst --confirm

- name: Delete private ECR repositories
if: always()
Expand Down Expand Up @@ -253,11 +249,7 @@ jobs:
- name: Teardown the cluster
if: always()
run: |
zarf package deploy build/zarf-package-distro-eks-multi-0.0.3.tar.zst \
--components=teardown-eks-cluster \
--set=EKS_CLUSTER_NAME=${{ inputs.cluster_name_public || 'zarf-init-aws-public-test' }} \
--confirm
run: zarf package remove build/zarf-package-distro-eks-multi-0.0.4.tar.zst --confirm

- name: Delete public ECR repositories
if: always()
Expand Down
6 changes: 3 additions & 3 deletions packages/eks/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ metadata:
name: distro-eks
description: Deploy a EKS K8s cluster
architecture: multi
version: 0.0.3
version: 0.0.4

variables:
- name: EKS_CLUSTER_NAME
Expand Down Expand Up @@ -59,9 +59,9 @@ components:
- cmd: ./binaries/eksctl_$(uname -s)_$(uname -m) utils write-kubeconfig -c ${ZARF_VAR_EKS_CLUSTER_NAME}

- name: teardown-eks-cluster
description: Delete the EKS cluster that this package was used to create.
description: Delete the EKS cluster that this package was used to create
actions:
onDeploy:
onRemove:
before:
- cmd: ./binaries/eksctl_$(uname -s)_$(uname -m) delete cluster -f eks.yaml --disable-nodegroup-eviction --wait
after:
Expand Down

0 comments on commit 0b68424

Please sign in to comment.