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
3 changes: 2 additions & 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 Expand Up @@ -998,3 +998,4 @@ install-release: $(ensure-build-image)
# Validates the Helm values.yaml file against the values.schema.json file.
helm-lint:
$(DOCKER_RUN) bash -c 'cd $(mount_path)/install/helm/agones && helm lint .'

3 changes: 2 additions & 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 Expand Up @@ -464,3 +464,4 @@ logsBucket: gs://agones-build-logs
options:
machineType: E2_HIGHCPU_32
dynamic_substitutions: true

3 changes: 2 additions & 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 All @@ -41,3 +41,4 @@ ProcessorAllocator: false

# Example feature
Example: false

2,453 changes: 1,223 additions & 1,230 deletions pkg/apis/agones/v1/gameserver.go

Large diffs are not rendered by default.

32 changes: 0 additions & 32 deletions pkg/apis/agones/v1/gameserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func TestStatus(t *testing.T) {
}
runtime.FeatureTestMutex.Lock()
defer runtime.FeatureTestMutex.Unlock()
require.NoError(t, runtime.ParseFeatures(string(runtime.FeaturePortPolicyNone)+"=true"))

for _, tc := range testCases {
name := "test-name"
Expand Down Expand Up @@ -1536,35 +1535,8 @@ func TestGameServerValidateFeatures(t *testing.T) {
},
},
},
{
description: "PortPolicyNone is disabled, PortPolicy field set to None",
feature: fmt.Sprintf("%s=false", runtime.FeaturePortPolicyNone),
gs: GameServer{
Spec: GameServerSpec{
Ports: []GameServerPort{
{
Name: "main",
ContainerPort: 7777,
PortPolicy: None,
},
},
Container: "testing",
Lists: map[string]ListStatus{},
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{Containers: []corev1.Container{{Name: "testing", Image: "testing/image"}}},
},
},
},
want: field.ErrorList{
field.Forbidden(
field.NewPath("spec.ports[0].portPolicy"),
"Value cannot be set to None unless feature flag PortPolicyNone is enabled",
),
},
},
{
description: "PortPolicyNone is enabled, PortPolicy field set to None",
feature: fmt.Sprintf("%s=true", runtime.FeaturePortPolicyNone),
gs: GameServer{
Spec: GameServerSpec{
Ports: []GameServerPort{
Expand All @@ -1583,12 +1555,8 @@ func TestGameServerValidateFeatures(t *testing.T) {
},
},
}

for _, tc := range testCases {
t.Run(tc.description, func(t *testing.T) {
err := runtime.ParseFeatures(tc.feature)
assert.NoError(t, err)

errs := tc.gs.Validate(fakeAPIHooks{})
assert.ElementsMatch(t, tc.want, errs, "ErrorList check")
})
Expand Down
Loading
Loading