Skip to content

Commit

Permalink
controllers: Ignore NoKindMatchError for StorageClusterList
Browse files Browse the repository at this point in the history
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 <nigoyal@redhat.com>
  • Loading branch information
iamniting committed Nov 12, 2024
1 parent 5c82f55 commit c167695
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit c167695

Please sign in to comment.