mirror of https://github.com/k3s-io/k3s
Merge pull request #74156 from gaorong/descirbe-mirror-pod
kubectl: fix a bug where "describe" cannot obtain the event messages for a static podpull/564/head
commit
f99728e6f3
|
@ -642,6 +642,9 @@ func (d *PodDescriber) Describe(namespace, name string, describerSettings descri
|
||||||
klog.Errorf("Unable to construct reference to '%#v': %v", pod, err)
|
klog.Errorf("Unable to construct reference to '%#v': %v", pod, err)
|
||||||
} else {
|
} else {
|
||||||
ref.Kind = ""
|
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)
|
events, _ = d.Core().Events(namespace).Search(scheme.Scheme, ref)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue