Further Improvements for Cilium Alerts within KAS/AgentK
What does this MR do?
-
Refactor existsLabelsInEndpointSelector()
to accept theEndpointSelector
type instead of string -
Refactor Switch CiliumNetworkPolicies(ns).List(ctx, metav1.ListOptions{})
to an informer in order to avoid the expensive calls.
Testing
Tested locally and received alerts as expected:
{"level":"info","time":"2021-03-22T15:18:48.053+1100","msg":"successful response when creating alerts from cilium_alert endpoint","mod_name":"cilium_alert","status_code":200}
TODO
-
Fix broken tests -
Use NewFilteredCiliumNetworkPolicyInformer
instead ofNewCiliumNetworkPolicyInformer
so we can providetweakListOptions
-
Add more tests
What are the relevant issue numbers?
Edited by Adam Cohen