Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature gates for advanced Allocation filtering #2143

Merged
merged 2 commits into from
Jun 21, 2021
Merged
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
19 changes: 14 additions & 5 deletions pkg/util/runtime/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,27 @@ const (

// NodeExternalDNS is a feature flag to enable/disable node ExternalDNS and InternalDNS use as GameServer address
NodeExternalDNS Feature = "NodeExternalDNS"

// FeatureStateAllocationFilter is a feature flag that enables state filtering on Allocation.
FeatureStateAllocationFilter Feature = "StateAllocationFilter"

// FeaturePlayerAllocationFilter is a feature flag that enables the ability for Allocations to filter based on
// player capacity.
FeaturePlayerAllocationFilter Feature = "PlayerAllocationFilter"
)

var (
// featureDefaults is a map of all Feature Gates that are
// operational in Agones, and what their default configuration is.
// alpha features are disabled.
featureDefaults = map[Feature]bool{
FeatureExample: true,
FeaturePlayerTracking: false,
FeatureSDKWatchSendOnExecute: true,
FeatureRollingUpdateOnReady: true,
NodeExternalDNS: false,
FeatureExample: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should keep these sorted somehow (alphabetical and/or based on true/false). Since they end up in a map the order they are inserted doesn't matter, but it may be useful to humans to have them in a logical ordering.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 they are currently in order of initial implementation (I think?).

I don't have strong opinions here tbh. Happy to take advice?

FeaturePlayerTracking: false,
FeatureSDKWatchSendOnExecute: true,
FeatureRollingUpdateOnReady: true,
NodeExternalDNS: false,
FeatureStateAllocationFilter: false,
FeaturePlayerAllocationFilter: false,
}

// featureGates is the storage of what features are enabled
Expand Down