Skip to content

Commit

Permalink
Rename LifecycleContract feature gate to SafeToEvict (googleforga…
Browse files Browse the repository at this point in the history
…mes#2849)

* SDKGracefulTermination: Promote to beta

Follows checklist in features.go.

Closes googleforgames#2831

* Rename `LifecycleContract` feature gate to `SafeToEvict`

Per googleforgames#2794, rename `LifecycleContract` to `SafeToEvict`.
  • Loading branch information
zmerlynn authored and chiayi committed Dec 13, 2022
1 parent ddc2aa3 commit 5d66aab
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ KIND_CONTAINER_NAME=$(KIND_PROFILE)-control-plane
GS_TEST_IMAGE ?= us-docker.pkg.dev/agones-images/examples/simple-game-server:0.14

# Enable all alpha feature gates. Keep in sync with `false` (alpha) entries in pkg/util/runtime/features.go:featureDefaults
ALPHA_FEATURE_GATES ?= "LifecycleContract=true&PlayerAllocationFilter=true&PlayerTracking=true&ResetMetricsOnDelete=true&Example=true"
ALPHA_FEATURE_GATES ?= "PlayerAllocationFilter=true&PlayerTracking=true&ResetMetricsOnDelete=true&SafeToEvict=true&Example=true"

# Build with Windows support
WITH_WINDOWS=1
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ steps:

- name: 'e2e-runner'
args:
- 'CustomFasSyncInterval=false&SDKGracefulTermination=false&StateAllocationFilter=false&LifecycleContract=true&PlayerAllocationFilter=true&PlayerTracking=true&ResetMetricsOnDelete=true&Example=true'
- 'CustomFasSyncInterval=false&SDKGracefulTermination=false&StateAllocationFilter=false&PlayerAllocationFilter=true&PlayerTracking=true&ResetMetricsOnDelete=true&SafeToEvict=true&Example=true'
- 'e2e-test-cluster'
- "${_REGISTRY}"
id: e2e-feature-gates
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 @@ -20,10 +20,10 @@ SDKGracefulTermination: true
StateAllocationFilter: true

# Alpha features
LifecycleContract: false
PlayerAllocationFilter: false
PlayerTracking: false
ResetMetricsOnDelete: false
SafeToEvict: false

# Example feature
Example: false
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ properties:
type: integer
title: The initial player capacity of this Game Server
minimum: 0
{{- if .featureLifecycleContract }}
{{- if .featureSafeToEvict }}
immutableReplicas:
type: integer
title: Immutable count of Pods to a GameServer. Always 1. (Implementation detail of implementing the Scale subresource.)
Expand Down
2 changes: 1 addition & 1 deletion install/helm/agones/templates/crds/_gameserverstatus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ status:
nullable: true
items:
type: string
{{- if .featureLifecycleContract }}
{{- if .featureSafeToEvict }}
immutableReplicas:
type: integer
title: Immutable count of Pods to a GameServer. Always 1. (Implementation detail of implementing the Scale subresource.)
Expand Down
2 changes: 1 addition & 1 deletion install/helm/agones/templates/crds/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ spec:
- type: integer
- type: string
template:
{{- $data := dict "metadata" true "podPreserveUnknownFields" .Values.gameservers.podPreserveUnknownFields "featureLifecycleContract" $featureGates.LifecycleContract }}
{{- $data := dict "metadata" true "podPreserveUnknownFields" .Values.gameservers.podPreserveUnknownFields "featureSafeToEvict" $featureGates.SafeToEvict }}
{{- include "gameserver.schema" $data | indent 17 }}
status:
description: 'FleetStatus is the status of a Fleet. More info:
Expand Down
4 changes: 2 additions & 2 deletions install/helm/agones/templates/crds/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ spec:
type: date
schema:
openAPIV3Schema:
{{- $data := dict "podPreserveUnknownFields" .Values.gameservers.podPreserveUnknownFields "featureLifecycleContract" $featureGates.LifecycleContract }}
{{- $data := dict "podPreserveUnknownFields" .Values.gameservers.podPreserveUnknownFields "featureSafeToEvict" $featureGates.SafeToEvict }}
{{- include "gameserver.schema" $data | indent 9 }}{{- /* include the schema then status, as it's easier to align */ -}}
{{- include "gameserver.status" $data | indent 11 }}
{{- if $featureGates.LifecycleContract }}
{{- if $featureGates.SafeToEvict }}
subresources:
# scale enables the scale subresource. We can't actually scale GameServers, but this allows
# for the use of PodDisruptionBudget (PDB) without having to use a PDB per Pod.
Expand Down
2 changes: 1 addition & 1 deletion install/helm/agones/templates/crds/gameserverset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ spec:
- Packed
- Distributed
template:
{{- $data := dict "metadata" true "podPreserveUnknownFields" .Values.gameservers.podPreserveUnknownFields "featureLifecycleContract" $featureGates.LifecycleContract }}
{{- $data := dict "metadata" true "podPreserveUnknownFields" .Values.gameservers.podPreserveUnknownFields "featureSafeToEvict" $featureGates.SafeToEvict }}
{{- include "gameserver.schema" $data | indent 18 }}
status:
description: 'GameServerSetStatus is the status of a GameServerSet. More info:
Expand Down
2 changes: 1 addition & 1 deletion install/helm/agones/templates/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

{{- $featureGates := include "agones.featureGates" . | fromYaml }}
{{- if $featureGates.LifecycleContract }}
{{- if $featureGates.SafeToEvict }}
{{- range .Values.gameservers.namespaces }}
---
apiVersion: policy/v1
Expand Down
8 changes: 4 additions & 4 deletions pkg/util/runtime/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ const (
////////////////
// Alpha features

// FeatureLifecycleContract enables the `lifecycleContract` API to specify disruption tolerance.
FeatureLifecycleContract Feature = "LifecycleContract"

// FeaturePlayerAllocationFilter is a feature flag that enables the ability for Allocations to filter based on
// player capacity.
FeaturePlayerAllocationFilter Feature = "PlayerAllocationFilter"
Expand All @@ -57,6 +54,9 @@ const (
// relevant metric views to reset their state immediately when an Agones resource is deleted.
FeatureResetMetricsOnDelete Feature = "ResetMetricsOnDelete"

// FeatureSafeToEvict enables the `SafeToEvict` API to specify disruption tolerance.
FeatureSafeToEvict Feature = "SafeToEvict"

////////////////
// Example feature

Expand Down Expand Up @@ -97,10 +97,10 @@ var (
FeatureStateAllocationFilter: true,

// Alpha features
FeatureLifecycleContract: false,
FeaturePlayerAllocationFilter: false,
FeaturePlayerTracking: false,
FeatureResetMetricsOnDelete: false,
FeatureSafeToEvict: false,

// Example feature
FeatureExample: false,
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 @@ -30,10 +30,10 @@ The current set of `alpha` and `beta` feature gates:
| [Custom resync period for FleetAutoscaler](https://github.com/googleforgames/agones/issues/1955) | `CustomFasSyncInterval` | Enabled | `Beta` | 1.25.0 |
| [Graceful Termination for GameServer SDK](https://github.com/googleforgames/agones/pull/2205) | `SDKGracefulTermination` | Enabled | `Beta` | 1.18.0 |
| [GameServer state filtering on GameServerAllocations](https://github.com/googleforgames/agones/issues/1239) | `StateAllocationFilter` | Enabled | `Beta` | 1.26.0 |
| [Lifecycle Contracts](https://github.com/googleforgames/agones/issues/2794) | `LifecycleContract` | Disabled | `Alpha` | 1.28.0 |
| [GameServer player capacity filtering on GameServerAllocations](https://github.com/googleforgames/agones/issues/1239) | `PlayerAllocationFilter` | Disabled | `Alpha` | 1.14.0 |
| [Player Tracking]({{< ref "/docs/Guides/player-tracking.md" >}}) | `PlayerTracking` | Disabled | `Alpha` | 1.6.0 |
| [Reset Metric Export on Fleet / Autoscaler deletion]({{% relref "./metrics.md#dropping-metric-labels" %}}) | `ResetMetricsOnDelete` | Disabled | `Alpha` | 1.26.0 |
| [GameServer `SafeToEvict` API](https://github.com/googleforgames/agones/issues/2794) | `SafeToEvict` | Disabled | `Alpha` | 1.29.0 |
| Example Gate (not in use) | `Example` | Disabled | None | 0.13.0 |
{{% /feature %}}
{{% feature expiryVersion="1.29.0" %}}
Expand Down

0 comments on commit 5d66aab

Please sign in to comment.