diff --git a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go index 3362847678..b3a58c26b2 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go +++ b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go @@ -865,14 +865,6 @@ func (r *HostedControlPlaneReconciler) update(ctx context.Context, hostedControl createOrUpdate := r.createOrUpdate(hostedControlPlane) - if util.IsPrivateHCP(hostedControlPlane) { - r.Log.Info("Removing private IngressController") - // Ensure that if an ingress controller exists from a previous version, it is removed - if err := r.reconcilePrivateIngressController(ctx, hostedControlPlane); err != nil { - return reconcile.Result{}, fmt.Errorf("failed to reconcile private ingresscontroller: %w", err) - } - } - r.Log.Info("Reconciling infrastructure services") if err := r.reconcileInfrastructure(ctx, hostedControlPlane, createOrUpdate); err != nil { return reconcile.Result{}, fmt.Errorf("failed to ensure infrastructure: %w", err) @@ -3537,18 +3529,6 @@ func (r *HostedControlPlaneReconciler) reconcileCoreIgnitionConfig(ctx context.C return nil } -func (r *HostedControlPlaneReconciler) reconcilePrivateIngressController(ctx context.Context, hcp *hyperv1.HostedControlPlane) error { - ic := manifests.IngressPrivateIngressController(hcp.Namespace) - if err := r.Get(ctx, client.ObjectKeyFromObject(ic), ic); err == nil { - if err = r.Delete(ctx, ic); err != nil { - return fmt.Errorf("failed to delete private ingress controller: %w", err) - } - } else if !apierrors.IsNotFound(err) { - return fmt.Errorf("failed to get private ingress controller: %w", err) - } - return nil -} - func (r *HostedControlPlaneReconciler) reconcileRouter(ctx context.Context, hcp *hyperv1.HostedControlPlane, releaseImageProvider *imageprovider.ReleaseImageProvider, createOrUpdate upsert.CreateOrUpdateFN, exposeKASThroughRouter bool, privateRouterHost, externalRouterHost string) error { routeList := &routev1.RouteList{} if err := r.List(ctx, routeList, client.InNamespace(hcp.Namespace)); err != nil { diff --git a/control-plane-operator/controllers/hostedcontrolplane/manifests/ingress.go b/control-plane-operator/controllers/hostedcontrolplane/manifests/ingress.go index 84de606e92..d976156d8f 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/manifests/ingress.go +++ b/control-plane-operator/controllers/hostedcontrolplane/manifests/ingress.go @@ -30,15 +30,6 @@ func IngressDefaultIngressController() *operatorv1.IngressController { } } -func IngressPrivateIngressController(name string) *operatorv1.IngressController { - return &operatorv1.IngressController{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: "openshift-ingress-operator", - }, - } -} - func RouterServiceAccount(ns string) *corev1.ServiceAccount { return &corev1.ServiceAccount{ ObjectMeta: metav1.ObjectMeta{ diff --git a/control-plane-operator/main.go b/control-plane-operator/main.go index 8739f4f447..49fa192003 100644 --- a/control-plane-operator/main.go +++ b/control-plane-operator/main.go @@ -46,8 +46,6 @@ import ( "github.com/openshift/hypershift/support/releaseinfo" "github.com/openshift/hypershift/support/upsert" - operatorv1 "github.com/openshift/api/operator/v1" - ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/log/zap" // +kubebuilder:scaffold:imports @@ -213,9 +211,6 @@ func NewStartCommand() *cobra.Command { HealthProbeBindAddress: healthProbeAddr, Cache: cache.Options{ DefaultFieldSelector: fields.OneTermEqualSelector("metadata.namespace", namespace), - ByObject: map[crclient.Object]cache.ByObject{ - &operatorv1.IngressController{}: {Field: fields.OneTermEqualSelector("metadata.namespace", manifests.IngressPrivateIngressController("").Namespace)}, - }, }, }) if err != nil {