Unverified Commit f99728e6 authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #74156 from gaorong/descirbe-mirror-pod

kubectl: fix a bug where "describe" cannot obtain the event messages for a static pod
parents fed00de9 5efbdb02
......@@ -642,6 +642,9 @@ func (d *PodDescriber) Describe(namespace, name string, describerSettings descri
klog.Errorf("Unable to construct reference to '%#v': %v", pod, err)
} else {
ref.Kind = ""
if _, isMirrorPod := pod.Annotations[corev1.MirrorPodAnnotationKey]; isMirrorPod {
ref.UID = types.UID(pod.Annotations[corev1.MirrorPodAnnotationKey])
}
events, _ = d.Core().Events(namespace).Search(scheme.Scheme, ref)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment