Skip to content

Commit

Permalink
Ensure we only list events for Kluster kinds.
Browse files Browse the repository at this point in the history
  • Loading branch information
databus23 committed Feb 20, 2020
1 parent 38e5c9c commit b8df11e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/api/handlers/get_cluster_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit b8df11e

Please sign in to comment.