Skip to content

Further Improvements for Cilium Alerts within KAS/AgentK

Adam Cohen requested to merge 322776-cilium-alerts-refactor into master

What does this MR do?

  • Refactor existsLabelsInEndpointSelector() to accept the EndpointSelector 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 of NewCiliumNetworkPolicyInformer so we can provide tweakListOptions
  • Add more tests

What are the relevant issue numbers?

gitlab-org/gitlab#322776 (closed)

Edited by Adam Cohen

Merge request reports