'Event' cannot filterby anything
What happened?
When I curl /api/v1/event/default?filterBy=name,computenode2-xxxxxx. I notice that there is no filtering or selection applied. I can still see events with names starting with computenode1-xxxx
And I checked the code and found out there is indeed no filtering action when selecting the events.
https://github.com/kubernetes/dashboard/blob/2e89a34cbdc951e989318b5b26826a4a195e8e53/modules/api/pkg/resource/event/common.go#L234C2-L240C2
func CreateEventList(events []v1.Event, dsQuery *dataselect.DataSelectQuery) common.EventList {
eventList := common.EventList{
Events: make([]common.Event, 0),
ListMeta: types.ListMeta{TotalItems: len(events)},
}
events = fromCells(dataselect.GenericDataSelect(toCells(events), dsQuery))
for _, event := range events {
eventDetail := ToEvent(event)
eventList.Events = append(eventList.Events, eventDetail)
}
return eventList
}
func GenericDataSelect(dataList []DataCell, dsQuery *DataSelectQuery) []DataCell {
SelectableData := DataSelector{
GenericDataList: dataList,
DataSelectQuery: dsQuery,
}
return SelectableData.Sort().Paginate().GenericDataList
}
Is there any particular consideration behind this design? Why does the event not support filtering?
What did you expect to happen?
'Event' can be filterBy attributes such as name, namespace, etc.
How can we reproduce it (as minimally and precisely as possible)?
try to curl /api/v1/event?filterBy=name,XXX, you’ll find that no filtering is applied at all.
Anything else we need to know?
No response
What browsers are you seeing the problem on?
No response
Kubernetes Dashboard version
api images: dashboard-api:1.10.1
Kubernetes version
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.4", GitCommit:"95ee5ab382d64cfe6c28967f36b53970b8374491", GitTreeState:"clean", BuildDate:"2022-08-17T18:54:23Z", GoVersion:"go1.18.5", Compiler:"gc", Platform:"linux/amd64"} Kustomize Version: v4.5.4 Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.4", GitCommit:"95ee5ab382d64cfe6c28967f36b53970b8374491", GitTreeState:"clean", BuildDate:"2022-08-17T18:47:37Z", GoVersion:"go1.18.5", Compiler:"gc", Platform:"linux/amd64"}
Dev environment
No response
There is no reason behind this. It was simply not implemented. You are welcome to create a PR to add it.
Thanks for the reply. I will create a PR to add this feature.
I have created a PR for this issue, could you please review it for me? @floreks
This is my first time contributing to this project, so please let me know if there is anything that needs improvement.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle stale - Close this issue with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle rotten - Close this issue with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Reopen this issue with
/reopen - Mark this issue as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou can:
- Reopen this issue with
/reopen- Mark this issue as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.