Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions internal/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,18 +687,16 @@ func (d *Deployer) Teardown(ctx context.Context, components component.Component)
}
}()

// For 'all', also tear down the operator in parallel
wg.Wait()

// Tear down the operator strictly after Central/SecuredCluster are gone,
// because the operator manages finalizers on their custom resources.
if components == component.All {
wg.Add(1)
go func() {
defer wg.Done()
if err := d.teardownOperator(ctx); err != nil {
d.logger.Warningf("Error tearing down operator: %v", err)
}
}()
if err := d.teardownOperator(ctx); err != nil {
d.logger.Warningf("Error tearing down operator: %v", err)
}
}

wg.Wait()
return nil
default:
return fmt.Errorf("unknown component: %s", components)
Expand Down
Loading