Skip to content

Commit a29fa09

Browse files
authored
chore: remove feature gate ExpressionRoutes (#4892)
1 parent 7bb40eb commit a29fa09

File tree

11 files changed

+15
-47
lines changed

11 files changed

+15
-47
lines changed

.github/workflows/_integration_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
router-flavor: 'traditional_compatible'
8787
- name: dbless-expression-router
8888
test: dbless
89-
feature_gates: "ExpressionRoutes=true,GatewayAlpha=true"
89+
feature_gates: "GatewayAlpha=true"
9090
router-flavor: "expressions"
9191
- name: dbless-gateway-alpha
9292
test: dbless

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ Adding a new version? You'll need three changes:
8383
[#4743](https://github.com/Kong/kubernetes-ingress-controller/pull/4743)
8484
- Removed feature gate `CombinedRoutes`. The feature is enabled and it can't be changed.
8585
[#4749](https://github.com/Kong/kubernetes-ingress-controller/pull/4749)
86+
- Removed featuregate `ExpressionRoutes`. The feature is enabled and it can't be changed.
87+
KIC now translates to expression based Kong routes when Kong's router flavor `expressions`.
88+
[#4892](https://github.com/Kong/kubernetes-ingress-controller/pull/4892)
8689
- Removed Knative support.
8790
[#4748](https://github.com/Kong/kubernetes-ingress-controller/pull/4748)
8891
- Removed support for the `debug-log-reduce-redundancy` CLI flag.
@@ -150,8 +153,7 @@ Adding a new version? You'll need three changes:
150153
### Added
151154

152155
- Added support for expression-based Kong routes for `TLSRoute`. This requires
153-
the `ExpressionRoutes` feature gate and a Kong installed with
154-
`KONG_ROUTER_FLAVOR=expressions` set in the environment.
156+
Kong installed with `KONG_ROUTER_FLAVOR=expressions` set in the environment.
155157
[#4574](https://github.com/Kong/kubernetes-ingress-controller/pull/4574).
156158
- The `FillIDs` feature gate is now enabled by default.
157159
[#4746](https://github.com/Kong/kubernetes-ingress-controller/pull/4746)

FEATURE_GATES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Features that reach GA and over time become stable will be removed from this tab
6262
| CombinedRoutes | `false` | Alpha | 2.4.0 | 3.0.0 |
6363
| CombinedRoutes | `true` | Beta | 2.8.0 | 3.0.0 |
6464
| GatewayAlpha | `false` | Alpha | 2.6.0 | TBD |
65-
| ExpressionRoutes | `false` | Alpha | 2.10.0 | TBD |
65+
| ExpressionRoutes | `false` | Alpha | 2.10.0 | 3.0.0 |
6666
| CombinedServices | `false` | Alpha | 2.10.0 | 3.0.0 |
6767
| CombinedServices | `true` | Beta | 2.11.0 | 3.0.0 |
6868
| FillIDs | `false` | Alpha | 2.10.0 | 3.0.0 |

internal/dataplane/parser/golden_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ var (
3535
ReportConfiguredKubernetesObjects: false,
3636

3737
// Feature flags that are directly propagated from the feature gates get their defaults.
38-
ExpressionRoutes: featuregates.GetFeatureGatesDefaults()[featuregates.ExpressionRoutesFeature],
39-
FillIDs: featuregates.GetFeatureGatesDefaults()[featuregates.FillIDsFeature],
38+
FillIDs: featuregates.GetFeatureGatesDefaults()[featuregates.FillIDsFeature],
4039
}
4140
}
4241
)

internal/dataplane/parser/parser.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,18 @@ func NewFeatureFlags(
7272
) FeatureFlags {
7373
return FeatureFlags{
7474
ReportConfiguredKubernetesObjects: updateStatusFlag,
75-
ExpressionRoutes: shouldEnableParserExpressionRoutes(logger, featureGates, routerFlavor),
75+
ExpressionRoutes: shouldEnableParserExpressionRoutes(logger, routerFlavor),
7676
FillIDs: featureGates.Enabled(featuregates.FillIDsFeature),
7777
RewriteURIs: featureGates.Enabled(featuregates.RewriteURIsFeature),
7878
}
7979
}
8080

8181
func shouldEnableParserExpressionRoutes(
8282
logger logr.Logger,
83-
featureGates featuregates.FeatureGates,
8483
routerFlavor string,
8584
) bool {
86-
if !featureGates.Enabled(featuregates.ExpressionRoutesFeature) {
87-
return false
88-
}
8985
if routerFlavor != kongRouterFlavorExpressions {
90-
logger.V(util.InfoLevel).Info("ExpressionRoutes feature gate enabled but Gateway is running with incompatible router flavor, using that instead", "flavor", routerFlavor)
86+
logger.V(util.InfoLevel).Info("Gateway is running with non-expression router flavor", "flavor", routerFlavor)
9187
return false
9288
}
9389
logger.V(util.InfoLevel).Info("expression routes mode enabled")

internal/dataplane/parser/parser_test.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727

2828
"github.com/kong/kubernetes-ingress-controller/v2/internal/annotations"
2929
"github.com/kong/kubernetes-ingress-controller/v2/internal/dataplane/kongstate"
30-
"github.com/kong/kubernetes-ingress-controller/v2/internal/manager/featuregates"
3130
"github.com/kong/kubernetes-ingress-controller/v2/internal/store"
3231
"github.com/kong/kubernetes-ingress-controller/v2/internal/util"
3332
"github.com/kong/kubernetes-ingress-controller/v2/internal/util/builder"
@@ -4522,25 +4521,13 @@ func TestNewFeatureFlags(t *testing.T) {
45224521
},
45234522
},
45244523
{
4525-
name: "expression routes feature gate enabled and router flavor matches",
4526-
featureGates: map[string]bool{
4527-
featuregates.ExpressionRoutesFeature: true,
4528-
},
4524+
name: "expression routes feature gate enabled and router flavor matches",
45294525
routerFlavor: kongRouterFlavorExpressions,
45304526
expectedFeatureFlags: FeatureFlags{
45314527
ExpressionRoutes: true,
45324528
},
45334529
expectInfoLog: "expression routes mode enabled",
45344530
},
4535-
{
4536-
name: "expression routes feature gate enabled and router flavor does not match",
4537-
featureGates: map[string]bool{
4538-
featuregates.ExpressionRoutesFeature: true,
4539-
},
4540-
routerFlavor: "any_other_router_mode",
4541-
expectedFeatureFlags: FeatureFlags{},
4542-
expectInfoLog: "ExpressionRoutes feature gate enabled but Gateway is running with incompatible router flavor, using that instead",
4543-
},
45444531
}
45454532

45464533
for _, tc := range testCases {

internal/manager/featuregates/feature_gates.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ const (
1818
// disabling the Alpha maturity APIs and relevant features for Gateway API.
1919
GatewayAlphaFeature = "GatewayAlpha"
2020

21-
// ExpressionRoutesFeature is the name of the feature-gate for enabling KIC to translate
22-
// supported kubernetes objects into expression based routes in kong configrurations
23-
// when controlled kong gateway uses expression based router by configuring `router_flavor` to `expressions`.
24-
// Note: this feature is experimental and some resources and features may not be supported.
25-
// See: https://docs.konghq.com/gateway/latest/key-concepts/routes/expressions/ about expression based routes in Kong 3.0+.
26-
ExpressionRoutesFeature = "ExpressionRoutes"
27-
2821
// FillIDsFeature is the name of the feature-gate that makes KIC fill in the ID fields of Kong entities (Services,
2922
// Routes, and Consumers). It ensures that IDs remain stable across restarts of the controller.
3023
FillIDsFeature = "FillIDs"
@@ -67,10 +60,9 @@ func (fg FeatureGates) Enabled(feature string) bool {
6760
// NOTE: if you're adding a new feature gate, it needs to be added here.
6861
func GetFeatureGatesDefaults() map[string]bool {
6962
return map[string]bool{
70-
GatewayFeature: true,
71-
GatewayAlphaFeature: false,
72-
ExpressionRoutesFeature: false,
73-
FillIDsFeature: true,
74-
RewriteURIsFeature: false,
63+
GatewayFeature: true,
64+
GatewayAlphaFeature: false,
65+
FillIDsFeature: true,
66+
RewriteURIsFeature: false,
7567
}
7668
}

internal/manager/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func Run(
125125
FilterTags: c.FilterTags,
126126
SkipCACertificates: c.SkipCACertificates,
127127
EnableReverseSync: c.EnableReverseSync,
128-
ExpressionRoutes: featureGates.Enabled(featuregates.ExpressionRoutesFeature),
128+
ExpressionRoutes: routerFlavor == "expressions",
129129
}
130130
kongConfig.Init(ctx, setupLog, initialKongClients)
131131

test/conformance/suite_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ func prepareEnvForGatewayConformanceTests(t *testing.T) (c client.Client, gatewa
117117
require.NoError(t, gatewayv1beta1.AddToScheme(client.Scheme()))
118118

119119
featureGateFlag := fmt.Sprintf("--feature-gates=%s", consts.DefaultFeatureGates)
120-
if testenv.ExpressionRoutesEnabled() {
121-
featureGateFlag = fmt.Sprintf("--feature-gates=%s", consts.ConformanceExpressionRoutesTestsFeatureGates)
122-
}
123120

124121
t.Log("starting the controller manager")
125122
cert, key := certificate.GetKongSystemSelfSignedCerts()

test/consts/feature_gates.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,4 @@ const (
66
// that are innocuous, or otherwise don't actually get triggered unless the
77
// user takes further action.
88
DefaultFeatureGates = "GatewayAlpha=true"
9-
10-
// ConformanceExpressionRoutesTestsFeatureGates is the set of feature gates to be used
11-
// when running conformance tests with expression routes enabled.
12-
ConformanceExpressionRoutesTestsFeatureGates = "GatewayAlpha=true,ExpressionRoutes=true"
139
)

0 commit comments

Comments
 (0)