Skip to content

Commit 53db08a

Browse files
Merge pull request #629 from darkdoc/fix_standalone_uninstall
fix: Re-add logic where we check for acm hub present
2 parents 5496c56 + 51900f8 commit 53db08a

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

internal/controller/pattern_controller.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,9 +788,17 @@ func (r *PatternReconciler) finalizeObject(instance *api.Pattern) error {
788788
// Initialize deletion phase if not set
789789
if qualifiedInstance.Status.DeletionPhase == api.InitializeDeletion {
790790
log.Printf("Initializing deletion phase")
791-
if err := r.updateDeletionPhase(qualifiedInstance, api.DeleteSpokeChildApps); err != nil {
792-
return err
791+
if haveACMHub(r) {
792+
if err := r.updateDeletionPhase(qualifiedInstance, api.DeleteSpokeChildApps); err != nil {
793+
return err
794+
}
795+
} else {
796+
// There is no acm/spoke, we can directly start cleaning up child apps (from hub)
797+
if err := r.updateDeletionPhase(qualifiedInstance, api.DeleteHubChildApps); err != nil {
798+
return err
799+
}
793800
}
801+
794802
return fmt.Errorf("initialized deletion phase, requeueing now")
795803
}
796804

0 commit comments

Comments
 (0)