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

chore: migrate MaxConcurrency to ContainerScalingOption.ConcurrentReq… #2815

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ linters:
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
- dupl # Tool for code clone detection [fast: true, auto-fix: false]
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false]
- execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false]
- exhaustive # check exhaustiveness of enum switch statements [fast: false, auto-fix: false]
- forcetypeassert # finds forced type assertions [fast: true, auto-fix: false]
- funlen # Tool for detection of long functions [fast: true, auto-fix: false]
Expand All @@ -92,7 +91,6 @@ linters:
- godot # Check if comments end in a period [fast: true, auto-fix: true]
- godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]
- err113 # Golang linter to check the errors handling expressions [fast: false, auto-fix: false]
- gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false]
- lll # Reports long lines [fast: true, auto-fix: false]
- maintidx # maintidx measures the maintainability index of each function. [fast: true, auto-fix: false]
- nestif # Reports deeply nested if statements [fast: true, auto-fix: false]
Expand Down
2 changes: 1 addition & 1 deletion internal/services/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func ResourceContainerUpdate(ctx context.Context, d *schema.ResourceData, m inte
}

if d.HasChanges("max_concurrency") {
req.MaxConcurrency = scw.Uint32Ptr(uint32(d.Get("max_concurrency").(int)))
req.ScalingOption = &container.ContainerScalingOption{ConcurrentRequestsThreshold: scw.Uint32Ptr(uint32(d.Get("max_concurrency").(int)))}
}

if d.HasChanges("protocol") {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/container/helpers_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func setCreateContainerRequest(d *schema.ResourceData, region scw.Region) (*cont
}

if maxConcurrency, ok := d.GetOk("max_concurrency"); ok {
req.MaxConcurrency = scw.Uint32Ptr(uint32(maxConcurrency.(int)))
req.ScalingOption = &container.ContainerScalingOption{ConcurrentRequestsThreshold: scw.Uint32Ptr(uint32(maxConcurrency.(int)))}
}

if sandbox, ok := d.GetOk("sandbox"); ok {
Expand Down
Loading