mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Fixed an issue on searching events by a given fieldSelector. The issue break
the events reported for kubectl describe pods completely. Fixed #5957
This commit is contained in:
parent
dc0fdcc6f4
commit
ab0e9f1d41
@ -146,12 +146,17 @@ func (e *events) Search(objOrRef runtime.Object) (*api.EventList, error) {
|
||||
if e.namespace != "" && ref.Namespace != e.namespace {
|
||||
return nil, fmt.Errorf("won't be able to find any events of namespace '%v' in namespace '%v'", ref.Namespace, e.namespace)
|
||||
}
|
||||
stringRefKind := string(ref.Kind)
|
||||
var refKind *string
|
||||
if stringRefKind != "" {
|
||||
refKind = &stringRefKind
|
||||
}
|
||||
stringRefUID := string(ref.UID)
|
||||
var refUID *string
|
||||
if stringRefUID != "" {
|
||||
refUID = &stringRefUID
|
||||
}
|
||||
fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, &ref.Kind, refUID)
|
||||
fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID)
|
||||
return e.List(labels.Everything(), fieldSelector)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user