Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
Signed-off-by: trafalgarzzz <[email protected]>
  • Loading branch information
TrafalgarZZZ committed Aug 10, 2023
1 parent df4988e commit 3f2a789
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions pkg/ddc/thin/shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,14 @@ func (t *ThinEngine) destroyMaster() (err error) {
if err != nil {
return
}
return
}

// When upgrade Fluid to v1.0.0+ from a lower version, there may be some orphaned configmaps when deleting a ThinRuntime if it's created before the upgradation.
// Detect such orphaned configmaps and clean them up.
err = t.cleanUpOrphanedResources()
if err != nil {
t.Log.Info("WARNING: failed to delete orphaned resource, some resources may not be cleaned up in the cluster", "err", err)
err = nil
} else {
// When upgrade Fluid to v1.0.0+ from a lower version, there may be some orphaned configmaps when deleting a ThinRuntime if it's created before the upgradation.
// Detect such orphaned configmaps and clean them up.
err = t.cleanUpOrphanedResources()
if err != nil {
t.Log.Info("WARNING: failed to delete orphaned resource, some resources may not be cleaned up in the cluster", "err", err)
err = nil
}
}

return
Expand Down

0 comments on commit 3f2a789

Please sign in to comment.