diff --git a/internal/controllers/clusterextension_controller.go b/internal/controllers/clusterextension_controller.go index 3f4c1d00d..d12816b46 100644 --- a/internal/controllers/clusterextension_controller.go +++ b/internal/controllers/clusterextension_controller.go @@ -30,6 +30,7 @@ import ( mmsemver "github.com/Masterminds/semver/v3" bsemver "github.com/blang/semver/v4" "github.com/go-logr/logr" + crdupgradesafety "github.com/operator-framework/rukpak/pkg/preflights/crdupgradesafety" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chartutil" @@ -64,7 +65,6 @@ import ( "github.com/operator-framework/operator-registry/alpha/property" rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2" registryv1handler "github.com/operator-framework/rukpak/pkg/handler" - crdupgradesafety "github.com/operator-framework/rukpak/pkg/preflights/crdupgradesafety" rukpaksource "github.com/operator-framework/rukpak/pkg/source" "github.com/operator-framework/rukpak/pkg/storage" "github.com/operator-framework/rukpak/pkg/util" @@ -328,10 +328,12 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp } for _, preflight := range r.Preflights { - if _, ok := preflight.(*crdupgradesafety.Preflight); ok && ext.Spec.Preflight.CRDUpgradeSafety.Disabled { - // Skip this preflight check because it is of type *crdupgradesafety.Preflight and the CRD Upgrade Safety - // preflight check has been disabled - continue + if ext.Spec.Preflight != nil { + if _, ok := preflight.(*crdupgradesafety.Preflight); ok && ext.Spec.Preflight.CRDUpgradeSafety.Disabled { + // Skip this preflight check because it is of type *crdupgradesafety.Preflight and the CRD Upgrade Safety + // preflight check has been disabled + continue + } } switch state { case stateNeedsInstall: