From c1676954a951543080b720a681b3640e7d1ef314 Mon Sep 17 00:00:00 2001 From: Nitin Goyal Date: Tue, 12 Nov 2024 20:02:48 +0530 Subject: [PATCH] controllers: Ignore NoKindMatchError for StorageClusterList The odf-operator initially errors out due to missing CRDs, which prevents it from reaching a ready state and blocks the creation of the odf-dependencies subscription that brings these CRDs. By ignoring the NoKindMatchError for StorageClusterList, we allow the odf-operator to continue running and allow to create a odf-dependencies subscription. Signed-off-by: Nitin Goyal --- controllers/subscriptions.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controllers/subscriptions.go b/controllers/subscriptions.go index 8ca4b67b..df6aa2f8 100644 --- a/controllers/subscriptions.go +++ b/controllers/subscriptions.go @@ -28,6 +28,7 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" @@ -127,6 +128,9 @@ func isProviderMode(cli client.Client) (bool, error) { storageclusters := &ocsv1.StorageClusterList{} err := cli.List(context.TODO(), storageclusters) if err != nil { + if meta.IsNoMatchError(err) { + return false, nil + } return false, err }