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 7d18f84
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 160 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ Adding a new version? You'll need three changes:
This happens when Gateway is responding with a 50x HTTP status code.
[#4627](https://github.com/Kong/kubernetes-ingress-controller/issues/4627)
- Ensure the API server is available at startup and do not disable CRD
controllers if Kong CRDs are unavailable. This avoids incorrectly deleting
existing configuration during an API server restart.
controllers if Kong CRDs are unavailable. Do not disable the Ingress
controller if the Ingress API is unavailable. This avoids incorrectly
deleting existing configuration during an API server restart.
[#4641](https://github.com/Kong/kubernetes-ingress-controller/issues/4641)
[#4643](https://github.com/Kong/kubernetes-ingress-controller/issues/4643)

## [2.11.1]

Expand Down
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) {

Check failure on line 69 in internal/manager/controllerdef.go

View workflow job for this annotation

GitHub Actions / linters / lint

setupControllers - result 1 (error) is always nil (unparam)
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 7d18f84

Please sign in to comment.