diff --git a/internal/controller/operatorconfigmap_controller.go b/internal/controller/operatorconfigmap_controller.go index 528f8f8db..ebc7e41c7 100644 --- a/internal/controller/operatorconfigmap_controller.go +++ b/internal/controller/operatorconfigmap_controller.go @@ -212,26 +212,6 @@ func (c *OperatorConfigMapReconciler) Reconcile(ctx context.Context, req ctrl.Re } } - if err := c.reconcileWebhookService(); err != nil { - c.log.Error(err, "unable to reconcile webhook service") - return ctrl.Result{}, err - } - - if err := c.reconcileSubscriptionValidatingWebhook(); err != nil { - c.log.Error(err, "unable to register subscription validating webhook") - return ctrl.Result{}, err - } - - if err := c.reconcileClientOperatorSubscription(); err != nil { - c.log.Error(err, "unable to reconcile client operator subscription") - return ctrl.Result{}, err - } - - if err := c.reconcileCSIAddonsOperatorSubscription(); err != nil { - c.log.Error(err, "unable to reconcile CSI Addons subscription") - return ctrl.Result{}, err - } - if err := c.ensureConsolePlugin(); err != nil { c.log.Error(err, "unable to deploy client console") return ctrl.Result{}, err @@ -241,6 +221,26 @@ func (c *OperatorConfigMapReconciler) Reconcile(ctx context.Context, req ctrl.Re c.log.Error(err, "failed to perform precheck for deploying CSI") return ctrl.Result{}, err } else if deployCSI { + if err := c.reconcileWebhookService(); err != nil { + c.log.Error(err, "unable to reconcile webhook service") + return ctrl.Result{}, err + } + + if err := c.reconcileSubscriptionValidatingWebhook(); err != nil { + c.log.Error(err, "unable to register subscription validating webhook") + return ctrl.Result{}, err + } + + if err := c.reconcileClientOperatorSubscription(); err != nil { + c.log.Error(err, "unable to reconcile client operator subscription") + return ctrl.Result{}, err + } + + if err := c.reconcileCSIAddonsOperatorSubscription(); err != nil { + c.log.Error(err, "unable to reconcile CSI Addons subscription") + return ctrl.Result{}, err + } + clusterVersion := &configv1.ClusterVersion{} clusterVersion.Name = clusterVersionName if err := c.get(clusterVersion); err != nil {