kubelet: Convert IsMirrorOf to a function

Shrinks the PodManager interface by one method, no abstraction is
necessary here.
This commit is contained in:
Clayton Coleman
2023-01-23 20:37:31 -05:00
parent 02960a8253
commit f8086f2dac
3 changed files with 3 additions and 19 deletions

View File

@@ -1823,7 +1823,7 @@ func (kl *Kubelet) SyncPod(ctx context.Context, updateType kubetypes.SyncPodType
if kubetypes.IsStaticPod(pod) {
deleted := false
if mirrorPod != nil {
if mirrorPod.DeletionTimestamp != nil || !kl.podManager.IsMirrorPodOf(mirrorPod, pod) {
if mirrorPod.DeletionTimestamp != nil || !kubepod.IsMirrorPodOf(mirrorPod, pod) {
// The mirror pod is semantically different from the static pod. Remove
// it. The mirror pod will get recreated later.
klog.InfoS("Trying to delete pod", "pod", klog.KObj(pod), "podUID", mirrorPod.ObjectMeta.UID)