Skip to content

Commit

Permalink
Ensure WC is deleted even if App uninstall fails (#64)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Noble <[email protected]>
  • Loading branch information
AverageMarcus authored May 21, 2024
1 parent 49b54a5 commit c526c35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Ensure WC is always deleted during AfterSuite even if App uninstall fails
- Handle providers with consolidated default-apps

## [1.1.2] - 2024-05-20
Expand Down
11 changes: 7 additions & 4 deletions pkg/suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,17 @@ func (s *suite) Run(t *testing.T, suiteName string) {
})

AfterSuite(func() {
defer func() {
// We defer this to ensure it happens even if uninstalling the app fails
logger.Log("Deleting workload cluster")
err := teardown.New(state.GetFramework()).Teardown(state.GetCluster())
Expect(err).NotTo(HaveOccurred())
}()

app := getInstallApp()
logger.Log("Uninstalling App %s", app.AppName)
err := state.GetFramework().MC().DeleteApp(state.GetContext(), *app)
Expect(err).NotTo(HaveOccurred())

logger.Log("Deleting workload cluster")
err = teardown.New(state.GetFramework()).Teardown(state.GetCluster())
Expect(err).NotTo(HaveOccurred())
})

Describe("", func() {
Expand Down

0 comments on commit c526c35

Please sign in to comment.