From b8df11ec434e4a7fbb2590435ad11defff2129b9 Mon Sep 17 00:00:00 2001 From: Fabian Ruff Date: Thu, 20 Feb 2020 14:24:32 +0100 Subject: [PATCH] Ensure we only list events for Kluster kinds. --- pkg/api/handlers/get_cluster_events.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/api/handlers/get_cluster_events.go b/pkg/api/handlers/get_cluster_events.go index 59bb760e3c..842aef2307 100644 --- a/pkg/api/handlers/get_cluster_events.go +++ b/pkg/api/handlers/get_cluster_events.go @@ -20,7 +20,8 @@ type getClusterEvents struct { func (d *getClusterEvents) Handle(params operations.GetClusterEventsParams, principal *models.Principal) middleware.Responder { eventsInterface := d.Kubernetes.Core().Events(d.Namespace) klusterName := qualifiedName(params.Name, principal.Account) - selector := eventsInterface.GetFieldSelector(&klusterName, &d.Namespace, nil, nil) + kind := "Kluster" + selector := eventsInterface.GetFieldSelector(&klusterName, &d.Namespace, &kind, nil) kEvents, err := eventsInterface.List(metav1.ListOptions{FieldSelector: selector.String()}) if err != nil { return NewErrorResponse(&operations.GetClusterEventsDefault{}, 500, err.Error())