diff --git a/build/Makefile b/build/Makefile index ef5e125c3a..4cd5cca3c7 100644 --- a/build/Makefile +++ b/build/Makefile @@ -69,7 +69,7 @@ KIND_CONTAINER_NAME=$(KIND_PROFILE)-control-plane GS_TEST_IMAGE ?= us-docker.pkg.dev/agones-images/examples/simple-game-server:0.43 # Enable all beta feature gates. Keep in sync with `true` (beta) entries in pkg/util/runtime/features.go:featureDefaults -BETA_FEATURE_GATES ?= "CountsAndLists=true&GKEAutopilotExtendedDurationPods=true&PortPolicyNone=true&PortRanges=true&RollingUpdateFix=true&ScheduledAutoscaler=true&SidecarContainers=true&FleetAutoscaleRequestMetaData=true" +BETA_FEATURE_GATES ?= "CountsAndLists=true&GKEAutopilotExtendedDurationPods=true&PortRanges=true&RollingUpdateFix=true&ScheduledAutoscaler=true&SidecarContainers=true&FleetAutoscaleRequestMetaData=true" # Enable all alpha feature gates. Keep in sync with `false` (alpha) entries in pkg/util/runtime/features.go:featureDefaults diff --git a/cloudbuild.yaml b/cloudbuild.yaml index bb7c01740a..134c367b39 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -322,7 +322,7 @@ steps: # Keep in sync with the inverse of 'alpha' and 'beta' features in # pkg/util/runtime/features.go:featureDefaults - featureWithGate="PlayerAllocationFilter=true&FleetAutoscaleRequestMetaData=false&PlayerTracking=true&CountsAndLists=false&RollingUpdateFix=false&PortRanges=false&PortPolicyNone=false&ScheduledAutoscaler=false&GKEAutopilotExtendedDurationPods=false&SidecarContainers=false&WasmAutoscaler=true&Example=true" + featureWithGate="PlayerAllocationFilter=true&FleetAutoscaleRequestMetaData=false&PlayerTracking=true&CountsAndLists=false&RollingUpdateFix=false&PortRanges=false&ScheduledAutoscaler=false&GKEAutopilotExtendedDurationPods=false&SidecarContainers=false&WasmAutoscaler=true&Example=true" featureWithoutGate="" # Use this if specific feature gates can only be supported on specific Kubernetes versions. diff --git a/install/helm/agones/defaultfeaturegates.yaml b/install/helm/agones/defaultfeaturegates.yaml index 9aab1d8e35..5f9fd77d4a 100644 --- a/install/helm/agones/defaultfeaturegates.yaml +++ b/install/helm/agones/defaultfeaturegates.yaml @@ -19,12 +19,12 @@ # previous version with the feature flag do not fail on parsing an unknown flag. DisableResyncOnSDKServer: true AutopilotPassthroughPort: true +PortPolicyNone: true # Beta features CountsAndLists: true GKEAutopilotExtendedDurationPods: true -PortPolicyNone: true PortRanges: true ScheduledAutoscaler: true RollingUpdateFix: true diff --git a/pkg/apis/agones/v1/gameserver.go b/pkg/apis/agones/v1/gameserver.go index fc94ec99d2..f48a5a9b8c 100644 --- a/pkg/apis/agones/v1/gameserver.go +++ b/pkg/apis/agones/v1/gameserver.go @@ -535,13 +535,7 @@ func (gss *GameServerSpec) validateFeatureGates(fldPath *field.Path) field.Error } } - if !runtime.FeatureEnabled(runtime.FeaturePortPolicyNone) { - for i, p := range gss.Ports { - if p.PortPolicy == None { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("ports").Index(i).Child("portPolicy"), fmt.Sprintf("Value cannot be set to %s unless feature flag %s is enabled", None, runtime.FeaturePortPolicyNone))) - } - } - } + return allErrs } @@ -791,7 +785,7 @@ func (gs *GameServer) Pod(apiHooks APIHooks, sidecars ...corev1.Container) (*cor var hostPort int32 portIdx := 0 - if !runtime.FeatureEnabled(runtime.FeaturePortPolicyNone) || p.PortPolicy != None { + if p.PortPolicy != None { hostPort = p.HostPort } @@ -944,7 +938,7 @@ func (gs *GameServer) HasPortPolicy(policy PortPolicy) bool { // Status returns a GameServerStatusPort for this GameServerPort func (p GameServerPort) Status() GameServerStatusPort { - if runtime.FeatureEnabled(runtime.FeaturePortPolicyNone) && p.PortPolicy == None { + if p.PortPolicy == None { return GameServerStatusPort{Name: p.Name, Port: p.ContainerPort} } diff --git a/pkg/cloudproduct/gke/gke.go b/pkg/cloudproduct/gke/gke.go index 4b7963d54f..b537fbaf81 100644 --- a/pkg/cloudproduct/gke/gke.go +++ b/pkg/cloudproduct/gke/gke.go @@ -307,16 +307,13 @@ func validatePortPolicy(p agonesv1.GameServerPort, i int, fldPath *field.Path) f case agonesv1.Dynamic, agonesv1.Passthrough: // These policies are always valid on GKE Autopilot. case agonesv1.None: - // "None" is valid only if the feature gate FeaturePortPolicyNone is enabled. - if !runtime.FeatureEnabled(runtime.FeaturePortPolicyNone) { - allErrs = append(allErrs, field.Invalid(portPath.Child("portPolicy"), p.PortPolicy, "PortPolicy 'None' is not enabled")) - } + // PortPolicyNone is stable; None is always a valid policy on GKE Autopilot. default: // Any other port policy, such as "Static", is considered invalid on GKE Autopilot. allErrs = append(allErrs, field.Invalid(portPath.Child("portPolicy"), p.PortPolicy, "portPolicy must be Dynamic, Passthrough, or None on GKE Autopilot")) } - if p.Range != agonesv1.DefaultPortRange && (p.PortPolicy != agonesv1.None || !runtime.FeatureEnabled(runtime.FeaturePortPolicyNone)) { + if p.Range != agonesv1.DefaultPortRange && p.PortPolicy != agonesv1.None { allErrs = append(allErrs, field.Invalid(fldPath.Child("ports").Index(i).Child("range"), p.Range, errRangeInvalid)) } diff --git a/pkg/util/runtime/features.go b/pkg/util/runtime/features.go index 32fcc8c73b..752e2b9835 100644 --- a/pkg/util/runtime/features.go +++ b/pkg/util/runtime/features.go @@ -151,12 +151,12 @@ var ( // Note that stable features cannot be set to "false", and are here so that upgrades from a // previous version with the feature flag do not fail on parsing an unknown flag. FeatureDisableResyncOnSDKServer: true, + FeaturePortPolicyNone: true, FeatureAutopilotPassthroughPort: true, // Beta features FeatureCountsAndLists: true, FeatureGKEAutopilotExtendedDurationPods: true, - FeaturePortPolicyNone: true, FeaturePortRanges: true, FeatureRollingUpdateFix: true, FeatureScheduledAutoscaler: true, diff --git a/site/content/en/docs/Guides/feature-stages.md b/site/content/en/docs/Guides/feature-stages.md index 12e5efee07..4338fc886d 100644 --- a/site/content/en/docs/Guides/feature-stages.md +++ b/site/content/en/docs/Guides/feature-stages.md @@ -41,7 +41,6 @@ The current set of `alpha`, `beta` and `stable` feature gates include: |------------------------------------------------------------------------------------------------------------------------|------------------------------------|---------|--------|--------| | [CountsAndLists](https://github.com/agones-dev/agones/issues/2716) | `CountsAndLists` | Enabled | `Beta` | 1.41.0 | | [Support for Extended Duration Pods on GKE Autopilot (*1.28+ only*)](https://github.com/agones-dev/agones/issues/3386) | `GKEAutopilotExtendedDurationPods` | Enabled | `Beta` | 1.44.0 | -| [Port Policy None](https://github.com/agones-dev/agones/issues/3804) | `PortPolicyNone` | Enabled | `Beta` | 1.49.0 | | [Multiple dynamic port ranges](https://github.com/agones-dev/agones/issues/1911) | `PortRanges` | Enabled | `Beta` | 1.49.0 | | [Rolling Update Fixes](https://github.com/agones-dev/agones/issues/3688) | `RollingUpdateFix` | Enabled | `Beta` | 1.50.0 | | [Scheduled Fleet Autoscaling](https://github.com/agones-dev/agones/issues/3008) | `ScheduledAutoscaler` | Enabled | `Beta` | 1.51.0 | @@ -54,6 +53,7 @@ The current set of `alpha`, `beta` and `stable` feature gates include: |------------------------------------------------------------------------------------------|----------------------------|---------|----------|--------| | [DisableResyncOnSDKServer](https://github.com/agones-dev/agones/issues/3377) | `DisableResyncOnSDKServer` | Enabled | `Stable` | 1.49.0 | | [Support Passthrough on GKE Autopilot](https://github.com/agones-dev/agones/issues/3721) | `AutopilotPassthroughPort` | Enabled | `Stable` | 1.54.0 | +| [Port Policy None](https://github.com/agones-dev/agones/issues/3804) | `PortPolicyNone` | Enabled | `Stable` | 1.49.0 | [fleet-updates]: {{% relref "./fleet-updates.md#notifying-gameservers-on-fleet-updatedownscale" %}} diff --git a/test/upgrade/versionMap.yaml b/test/upgrade/versionMap.yaml index 763663bd26..362444844d 100644 --- a/test/upgrade/versionMap.yaml +++ b/test/upgrade/versionMap.yaml @@ -129,7 +129,8 @@ data: }, "Dev": { "alphaGates": ["PlayerAllocationFilter", "PlayerTracking", "WasmAutoscaler"], - "betaGates": ["CountsAndLists", "GKEAutopilotExtendedDurationPods", "PortPolicyNone", "PortRanges", "RollingUpdateFix", "ScheduledAutoscaler", "FleetAutoscaleRequestMetaData", "SidecarContainers"] + "betaGates": ["CountsAndLists", "GKEAutopilotExtendedDurationPods", "PortRanges", "RollingUpdateFix", "ScheduledAutoscaler", "FleetAutoscaleRequestMetaData", "SidecarContainers"], + "stableGates": ["PortPolicyNone"] } } }