diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index e5a3a671fd7..ff6ac05e9bf 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -247,6 +247,10 @@ RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}" if [[ "${KUBE_FEATURE_GATES:-}" == "AllAlpha=true" ]]; then RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-api/all=true}" +fi + +# If feature gates includes AllAlpha or EndpointSlice, and EndpointSlice has not been disabled, add EndpointSlice controller to list of controllers to run. +if [[ (( "${KUBE_FEATURE_GATES:-}" == *"AllAlpha=true"* ) || ( "${KUBE_FEATURE_GATES:-}" == *"EndpointSlice=true"* )) && "${KUBE_FEATURE_GATES:-}" != *"EndpointSlice=false"* ]]; then RUN_CONTROLLERS="${RUN_CONTROLLERS:-*,endpointslice}" fi diff --git a/cluster/gce/config-test.sh b/cluster/gce/config-test.sh index 6ab9a4ea9d9..56edd167a78 100755 --- a/cluster/gce/config-test.sh +++ b/cluster/gce/config-test.sh @@ -136,6 +136,10 @@ RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}" if [[ "${KUBE_FEATURE_GATES:-}" == "AllAlpha=true" ]]; then RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-api/all=true}" +fi + +# If feature gates includes AllAlpha or EndpointSlice, and EndpointSlice has not been disabled, add EndpointSlice controller to list of controllers to run. +if [[ (( "${KUBE_FEATURE_GATES:-}" == *"AllAlpha=true"* ) || ( "${KUBE_FEATURE_GATES:-}" == *"EndpointSlice=true"* )) && "${KUBE_FEATURE_GATES:-}" != *"EndpointSlice=false"* ]]; then RUN_CONTROLLERS="${RUN_CONTROLLERS:-*,endpointslice}" fi