Added support for CSI secret provider

Signed-off-by: Zanis <22601571+ZanisO@users.noreply.github.com>
This commit is contained in:
Zanis
2025-02-05 21:51:10 +00:00
parent 574129d637
commit f6887b4d8a
12 changed files with 83 additions and 5 deletions
+10 -1
View File
@@ -79,7 +79,16 @@ func NewController(
}
}
listWatcher := cache.NewFilteredListWatchFromClient(client.CoreV1().RESTClient(), resource, namespace, optionsModifier)
getterRESTClient := client.CoreV1().RESTClient()
if resource == "secretproviderclasspodstatuses" {
csiClient, err := kube.GetCSIClient()
if err != nil {
logrus.Fatal(err)
}
getterRESTClient = csiClient.SecretsstoreV1().RESTClient()
}
listWatcher := cache.NewFilteredListWatchFromClient(getterRESTClient, resource, namespace, optionsModifier)
_, informer := cache.NewInformerWithOptions(cache.InformerOptions{
ListerWatcher: listWatcher,