@@ -61,6 +61,8 @@ type ListKubeEventRequest struct {
Limit int `schema:"limit"`
Skip int `schema:"skip"`
+ Namespace string `schema:"namespace,omitempty"`
+
// can only be "timestamp" for now
SortBy string `schema:"sort_by"`
@@ -213,6 +213,13 @@ func (repo *KubeEventRepository) ListEventsByProjectID(
)
}
+ if listOpts.Namespace != "" && listOpts.Namespace != "ALL" {
+ query = query.Where(
+ "LOWER(namespace) = LOWER(?)",
+ listOpts.Namespace,
+ )
+ }
// get the count before limit and offset
var count int64