diff --git a/cloudbuild.yaml b/cloudbuild.yaml index fad9a91c64..747593fb4e 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -259,6 +259,7 @@ steps: args: [ "-j", "5", "--output-sync=target", "run-sdk-conformance-tests"] waitFor: - build-images + - tests # # Cache the CPP conformance build directory, to speed up subsequent builds (considerably) diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 62fb9716bd..6d5a2e6371 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -19,6 +19,8 @@ package versioned import ( + "fmt" + agonesv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/agones/v1" allocationv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/allocation/v1" autoscalingv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/autoscaling/v1" @@ -75,9 +77,14 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { } // NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) } var cs Clientset diff --git a/site/content/en/docs/Guides/Client SDKs/rest.md b/site/content/en/docs/Guides/Client SDKs/rest.md index b8c0b4f6f5..46d8f06916 100644 --- a/site/content/en/docs/Guides/Client SDKs/rest.md +++ b/site/content/en/docs/Guides/Client SDKs/rest.md @@ -262,9 +262,8 @@ Response: #### Alpha: GetPlayerCount -This function returns if the playerID is currently connected to the GameServer. -This is always accurate from what has been set through this SDK, -even if the value has yet to be updated on the GameServer status resource. +This function retrieves the current player count. +This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the GameServer status resource. ```bash $ curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/alpha/player/count