From 8abc44c0e43861d37527ad0c6180a2bcce47a807 Mon Sep 17 00:00:00 2001 From: Bryan Cox Date: Tue, 5 Mar 2024 09:43:34 -0500 Subject: [PATCH] Remove reconciliation for CPO ingress role setup Signed-off-by: Bryan Cox --- .../hostedcluster/hostedcluster_controller.go | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go index d61c94bc2cf..dbc1a701d4a 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -2089,45 +2089,6 @@ func (r *HostedClusterReconciler) reconcileControlPlaneOperator(ctx context.Cont return fmt.Errorf("failed to reconcile controlplane operator rolebinding: %w", err) } - // TODO: Remove this block after initial merge of this feature. It is not needed for latest CPO version - if r.ManagementClusterCapabilities.Has(capabilities.CapabilityRoute) { - // Reconcile operator role - for ingress - controlPlaneOperatorIngressRole := controlplaneoperator.OperatorIngressRole("openshift-ingress", controlPlaneNamespace.Name) - _, err = createOrUpdate(ctx, r.Client, controlPlaneOperatorIngressRole, func() error { - return reconcileControlPlaneOperatorIngressRole(controlPlaneOperatorIngressRole) - }) - if err != nil { - return fmt.Errorf("failed to reconcile controlplane operator ingress role: %w", err) - } - - // Reconcile operator role binding - for ingress - controlPlaneOperatorIngressRoleBinding := controlplaneoperator.OperatorIngressRoleBinding("openshift-ingress", controlPlaneNamespace.Name) - _, err = createOrUpdate(ctx, r.Client, controlPlaneOperatorIngressRoleBinding, func() error { - return reconcileControlPlaneOperatorIngressRoleBinding(controlPlaneOperatorIngressRoleBinding, controlPlaneOperatorIngressRole, controlPlaneOperatorServiceAccount) - }) - if err != nil { - return fmt.Errorf("failed to reconcile controlplane operator ingress rolebinding: %w", err) - } - - // Reconcile operator role - for ingress operator - controlPlaneOperatorIngressOperatorRole := controlplaneoperator.OperatorIngressOperatorRole("openshift-ingress-operator", controlPlaneNamespace.Name) - _, err = createOrUpdate(ctx, r.Client, controlPlaneOperatorIngressOperatorRole, func() error { - return reconcilecontrolPlaneOperatorIngressOperatorRole(controlPlaneOperatorIngressOperatorRole) - }) - if err != nil { - return fmt.Errorf("failed to reconcile controlplane operator ingress operator role: %w", err) - } - - // Reconcile operator role binding - for ingress operator - controlPlaneOperatorIngressOperatorRoleBinding := controlplaneoperator.OperatorIngressOperatorRoleBinding("openshift-ingress-operator", controlPlaneNamespace.Name) - _, err = createOrUpdate(ctx, r.Client, controlPlaneOperatorIngressOperatorRoleBinding, func() error { - return reconcilecontrolPlaneOperatorIngressOperatorRoleBinding(controlPlaneOperatorIngressOperatorRoleBinding, controlPlaneOperatorIngressOperatorRole, controlPlaneOperatorServiceAccount) - }) - if err != nil { - return fmt.Errorf("failed to reconcile controlplane operator ingress operator rolebinding: %w", err) - } - } - // Reconcile operator deployment controlPlaneOperatorDeployment := controlplaneoperator.OperatorDeployment(controlPlaneNamespace.Name) _, err = createOrUpdate(ctx, r.Client, controlPlaneOperatorDeployment, func() error {