Skip to content

Commit d1afbf6

Browse files
authored
Merge branch 'master' into container_vpc_integration
2 parents 838226e + 3b82cc0 commit d1afbf6

File tree

105 files changed

+48475
-44211
lines changed

Some content is hidden

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

105 files changed

+48475
-44211
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ linters:
7070
- promlinter # Check Prometheus metrics naming via promlint [fast: true, auto-fix: false]
7171
- protogetter # Reports direct reads from proto message fields when getters should be used [fast: false, auto-fix: true]
7272
- reassign # Checks that package variables are not reassigned [fast: false, auto-fix: false]
73+
- recvcheck # Checks for receiver type consistency.
7374
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false]
7475
- rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false]
7576
- sloglint # ensure consistent code style when using log/slog [fast: false, auto-fix: false]

docs/resources/function.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ The following arguments are supported:
9999

100100
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the functions namespace is associated with.
101101

102+
- `private_network_id` (Optional) The ID of the Private Network the function is connected to.
103+
104+
~> **Important** This feature is currently in beta and requires a namespace with VPC integration activated by setting the `activate_vpc_integration` attribute to `true`.
102105

103106
## Attributes Reference
104107

docs/resources/function_namespace.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ The following arguments are supported:
4040

4141
- `secret_environment_variables` - (Optional) The secret environment variables of the namespace.
4242

43+
- `activate_vpc_integration` - (Optional) Activates VPC integration for the namespace. Functions of a namespace with VPC integration activated will be able to connect to a Private Network.
44+
45+
~> **Important** Updates to `activate_vpc_integration` will recreate the namespace.
46+
4347
## Attributes Reference
4448

4549
The `scaleway_function_namespace` resource exports certain attributes once the Functions namespace has been created. These attributes can be referenced in other parts of your Terraform configuration.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ require (
2828
github.com/nats-io/jwt/v2 v2.7.4
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.33.0.20250604134054-a06406d42247
31+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250613133518-6987cd48643b
3232
github.com/stretchr/testify v1.10.0
3333
golang.org/x/crypto v0.38.0
3434
gopkg.in/dnaeon/go-vcr.v3 v3.2.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
447447
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
448448
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
449449
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
450-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250604134054-a06406d42247 h1:wlIvcSpGl3mGDpQmwrZHnYMIlB7Mwx3bhg151LG22Ws=
451-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250604134054-a06406d42247/go.mod h1:qiGzapFyNPFwBBLJ+hTFykKSnU95n1zL64+o1ubmwf0=
450+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250613133518-6987cd48643b h1:7V7T9XzUl+B/6zHeNxyX0DV3OVjCSedA0stHo0BNKZw=
451+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250613133518-6987cd48643b/go.mod h1:zFWiHphneiey3s8HOtAEnGrRlWivNaxW5T6d5Xfco7g=
452452
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
453453
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
454454
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=

internal/acctest/acctest.go

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -102,65 +102,6 @@ func extractGeneratedNamePrefix(name string) string {
102102
return name
103103
}
104104

105-
// compareJSONFieldsStrings compare two strings from request JSON bodies
106-
// has special case when string are terraform generated names
107-
func compareJSONFieldsStrings(expected, actual string) bool {
108-
expectedHandled := expected
109-
actualHandled := actual
110-
111-
// Remove s3 url suffix to allow comparison
112-
if strings.HasSuffix(actual, ".s3-website.fr-par.scw.cloud") {
113-
actual = strings.TrimSuffix(actual, ".s3-website.fr-par.scw.cloud")
114-
expected = strings.TrimSuffix(expected, ".s3-website.fr-par.scw.cloud")
115-
}
116-
117-
// Try to parse test generated name
118-
if strings.Contains(actual, "-") {
119-
expectedHandled = extractTestGeneratedNamePrefix(expected)
120-
actualHandled = extractTestGeneratedNamePrefix(actual)
121-
}
122-
123-
// Try provider generated name
124-
if actualHandled == actual && strings.HasPrefix(actual, "tf-") {
125-
expectedHandled = extractGeneratedNamePrefix(expected)
126-
actualHandled = extractGeneratedNamePrefix(actual)
127-
}
128-
129-
return expectedHandled == actualHandled
130-
}
131-
132-
// compareJSONBodies compare two given maps that represent json bodies
133-
// returns true if both json are equivalent
134-
func compareJSONBodies(expected, actual map[string]any) bool {
135-
// Check for each key in actual requests
136-
// Compare its value to cassette content if marshal-able to string
137-
for key := range actual {
138-
expectedValue, exists := expected[key]
139-
if !exists {
140-
// Actual request may contain a field that does not exist in cassette
141-
// New fields can appear in requests with new api features
142-
// We do not want to generate new cassettes for each new features
143-
continue
144-
}
145-
146-
if !compareJSONFields(expectedValue, actual[key]) {
147-
return false
148-
}
149-
}
150-
151-
for key := range expected {
152-
_, exists := actual[key]
153-
if !exists && expected[key] != nil {
154-
// Fails match if cassettes contains a field not in actual requests
155-
// Fields should not disappear from requests unless a sdk breaking change
156-
// We ignore if field is nil in cassette as it could be an old deprecated and unused field
157-
return false
158-
}
159-
}
160-
161-
return true
162-
}
163-
164105
// IsTestResource returns true if given resource identifier is from terraform test
165106
// identifier should be resource name but some resource don't have names
166107
// return true if identifier match regex "tf[-_]test"

0 commit comments

Comments
 (0)