Skip to content

Commit f99728e

Browse files
authored
Merge pull request kubernetes#74156 from gaorong/descirbe-mirror-pod
kubectl: fix a bug where "describe" cannot obtain the event messages for a static pod
2 parents fed00de + 5efbdb0 commit f99728e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/kubectl/describe/versioned/describe.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@ func (d *PodDescriber) Describe(namespace, name string, describerSettings descri
642642
klog.Errorf("Unable to construct reference to '%#v': %v", pod, err)
643643
} else {
644644
ref.Kind = ""
645+
if _, isMirrorPod := pod.Annotations[corev1.MirrorPodAnnotationKey]; isMirrorPod {
646+
ref.UID = types.UID(pod.Annotations[corev1.MirrorPodAnnotationKey])
647+
}
645648
events, _ = d.Core().Events(namespace).Search(scheme.Scheme, ref)
646649
}
647650
}

0 commit comments

Comments
 (0)