From d156e3411135b70744018877b12ec7a442a2508d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 26 Nov 2024 10:30:34 +0100 Subject: [PATCH] chore: migrate MaxConcurrency to ContainerScalingOption.ConcurrentRequestsThreshold --- .golangci.yml | 2 -- internal/services/container/container.go | 2 +- internal/services/container/helpers_container.go | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 0fe1dbbe3..22e6811f9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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] @@ -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] diff --git a/internal/services/container/container.go b/internal/services/container/container.go index 802eb157a..063ddd5c3 100644 --- a/internal/services/container/container.go +++ b/internal/services/container/container.go @@ -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.ConcurrentRequestsThreshold = scw.Uint32Ptr(uint32(d.Get("max_concurrency").(int))) } if d.HasChanges("protocol") { diff --git a/internal/services/container/helpers_container.go b/internal/services/container/helpers_container.go index f5c5349c2..a7f900b5b 100644 --- a/internal/services/container/helpers_container.go +++ b/internal/services/container/helpers_container.go @@ -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.ConcurrentRequestsThreshold = scw.Uint32Ptr(uint32(maxConcurrency.(int))) } if sandbox, ok := d.GetOk("sandbox"); ok {