Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion install/helm/agones/defaultfeaturegates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 3 additions & 9 deletions pkg/apis/agones/v1/gameserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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}
}

Expand Down
7 changes: 2 additions & 5 deletions pkg/cloudproduct/gke/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/util/runtime/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Guides/feature-stages.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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" %}}

Expand Down
3 changes: 2 additions & 1 deletion test/upgrade/versionMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}
}