Skip to content

Commit

Permalink
chore(controllers) remove Ingress API selection
Browse files Browse the repository at this point in the history
Remove Ingress API selection in favor of simply honoring the CLI disable
flag.

Support for Ingress versions other than networking/v1 was removed in
#3867. The API
selection code was only selecting between networking/v1 and nothing.
Future Kubernetes versions are not expected to abruptly remove the older
API versions if they introduce new Ingress versions, so this selection
code should not be necessary in the future.
  • Loading branch information
rainest committed Sep 11, 2023
1 parent f1e33ea commit 68b537a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 158 deletions.
66 changes: 0 additions & 66 deletions internal/manager/conditions.go

This file was deleted.

81 changes: 0 additions & 81 deletions internal/manager/conditions_test.go

This file was deleted.

13 changes: 2 additions & 11 deletions internal/manager/controllerdef.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package manager

import (
"context"
"fmt"
"reflect"

"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down Expand Up @@ -68,14 +67,6 @@ func setupControllers(
kongAdminAPIEndpointsNotifier configuration.EndpointsNotifier,
adminAPIsDiscoverer configuration.AdminAPIsDiscoverer,
) ([]ControllerDef, error) {
restMapper := mgr.GetClient().RESTMapper()

// Choose the best API version of Ingress to inform which ingress controller to enable.
ingressConditions, err := NewIngressControllersConditions(c, restMapper)
if err != nil {
return nil, fmt.Errorf("ingress version picker failed: %w", err)
}

referenceIndexers := ctrlref.NewCacheIndexers()

controllers := []ControllerDef{
Expand All @@ -97,7 +88,7 @@ func setupControllers(
// Core API Controllers
// ---------------------------------------------------------------------------
{
Enabled: ingressConditions.IngressClassNetV1Enabled(),
Enabled: c.IngressClassNetV1Enabled,
Controller: &configuration.NetV1IngressClassReconciler{
Client: mgr.GetClient(),
Log: ctrl.LoggerFrom(ctx).WithName("controllers").WithName("IngressClass").WithName("netv1"),
Expand All @@ -107,7 +98,7 @@ func setupControllers(
},
},
{
Enabled: ingressConditions.IngressNetV1Enabled(),
Enabled: c.IngressNetV1Enabled,
Controller: &configuration.NetV1IngressReconciler{
Client: mgr.GetClient(),
Log: ctrl.LoggerFrom(ctx).WithName("controllers").WithName("Ingress").WithName("netv1"),
Expand Down

0 comments on commit 68b537a

Please sign in to comment.