Skip to content

Commit 000f8cb

Browse files
authored
Tear down operator sequentially after Central/SecuredCluster (#96)
1 parent 0d79309 commit 000f8cb

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

internal/deployer/deployer.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -687,18 +687,16 @@ func (d *Deployer) Teardown(ctx context.Context, components component.Component)
687687
}
688688
}()
689689

690-
// For 'all', also tear down the operator in parallel
690+
wg.Wait()
691+
692+
// Tear down the operator strictly after Central/SecuredCluster are gone,
693+
// because the operator manages finalizers on their custom resources.
691694
if components == component.All {
692-
wg.Add(1)
693-
go func() {
694-
defer wg.Done()
695-
if err := d.teardownOperator(ctx); err != nil {
696-
d.logger.Warningf("Error tearing down operator: %v", err)
697-
}
698-
}()
695+
if err := d.teardownOperator(ctx); err != nil {
696+
d.logger.Warningf("Error tearing down operator: %v", err)
697+
}
699698
}
700699

701-
wg.Wait()
702700
return nil
703701
default:
704702
return fmt.Errorf("unknown component: %s", components)

0 commit comments

Comments
 (0)