Skip to content

Commit f2a49bc

Browse files
authored
Merge branch 'master' into custom-roundtripper-s3
2 parents de790eb + 74233b4 commit f2a49bc

File tree

94 files changed

+19952
-812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+19952
-812
lines changed

.golangci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ linters:
1818
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false]
1919
- errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted. [fast: false, auto-fix: false]
2020
- errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. [fast: false, auto-fix: false]
21+
- 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]
2122
- exptostd # Detects functions from golang.org/x/exp/ that can be replaced by std functions. [auto-fix]
23+
- fatcontext # Detects nested contexts in loops and function literals. [auto-fix]
2224
- forbidigo # Forbids identifiers [fast: true, auto-fix: false]
2325
- gci # Gci controls golang package import order and makes it always deterministic. [fast: true, auto-fix: false]
2426
- gocheckcompilerdirectives # Checks that go compiler directive comments (//go:) are valid. [fast: true, auto-fix: false]
@@ -38,6 +40,7 @@ linters:
3840
- gosmopolitan # Report certain i18n/l10n anti-patterns in your Go codebase [fast: false, auto-fix: false]
3941
- govet #(vet, vetshadow): Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: false, auto-fix: false]
4042
- grouper # An analyzer to analyze expression groups. [fast: true, auto-fix: false]
43+
- iface # Detect the incorrect use of interfaces, helping developers avoid interface pollution. [auto-fix]
4144
- importas # Enforces consistent import aliases [fast: false, auto-fix: false]
4245
- ineffassign # Detects when assignments to existing variables are not used [fast: true, auto-fix: false]
4346
- intrange # intrange is a linter to find places where for loops could make use of an integer range. [fast: true, auto-fix: false]
@@ -86,7 +89,6 @@ linters:
8689
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
8790
- dupl # Tool for code clone detection [fast: true, auto-fix: false]
8891
- err113 # Golang linter to check the errors handling expressions [fast: false, auto-fix: false]
89-
- 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]
9092
- exhaustive # check exhaustiveness of enum switch statements [fast: false, auto-fix: false]
9193
- forcetypeassert # finds forced type assertions [fast: true, auto-fix: false]
9294
- funlen # Tool for detection of long functions [fast: true, auto-fix: false]

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ builds:
3030
goarch: '386'
3131
binary: '{{ .ProjectName }}_v{{ .Version }}'
3232
archives:
33-
- format: zip
33+
- formats: ['zip']
3434
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
3535
checksum:
3636
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'

docs/data-sources/container.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,18 @@ In addition to all arguments above, the following attributes are exported:
9191

9292
- `deploy` - Boolean indicating whether the container is on a production environment.
9393

94+
- `sandbox` - Execution environment of the container.
95+
96+
- `heath_check` - Health check configuration block of the container.
97+
- `http` - HTTP health check configuration.
98+
- `path` - Path to use for the HTTP health check.
99+
- `failure_threshold` - Number of consecutive health check failures before considering the container unhealthy.
100+
- `interval`- Period between health checks (in seconds).
94101
- `sandbox` - (Optional) Execution environment of the container.
102+
- `scaling_option` - Configuration block used to decide when to scale up or down. Possible values:
103+
- `concurrent_requests_threshold` - Scale depending on the number of concurrent requests being processed per container instance.
104+
- `cpu_usage_threshold` - Scale depending on the CPU usage of a container instance.
105+
- `memory_usage_threshold`- Scale depending on the memory usage of a container instance.
95106

96107
- `status` - The container status.
97108

docs/resources/apple_silicon.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The following arguments are supported:
3434

3535
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the server is
3636
associated with.
37+
- `enable_vpc` - (Optional, Default: false): Enables the VPC option when set to true.
3738

3839
## Attributes Reference
3940

@@ -50,6 +51,7 @@ In addition to all arguments above, the following attributes are exported:
5051
- `updated_at` - The date and time of the last update of the Apple Silicon server.
5152
- `deleted_at` - The minimal date and time on which you can delete this server due to Apple licence.
5253
- `organization_id` - The organization ID the server is associated with.
54+
- `vpc_status` - The current status of the VPC option.
5355

5456
## Import
5557

docs/resources/container.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ The following arguments are supported:
8484

8585
- `sandbox` - (Optional) Execution environment of the container.
8686

87+
- `heath_check` - (Optional) Health check configuration block of the container.
88+
- `http` - HTTP health check configuration.
89+
- `path` - Path to use for the HTTP health check.
90+
- `failure_threshold` - Number of consecutive health check failures before considering the container unhealthy.
91+
- `interval`- Period between health checks (in seconds).
92+
93+
- `scaling_option` - (Optional) Configuration block used to decide when to scale up or down. Possible values:
94+
- `concurrent_requests_threshold` - Scale depending on the number of concurrent requests being processed per container instance.
95+
- `cpu_usage_threshold` - Scale depending on the CPU usage of a container instance.
96+
- `memory_usage_threshold`- Scale depending on the memory usage of a container instance.
97+
8798
- `port` - (Optional) The port to expose the container.
8899

89100
- `deploy` - (Optional) Boolean indicating whether the container is in a production environment.
@@ -152,4 +163,56 @@ The `memory_limit` (in MB) must correspond with the right amount of vCPU. Refer
152163
| 4096 | 2240 |
153164

