From 0b68424a146d6eed2d37d4e20f37891533dfe984 Mon Sep 17 00:00:00 2001 From: Lucas Rodriguez Date: Thu, 12 Oct 2023 15:30:15 -0500 Subject: [PATCH] Refactor cluster teardown in EKS package --- .github/workflows/test-aws-init-package.yml | 12 ++---------- packages/eks/zarf.yaml | 6 +++--- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-aws-init-package.yml b/.github/workflows/test-aws-init-package.yml index b4552d8..4594006 100644 --- a/.github/workflows/test-aws-init-package.yml +++ b/.github/workflows/test-aws-init-package.yml @@ -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() @@ -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() diff --git a/packages/eks/zarf.yaml b/packages/eks/zarf.yaml index a5f01eb..3f624a0 100644 --- a/packages/eks/zarf.yaml +++ b/packages/eks/zarf.yaml @@ -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 @@ -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: