diff --git a/cmd/snapshot-controller/main.go b/cmd/snapshot-controller/main.go index 6d94f9fd..ad1210eb 100644 --- a/cmd/snapshot-controller/main.go +++ b/cmd/snapshot-controller/main.go @@ -68,7 +68,7 @@ func ensureCustomResourceDefinitionsExist(kubeClient *kubernetes.Clientset, clie condition := func() (bool, error) { var err error _, err = kubeClient.CoreV1().Namespaces().Get(context.TODO(), "kube-system", metav1.GetOptions{}) - if err != nil { + if err == nil { // only execute list VolumeSnapshots if the kube-system namespace exists _, err = client.SnapshotV1().VolumeSnapshots("kube-system").List(context.TODO(), metav1.ListOptions{}) if err != nil {