uninstall: InstanceManager cleanup should happen after node removal
Longhorn 2919
@@ -388,13 +388,6 @@ func (c *UninstallController) deleteCRDs() (bool, error) {
return true, c.deleteEngineImages(engineImages)
}
- if instanceManagers, err := c.ds.ListInstanceManagers(); err != nil {
- return true, err
- } else if len(instanceManagers) > 0 {
- c.logger.Infof("Found %d instance managers remaining", len(instanceManagers))
- return true, c.deleteInstanceManagers(instanceManagers)
- }
-
if backingImages, err := c.ds.ListBackingImages(); err != nil {
return true, err
} else if len(backingImages) > 0 {
@@ -458,6 +451,13 @@ func (c *UninstallController) deleteCRDs() (bool, error) {
return true, c.deleteNodes(nodes)
}
+ if instanceManagers, err := c.ds.ListInstanceManagers(); err != nil {
+ return true, err
+ } else if len(instanceManagers) > 0 {
+ c.logger.Infof("Found %d instance managers remaining", len(instanceManagers))
+ return true, c.deleteInstanceManagers(instanceManagers)
+ }
+
return false, nil
}
