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

Disable resync on SDK Server #3508

Merged
merged 5 commits into from
Nov 18, 2023
Merged
Changes from 1 commit
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 pkg/sdkserver/sdkserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func NewSDKServer(gameServerName, namespace string, kubeClient kubernetes.Interf
s1 := fields.OneTermEqualSelector("metadata.name", gameServerName)
opts.FieldSelector = s1.String()
}
factory := externalversions.NewSharedInformerFactoryWithOptions(agonesClient, 30*time.Second, externalversions.WithNamespace(namespace), externalversions.WithTweakListOptions(tweakListOptions))
factory := externalversions.NewSharedInformerFactoryWithOptions(agonesClient, 0, externalversions.WithNamespace(namespace), externalversions.WithTweakListOptions(tweakListOptions))
markmandel marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Next step: wrap this in a feature gate method with the new feature gate, so that the when true, resync is 0, and when disabled (currently the default), it's still 30s.

func FeatureEnabled(feature Feature) bool {

Is the function.

For example:

if runtime.FeatureEnabled(runtime.FeaturePlayerTracking) {
if gs.Status.Players != nil {
result.Status.Players = &sdk.GameServer_Status_PlayerStatus{
Count: gs.Status.Players.Count,
Capacity: gs.Status.Players.Capacity,
Ids: gs.Status.Players.IDs,
}
}
}

gameServers := factory.Agones().V1().GameServers()

s := &SDKServer{
Expand Down