From 809f46ff41b1cf8d0cb73b18e6aeb4fb449fc285 Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Thu, 4 Jan 2024 11:33:48 -0700 Subject: [PATCH] hostedcontrolplane: don't start pki operator when disabled Signed-off-by: Steve Kuznetsov --- .../hostedcontrolplane/hostedcontrolplane_controller.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go index 40b7d8f710..4e0fd5cda9 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go +++ b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go @@ -1127,9 +1127,11 @@ func (r *HostedControlPlaneReconciler) reconcile(ctx context.Context, hostedCont } // Reconcile control plane pki operator - r.Log.Info("Reconciling Control Plane PKI Operator") - if err := r.reconcileControlPlanePKIOperator(ctx, hostedControlPlane, releaseImageProvider, createOrUpdate, openShiftTrustedCABundleConfigMapForCPOExists, r.CertRotationScale); err != nil { - return fmt.Errorf("failed to reconcile control plane pki operator: %w", err) + if _, exists := hostedControlPlane.Annotations[hyperv1.DisablePKIReconciliationAnnotation]; !exists { + r.Log.Info("Reconciling Control Plane PKI Operator") + if err := r.reconcileControlPlanePKIOperator(ctx, hostedControlPlane, releaseImageProvider, createOrUpdate, openShiftTrustedCABundleConfigMapForCPOExists, r.CertRotationScale); err != nil { + return fmt.Errorf("failed to reconcile control plane pki operator: %w", err) + } } // Reconcile cloud controller manager