154165
~>**Important:** Make sure to select the right resources, as you will be billed based on compute usage over time and the number of Containers executions.
155-
Refer to the [Serverless Containers pricing](https://www.scaleway.com/en/docs/faq/serverless-containers/#prices) for more information.
166+
Refer to the [Serverless Containers pricing](https://www.scaleway.com/en/docs/faq/serverless-containers/#prices) for more information.
167+
168+
## Health check configuration
169+
170+
Custom health checks can be configured on the container.
171+
172+
It's possible to specify the HTTP path that the probe will listen to and the number of failures before considering the container as unhealthy.
173+
During a deployment, if a newly created container fails to pass the health check, the deployment is aborted.
174+
As a result, lowering this value can help to reduce the time it takes to detect a failed deployment.
175+
The period between health checks is also configurable.
176+
177+
Example:
178+
179+
```terraform
180+
resource scaleway_container main {
181+
name = "my-container-02"
182+
namespace_id = scaleway_container_namespace.main.id
183+
184+
health_check {
185+
http {
186+
path = "/ping"
187+
}
188+
failure_threshold = 40
189+
interval = "3s"
190+
}
191+
}
192+
```
193+
194+
~>**Important:** Another probe type can be set to TCP with the API, but currently the SDK has not been updated with this parameter.
195+
This is why the only probe that can be used here is the HTTP probe.
196+
Refer to the [Serverless Containers pricing](https://www.scaleway.com/en/docs/faq/serverless-containers/#prices) for more information.
197+
198+
## Scaling option configuration
199+
200+
Scaling option block configuration allows you to choose which parameter will scale up/down containers.
201+
Options are number of concurrent requests, CPU or memory usage.
202+
It replaces current `max_concurrency` that has been deprecated.
203+
204+
Example:
205+
206+
```terraform
207+
resource scaleway_container main {
208+
name = "my-container-02"
209+
namespace_id = scaleway_container_namespace.main.id
210+
211+
scaling_option {
212+
concurrent_requests_threshold = 15
213+
}
214+
}
215+
```
216+
217+
~>**Important**: A maximum of one of these parameters may be set. Also, when `cpu_usage_threshold` or `memory_usage_threshold` are used, `min_scale` can't be set to 0.
218+
Refer to the [API Reference](https://www.scaleway.com/en/developers/api/serverless-containers/#path-containers-create-a-new-container) for more information.

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ require (
2828
github.com/nats-io/jwt/v2 v2.7.3
2929
github.com/nats-io/nats.go v1.38.0
3030
github.com/robfig/cron/v3 v3.0.1
31-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250117133139-e360c98f921d
31+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250206152403-1eed2f2ce9d3
3232
github.com/stretchr/testify v1.10.0
3333
golang.org/x/crypto v0.32.0
3434
gopkg.in/dnaeon/go-vcr.v3 v3.2.0
@@ -125,9 +125,9 @@ require (
125125
go.opentelemetry.io/otel/trace v1.31.0 // indirect
126126
golang.org/x/mod v0.22.0 // indirect
127127
golang.org/x/net v0.34.0 // indirect
128-
golang.org/x/sync v0.10.0 // indirect
128+
golang.org/x/sync v0.11.0 // indirect
129129
golang.org/x/sys v0.29.0 // indirect
130-
golang.org/x/text v0.21.0 // indirect
130+
golang.org/x/text v0.22.0 // indirect
131131
golang.org/x/time v0.3.0 // indirect
132132
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
133133
google.golang.org/appengine v1.6.8 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXq
280280
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
281281
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
282282
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
283-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250117133139-e360c98f921d h1:npDtKGreHq1EA6DoHo18YG25bsvZVlo4XlNm822GZ7A=
284-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250117133139-e360c98f921d/go.mod h1:kzh+BSAvpoyHHdHBCDhmSWtBc1NbLMZ2lWHqnBoxFks=
283+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250206152403-1eed2f2ce9d3 h1:wNQbwsFYaWiqTRtAgO5uroCTsS0o8FPGdI/x4hCJqtM=
284+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250206152403-1eed2f2ce9d3/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
285285
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
286286
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
287287
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
@@ -370,8 +370,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
370370
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
371371
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
372372
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
373-
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
374-
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
373+
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
374+
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
375375
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
376376
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
377377
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -401,8 +401,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
401401
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
402402
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
403403
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
404-
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
405-
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
404+
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
405+
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
406406
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
407407
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
408408
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

internal/acctest/checks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func CheckResourceAttrFunc(name string, key string, test func(string) error) res
9797

9898
err := test(value)
9999
if err != nil {
100-
return fmt.Errorf("test for %s %s did not pass test: %s", name, key, err)
100+
return fmt.Errorf("test for %s %s did not pass test: %w", name, key, err)
101101
}
102102

103103
return nil

internal/datasource/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (e *TooManyResultsError) Error() string {
6969
}
7070

7171
func (e *TooManyResultsError) Is(err error) bool {
72-
_, ok := err.(*TooManyResultsError) //nolint:errorlint // Explicitly does *not* match down the error tree
72+
_, ok := err.(*TooManyResultsError)
7373

7474
return ok
7575
}

internal/meta/meta.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package meta
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"net/http"
78
"os"
@@ -162,7 +163,8 @@ func customizeUserAgent(providerVersion string, terraformVersion string) string
162163
func loadProfile(ctx context.Context, d *schema.ResourceData) (*scw.Profile, *CredentialsSource, error) {
163164
config, err := scw.LoadConfig()
164165
// If the config file do not exist, don't return an error as we may find config in ENV or flags.
165-
if _, isNotFoundError := err.(*scw.ConfigFileNotFoundError); isNotFoundError {
166+
var configFileNotFoundError *scw.ConfigFileNotFoundError
167+
if errors.As(err, &configFileNotFoundError) {
166168
config = &scw.Config{}
167169
} else if err != nil {
168170
return nil, nil, err

0 commit comments

Comments
 (0)