Commit 9d0b999e authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #39327 from shashidharatd/federation

Automatic merge from submit-queue (batch tested with PRs 39475, 38666, 39327, 38396, 39613) Fix a bug in cascading deletion of federation objects When FinalizerOrphan is present and set to true in federated object we are currently removing the FinalizerOrphan first and then removing FinalizerDeleteFromUnderlyingClusters. if a reconciliation is triggered in between the finalizer removals, it has undesired effect of object deletion in federated cluster. So we should remove FinalizerDeleteFromUnderlyingClusters first and then remove FinalizerOrphan, when FinalizerOrphan is set to true. @nikhiljindal, @madhusudancs
parents 931bccf9 52659000
...@@ -126,11 +126,11 @@ func (dh *DeletionHelper) HandleObjectInUnderlyingClusters(obj runtime.Object) ( ...@@ -126,11 +126,11 @@ func (dh *DeletionHelper) HandleObjectInUnderlyingClusters(obj runtime.Object) (
// If the obj has FinalizerOrphan finalizer, then we need to orphan the // If the obj has FinalizerOrphan finalizer, then we need to orphan the
// corresponding objects in underlying clusters. // corresponding objects in underlying clusters.
// Just remove both the finalizers in that case. // Just remove both the finalizers in that case.
obj, err := dh.removeFinalizerFunc(obj, api_v1.FinalizerOrphan) obj, err := dh.removeFinalizerFunc(obj, FinalizerDeleteFromUnderlyingClusters)
if err != nil { if err != nil {
return obj, err return obj, err
} }
return dh.removeFinalizerFunc(obj, FinalizerDeleteFromUnderlyingClusters) return dh.removeFinalizerFunc(obj, api_v1.FinalizerOrphan)
} }
glog.V(2).Infof("Deleting obj %s from underlying clusters", objName) glog.V(2).Infof("Deleting obj %s from underlying clusters", objName)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment