@@ -52,4 +52,6 @@ type ListKubeEventRequest struct {
OwnerType string `schema:"owner_type"`
OwnerName string `schema:"owner_name"`
+
+ ResourceType string `schema:"resource_type"`
}
@@ -153,6 +153,13 @@ func (repo *KubeEventRepository) ListEventsByProjectID(
)
+ if listOpts.ResourceType != "" {
+ query = query.Where(
+ "resource_type = ?",
+ listOpts.ResourceType,
+ )
+ }
query = query.Limit(listOpts.Limit).Offset(listOpts.Skip)
if listOpts.SortBy == "timestamp" {