diff --git a/pkg/rke2/spw.go b/pkg/rke2/spw.go index 227074008a0..9cff1878173 100644 --- a/pkg/rke2/spw.go +++ b/pkg/rke2/spw.go @@ -130,14 +130,18 @@ func checkManifestDeployed(ctx context.Context, cRuntime runtimeapi.RuntimeServi // Use kubelet runtime logic to find the latest pod sandbox newSandboxNeeded, _, sandboxID := runtimeutil.PodSandboxChanged(pod, podStatus) + logrus.Infof("Checking pod sandbox for %s: newSandboxNeeded=%v sandboxID=%v", pod.Name, newSandboxNeeded, sandboxID) // Remove any pod sandboxes that are not the latest var sandboxRemoved bool for _, podSandbox := range resp.Items { - if podSandbox.Labels["io.kubernetes.pod.uid"] != string(pod.UID) || (sandboxID != "" && sandboxID != podSandbox.Id) { + if podSandbox.Labels["io.kubernetes.pod.uid"] != string(pod.UID) || + (sandboxID != "" && sandboxID != podSandbox.Id) { sandboxRemoved = true if _, err := cRuntime.RemovePodSandbox(ctx, &runtimeapi.RemovePodSandboxRequest{PodSandboxId: podSandbox.Id}); err != nil { logrus.Warnf("Failed to remove old %s pod sandbox: %v", pod.Name, err) + } else { + logrus.Infof("Removed old %s pod sandbox: %s (%v)", pod.Name, podSandbox.Id, podSandbox.State) } } }