Skip to content

Commit

Permalink
remove PrivateIngressController cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sjenning authored and openshift-cherrypick-robot committed Feb 28, 2024
1 parent 34ee8be commit b8565d4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
Expand Up @@ -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{
Expand Down
5 changes: 0 additions & 5 deletions control-plane-operator/main.go
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b8565d4

Please sign in to comment.