Skip to content

Commit ae32bca

Browse files
committed
fix: remove deprecated flow control env var
ENABLE_EXPERIMENTAL_FLOW_CONTROL_LAYER was deprecated when GIE 1.5.0 introduced the featureGates: [flowControl] config stanza, which router 0.8.0 picked up. It was also broken: initAdmissionControl reads r.featureGates, populated once during parseConfigurationPhaseOne, while the env var was only ever applied afterward in parseConfigurationPhaseTwo against rawConfig.FeatureGates. Setting it logged the deprecation warning but silently left the EPP on the legacy admission controller. Ahead of the 0.10.0 release, remove the env var entirely instead of fixing it, since the config-based replacement has been available since 0.8.0. Use featureGates: [flowControl] in the EndpointPickerConfig. Fixes #2065 Signed-off-by: elinacse <elina.gcek94@gmail.com>
1 parent b25dd66 commit ae32bca

2 files changed

Lines changed: 0 additions & 30 deletions

File tree

cmd/epp/runner/feature_gate_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package runner
1818

1919
import (
2020
"context"
21-
"os"
2221
"testing"
2322

2423
"github.com/stretchr/testify/require"
@@ -67,13 +66,6 @@ featureGates:
6766
// feature-gate map instead of hardcoding it, so this test keeps passing unchanged when the gate
6867
// flips to enabled-by-default (#2104) and pins that the flip actually changes the default wiring.
6968
func TestFlowControlFeatureGateAdmissionControlWiring(t *testing.T) {
70-
// The deprecated ENABLE_EXPERIMENTAL_FLOW_CONTROL_LAYER env var appends the gate to the config
71-
// during phase two; clear it so only the featureGates stanza under test drives the outcome.
72-
if v, ok := os.LookupEnv(enableExperimentalFlowControlLayer); ok {
73-
require.NoError(t, os.Unsetenv(enableExperimentalFlowControlLayer))
74-
t.Cleanup(func() { _ = os.Setenv(enableExperimentalFlowControlLayer, v) })
75-
}
76-
7769
boolPtr := func(b bool) *bool { return &b }
7870
testCases := []struct {
7971
name string

cmd/epp/runner/runner.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,9 @@ import (
139139
"github.com/llm-d/llm-d-router/pkg/epp/requestcontrol"
140140
"github.com/llm-d/llm-d-router/pkg/epp/scheduling"
141141
runserver "github.com/llm-d/llm-d-router/pkg/epp/server"
142-
"github.com/llm-d/llm-d-router/pkg/epp/util/env"
143142
"github.com/llm-d/llm-d-router/version"
144143
)
145144

146-
const (
147-
// enableExperimentalFlowControlLayer defines the environment variable used as a feature flag for the pluggable flow
148-
// control layer.
149-
// DEPRECATION NOTICE - this env var will be removed in the next version as we switch to configuring the EPP using FeatureGates in the config file.
150-
enableExperimentalFlowControlLayer = "ENABLE_EXPERIMENTAL_FLOW_CONTROL_LAYER"
151-
)
152-
153145
var (
154146
setupLog = ctrl.Log.WithName("setup")
155147
)
@@ -717,8 +709,6 @@ func makePodListFunc(ds datastore.Datastore) func() []types.NamespacedName {
717709
func (r *Runner) parseConfigurationPhaseTwo(ctx context.Context, rawConfig *configapi.EndpointPickerConfig, ds datastore.Datastore) (*config.Config, error) {
718710
logger := log.FromContext(ctx)
719711

720-
applyDeprecatedEnvFeatureGate(enableExperimentalFlowControlLayer, "Flow Control layer", flowcontrol.FeatureGate, rawConfig)
721-
722712
handle := fwkplugin.NewEppHandle(ctx, makePodListFunc(ds), fwkplugin.WithMetricsRecorder(ctrlmetrics.Registry))
723713
r.PluginHandle = handle
724714
cfg, err := loader.InstantiateAndConfigure(rawConfig, handle, logger)
@@ -763,18 +753,6 @@ func (r *Runner) parseConfigurationPhaseTwo(ctx context.Context, rawConfig *conf
763753
return cfg, nil
764754
}
765755

766-
func applyDeprecatedEnvFeatureGate(envVar, featureName, featureGate string, rawConfig *configapi.EndpointPickerConfig) {
767-
if _, ok := os.LookupEnv(envVar); ok {
768-
setupLog.Info(fmt.Sprintf("Enabling the experimental %s using environment variables is deprecated and will be removed in next version", featureName))
769-
if env.GetEnvBool(envVar, false, setupLog) {
770-
if rawConfig.FeatureGates == nil {
771-
rawConfig.FeatureGates = make(configapi.FeatureGates, 0)
772-
}
773-
rawConfig.FeatureGates = append(rawConfig.FeatureGates, featureGate)
774-
}
775-
}
776-
}
777-
778756
func (r *Runner) configureAndStartDatalayer(ctx context.Context, cfg *datalayer.Config, mgr ctrl.Manager) error {
779757
if err := r.dlRuntime.Configure(cfg, setupLog); err != nil {
780758
return err

0 commit comments

Comments
 (0)