update execution order for share manager crd in uninstall controller
update execution order for share manager crd in uninstall controller to resolve ticket '[BUG] uninstall-controller does not cleanup share-manager'
@@ -325,13 +325,6 @@ func (c *UninstallController) deleteLease() error {
}
func (c *UninstallController) deleteCRDs() (bool, error) {
- if shareManagers, err := c.ds.ListShareManagers(); err != nil {
- return true, err
- } else if len(shareManagers) > 0 {
- c.logger.Infof("Found %d share managers remaining", len(shareManagers))
- return true, c.deleteShareManagers(shareManagers)
- }
-
if volumes, err := c.ds.ListVolumes(); err != nil {
return true, err
} else if len(volumes) > 0 {
@@ -374,6 +367,13 @@ func (c *UninstallController) deleteCRDs() (bool, error) {
return true, c.deleteBackingImages(backingImages)
}
+ if shareManagers, err := c.ds.ListShareManagers(); err != nil {
+ return true, err
+ } else if len(shareManagers) > 0 {
+ c.logger.Infof("Found %d share managers remaining", len(shareManagers))
+ return true, c.deleteShareManagers(shareManagers)
+ }
+
if nodes, err := c.ds.ListNodes(); err != nil {
return true, err
} else if len(nodes) > 0 {
