From bfd88737a0b9f700ce91357f9fc3d49c362cb379 Mon Sep 17 00:00:00 2001 From: Mauricio Poppe Date: Thu, 29 Apr 2021 22:30:11 +0000 Subject: [PATCH] fix typo in CRD check --- cmd/snapshot-controller/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {