-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deployments): add concurrency support (#306)
* initial commit for concurrency support * Change ConcurrencyOptions from JSON to SingleNestedAttribute This object in the API is pretty simple, with only one nested attribute. It's not so flexible that we need to default to a basic JSON object. * Validate that concurrency_limit value is >0 Per the API docs * Fix concurrency limit return value Concurrency limit is still configured via 'concurrency_limit' in the request payload, but that field in the response payload is deprecated. We instead need to retrieve it from 'global_concurrency_limit.limit'. * Omit ConcurrencyOptions from payload if null If ConcurrencyOptions is not configured, it should not be included in the request payload. We get this by using pointers and checking IsNull before attempting to add that field to the request payloads. * Explain unused fields in GlobalConcurrencyLimit * Mark collision_strategy as required, update docs * Undo go.mod change * Check if GlobalConcurrencyLimit is nil To be safe, let's check if GlobalConcurrencyLimit is nil before attempting to get its nested value. Also marks ConcurrencyLimit as a pointer value for consistency. * Change GlobalConcurrencyLimit.Limit to int64 Since we were casting it as such anyway * Change ConcurrencyOptions to a custom type ConcurrencyOptions was a types.Object, which made working with the object more verbose for a resource that was a simple nested attribute. Also, getting values from that object was causing the JSON request payload to include escaped characters for some reason, meaning we needed a helper function to strip them out. This changes from types.Object to a custom Go type, allowing much easier manipulation of the attribute - and removing the need for the custom helper function to strip out quotes. --------- Co-authored-by: Mitchell Nielsen <[email protected]>
- Loading branch information
1 parent
8a74112
commit 462bb31
Showing
4 changed files
with
138 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters