Relax search criteria to find both pod & bound pod events

This commit is contained in:
Daniel Smith
2014-11-24 15:17:28 -08:00
parent 6b009f06cd
commit 3b2fa9618d
2 changed files with 21 additions and 9 deletions

View File

@@ -66,7 +66,6 @@ func (d *PodDescriber) Describe(namespace, name string) (string, error) {
labels.Everything(),
labels.Set{
"involvedObject.name": name,
"involvedObject.kind": "Pod",
"involvedObject.namespace": namespace,
}.AsSelector(),
)
@@ -86,7 +85,13 @@ func (d *PodDescriber) Describe(namespace, name string) (string, error) {
glog.Errorf("Unable to convert pod manifest: %v", err)
}
events, _ := d.Events(namespace).Search(pod)
var events *api.EventList
if ref, err := api.GetReference(pod); err != nil {
glog.Errorf("Unable to construct reference to '%#v': %v", pod, err)
} else {
ref.Kind = "" // Find BoundPod objects, too!
events, _ = d.Events(namespace).Search(ref)
}
return tabbedString(func(out io.Writer) error {
fmt.Fprintf(out, "Name:\t%s\n", pod.Name)