summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/events.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/handlers/compat/events.go')
-rw-r--r--pkg/api/handlers/compat/events.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go
index f74491a8f..82a74e419 100644
--- a/pkg/api/handlers/compat/events.go
+++ b/pkg/api/handlers/compat/events.go
@@ -33,6 +33,8 @@ func filtersFromRequest(r *http.Request) ([]string, error) {
if _, found := r.URL.Query()["filters"]; found {
raw = []byte(r.Form.Get("filters"))
+ } else if _, found := r.URL.Query()["Filters"]; found {
+ raw = []byte(r.Form.Get("Filters"))
} else {
return []string{}, nil
}
@@ -73,7 +75,7 @@ func GetEvents(w http.ResponseWriter, r *http.Request) {
)
// NOTE: the "filters" parameter is extracted separately for backwards
- // compat via `fitlerFromRequest()`.
+ // compat via `filterFromRequest()`.
query := struct {
Since string `schema:"since"`
Until string `schema:"until"`
@@ -95,7 +97,6 @@ func GetEvents(w http.ResponseWriter, r *http.Request) {
utils.Error(w, "failed to parse parameters", http.StatusBadRequest, errors.Wrapf(err, "failed to parse parameters for %s", r.URL.String()))
return
}
-
eventChannel := make(chan *events.Event)
errorChannel := make(chan error)
@@ -110,6 +111,7 @@ func GetEvents(w http.ResponseWriter, r *http.Request) {
Until: query.Until,
}
errorChannel <- runtime.Events(r.Context(), readOpts)
+
}()
var flush = func() {}
@@ -130,8 +132,8 @@ func GetEvents(w http.ResponseWriter, r *http.Request) {
if err != nil {
// FIXME StatusOK already sent above cannot send 500 here
utils.InternalServerError(w, err)
- return
}
+ return
case evt := <-eventChannel:
if evt == nil {
continue