Added check to see if CSI CRDs are installed before running controller

This commit is contained in:
Zanis
2025-01-19 23:46:29 +00:00
parent 75f9a23de3
commit 717291f173
2 changed files with 29 additions and 5 deletions

View File

@@ -179,8 +179,14 @@ func startReloader(cmd *cobra.Command, args []string) {
var controllers []*controller.Controller
for k := range kube.ResourceMap {
if k == "secretproviderclasspodstatuses" && !options.EnableCSIIntegration {
continue
if k == "secretproviderclasspodstatuses" {
if !options.EnableCSIIntegration {
continue
}
if !kube.IsCSIInstalled {
logrus.Infof("Can't run CSI controller as CSI CRDs are not installed")
continue
}
}
if ignoredResourcesList.Contains(k) || (len(namespaceLabelSelector) == 0 && k == "namespaces") {