Skip to content

Commit

Permalink
destroy command actually checks for empty state (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
YrrepNoj authored Mar 21, 2022
1 parent 4c0d1a2 commit e785ec8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cli/cmd/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ var destroyCmd = &cobra.Command{
// there will be no zarf-state to load and the struct will be empty. In these cases, if we can find
// the scripts to remove k3s, we will still try to remove a locally installed k3s cluster
state := k8s.LoadZarfState()
_ = os.Remove(".zarf-registry")

// If Zarf deployed the cluster, burn it all down
if state.ZarfAppliance || (state == types.ZarfState{Distro: k8s.DistroIsUnknown}) {
if state.ZarfAppliance || (state == types.ZarfState{}) {
// Check if we have the scripts to destory everything
fileInfo, err := os.Stat(config.ZarfCleanupScriptsPath)
if errors.Is(err, os.ErrNotExist) || !fileInfo.IsDir() {
Expand Down

0 comments on commit e785ec8

Please sign in to comment.