Skip to content

Commit

Permalink
fix: delete daemonset's pod in vitural node
Browse files Browse the repository at this point in the history
Signed-off-by: renxiangyu <[email protected]>
  • Loading branch information
renxiangyu committed Dec 8, 2023
1 parent 03f7523 commit 2e473f5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ func (r *RootPodReconciler) SetupWithManager(mgr manager.Manager) error {
return true
}
}
_, has := p.Annotations[utils.KosmosNodeOwnedByClusterAnnotations]
if (!p.DeletionTimestamp.IsZero()) && (strings.HasPrefix(p.Spec.NodeName, utils.KosmosNodePrefix) || has) {
return true
}
return false
}
}
Expand Down Expand Up @@ -805,7 +809,7 @@ func (r *RootPodReconciler) DeletePodInLeafCluster(ctx context.Context, lr *leaf
leafPod := &corev1.Pod{}

cleanRootPodFunc := func() error {
return DeletePodInRootCluster(ctx, rootnamespacedname, r.Client)
return DeletePodInRootCluster(ctx, rootnamespacedname, r.RootClient)
}

err := lr.Client.Get(ctx, rootnamespacedname, leafPod)
Expand Down

0 comments on commit 2e473f5

Please sign in to comment.