Skip to content

Commit 2ee063d

Browse files
authored
Merge pull request kubernetes#130667 from Chulong-Li/fix
Adjust the test logic on TestGetStaticPodToMirrorPodMap
2 parents 6bc352f + 3701f87 commit 2ee063d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/kubelet/pod/pod_manager_test.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,11 @@ func TestGetStaticPodToMirrorPodMap(t *testing.T) {
302302
if len(m) != 1 {
303303
t.Fatalf("GetStaticPodToMirrorPodMap(): got %d static pods, wanted 1 static pod", len(m))
304304
}
305-
if gotMirrorPod, ok := m[staticPod]; !ok || gotMirrorPod.UID != mirrorPod.UID {
306-
t.Fatalf("GetStaticPodToMirrorPodMap() did not return the correct mirror pod UID %s, wanted mirror pod UID %s", gotMirrorPod.UID, mirrorPod.UID)
305+
gotMirrorPod, ok := m[staticPod]
306+
if !ok {
307+
t.Fatalf("GetStaticPodToMirrorPodMap(): mirror pod not found for staticPod %v", staticPod)
308+
}
309+
if gotMirrorPod.UID != mirrorPod.UID {
310+
t.Fatalf("GetStaticPodToMirrorPodMap(): got UID %s, want %s", gotMirrorPod.UID, mirrorPod.UID)
307311
}
308312
}

0 commit comments

Comments
 (0)