Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zarf destroy doesn't run zarf-clean-* scripts anymore #2268

Closed
WeaponX314 opened this issue Jan 29, 2024 · 1 comment · Fixed by #2274
Closed

zarf destroy doesn't run zarf-clean-* scripts anymore #2268

WeaponX314 opened this issue Jan 29, 2024 · 1 comment · Fixed by #2274
Labels
bug 🐞 Something isn't working
Milestone

Comments

@WeaponX314
Copy link
Contributor

Environment

Device and OS: linux/amd64
App version: 0.32.3
Kubernetes distro being used: k3s
Other:

Steps to reproduce

  1. Init k3s:
# zarf init --components k3s --confirm
  1. After install, destroy it.
# zarf destroy --confirm

Expected result

Expect the cluster to be torn down + /opt/zarf/zarf-clean-* scripts to be run

Actual Result

Tear down begins to take place, but the zarf-clean script is not run

Visual Proof (screenshots, videos, text, etc)

Begin install, command use:

[root@node1 test]# zarf init --components k3s --confirm

NOTE Saving log file to /tmp/zarf-2024-01-29-16-52-12-334353752.log

... snip standard zarf k3s install continues, removing for clarity...

📦 ZARF-AGENT COMPONENT

✔ Pushed 1 images to the zarf registry
✔ Starting helm chart generation zarf-agent
✔ Processing helm chart raw-init-zarf-agent-zarf-agent:0.1.1706565132 from Zarf-generated helm chart
✔ Wait for "./zarf tools wait-for pod app=agent-hook Ready -n zarf --..." succeeded
✔ Zarf deployment complete

 Application          | Username  | Password                 | Connect               | Get-Creds Key
 Registry             | zarf-push | fOFO0rs9jAqpnm1nNigjilHF | zarf connect registry | registry
 Registry (read-only) | zarf-pull | s6GWr0AyJ!xZpkuICegdcgf2 | zarf connect registry | registry-readonly

[root@node1 test]# zarf destroy --confirm

NOTE Saving log file to /tmp/zarf-2024-01-29-17-00-04-622128922.log
✔ Waiting for cluster connection (30s timeout)

WARNING Unable to uninstall the chart
✔ Removing Zarf-installed charts
⠋ Deleting the zarf namespace from this cluster (6s)
✔ Removing zarf metadata & secrets from existing namespaces not managed by Zarf

[root@node1 test]#

Severity/Priority

Additional Context

Add any other context or screenshots about the technical debt here.

@WeaponX314
Copy link
Contributor Author

Just adding my thoughts when looking at cmd/destroy.go:
I didn't poke too deeply, but it looked like it was following the "else" path. Somehow, it determined that it was NOT deployed by zarf and did not need to "burn it all down" as the comment suggests :).
Perhaps a state not being reported correctly?

@Racer159 Racer159 added the bug 🐞 Something isn't working label Jan 31, 2024
@Racer159 Racer159 added this to the (2024.02.06) milestone Jan 31, 2024
Racer159 added a commit that referenced this issue Jan 31, 2024
## Description

This fixes ApplianceMode not being set and not triggering destroy
scripts.

## Related Issue

Fixes #2268
Relates to #2275 

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
@github-project-automation github-project-automation bot moved this from New to Closed in Zarf Project Board Jan 31, 2024
daniel-palmer-gu pushed a commit to daniel-palmer-gu/zarf that referenced this issue Feb 3, 2024
## Description

This fixes ApplianceMode not being set and not triggering destroy
scripts.

## Related Issue

Fixes zarf-dev#2268
Relates to zarf-dev#2275 

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants