Skip to content

Commit 8058a7e

Browse files
authored
Merge branch 'master' into feat/rdb-benchmarks
2 parents 63c5bc5 + 4cc5461 commit 8058a7e

File tree

211 files changed

+44619
-236223
lines changed

Some content is hidden

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

211 files changed

+44619
-236223
lines changed
Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: Build
22

33
permissions:
44
contents: read
@@ -8,16 +8,9 @@ on:
88
merge_group:
99

1010
jobs:
11-
os-tests:
12-
strategy:
13-
matrix:
14-
platform: [ubuntu-latest, macos-latest, windows-latest]
15-
runs-on: ${{ matrix.platform }}
11+
native-binary:
12+
runs-on: ubuntu-latest
1613
steps:
17-
- name: Set git to use LF to avoid problem with goldens on windows
18-
run: |
19-
git config --global core.autocrlf false
20-
git config --global core.eol lf
2114
# Checkout should always be before setup-go to ensure caching is working
2215
- name: Checkout
2316
uses: actions/checkout@v5
@@ -31,31 +24,14 @@ jobs:
3124
run: |
3225
go mod tidy
3326
git diff --exit-code
34-
- name: Run unit tests
35-
run: go tool gotestsum --format github-actions
36-
- name: Execute main binary # Test the runtime for potential panics.
37-
run: go run cmd/scw/main.go -h
38-
39-
build-tests:
40-
runs-on: ubuntu-latest
41-
steps:
42-
# Checkout should always be before setup-go to ensure caching is working
43-
- name: Checkout
44-
uses: actions/checkout@v5
45-
with:
46-
fetch-depth: 1
47-
- name: Install Go
48-
uses: actions/setup-go@v6
49-
with:
50-
go-version: stable
5127
- name: Build binaries
5228
run: ./scripts/build.sh
5329
- name: Print binaries size
5430
run: ls -lh ./bin
5531
- name: Check binary size
5632
run: ./scripts/check-size.sh ./bin/*linux-x86_64
5733

58-
docker-tests:
34+
docker:
5935
runs-on: ubuntu-latest
6036
steps:
6137
- name: Checkout

.github/workflows/tests.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
merge_group:
9+
10+
jobs:
11+
namespaces:
12+
strategy:
13+
matrix:
14+
platform:
15+
- ubuntu-latest
16+
- macos-latest
17+
- windows-latest
18+
products:
19+
- account
20+
- applesilicon
21+
- baremetal
22+
- billing
23+
- block
24+
- cockpit
25+
- container
26+
- dedibox
27+
- domain
28+
- edge_services
29+
- flexibleip
30+
- function
31+
- iam
32+
- inference
33+
- init
34+
- instance
35+
- iot
36+
- ipam
37+
- jobs
38+
- k8s
39+
- key_manager
40+
- lb
41+
- login
42+
- marketplace
43+
- mnq
44+
- mongodb
45+
- object
46+
- rdb
47+
- redis
48+
- registry
49+
- serverless_sqldb
50+
- secret
51+
- tem
52+
- vpc
53+
- vpcgw
54+
- webhosting
55+
runs-on: ${{ matrix.platform }}
56+
steps:
57+
- name: Set git to use LF to avoid problem with goldens on windows
58+
run: |
59+
git config --global core.autocrlf false
60+
git config --global core.eol lf
61+
# Checkout should always be before setup-go to ensure caching is working
62+
- name: Checkout
63+
uses: actions/checkout@v5
64+
with:
65+
fetch-depth: 1
66+
- name: Install Go
67+
uses: actions/setup-go@v6
68+
with:
69+
go-version: stable
70+
- name: Run tests
71+
run: go tool gotestsum --format github-actions -- -v ./internal/namespaces/${{ matrix.products }}/...
72+
- name: Execute main binary # Test the runtime for potential panics.
73+
run: go run cmd/scw/main.go -h
74+
others:
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v5
79+
with:
80+
fetch-depth: 1
81+
- name: Install Go
82+
uses: actions/setup-go@v6
83+
with:
84+
go-version: stable
85+
- name: Run tests outside of products namespaces
86+
run: go list ./... | grep -v 'internal/namespaces' | xargs go tool gotestsum --format github-actions -- -v

cmd/scw/testdata/test-all-usage-ipam-ip-list-usage.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ ARGS:
1616
[resource-name] Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
1717
[resource-id] Resource ID to filter for. Only IPs attached to this resource will be returned
1818
[resource-ids.{index}] Resource IDs to filter for. Only IPs attached to at least one of these resources will be returned
19-
[resource-type] Resource type to filter for. Only IPs attached to this type of resource will be returned (unknown_type | custom | instance_server | instance_ip | instance_private_nic | lb_server | fip_ip | vpc_gateway | vpc_gateway_network | k8s_node | k8s_cluster | rdb_instance | redis_cluster | baremetal_server | baremetal_private_nic | llm_deployment | mgdb_instance | apple_silicon_server | apple_silicon_private_nic | serverless_container | serverless_function | vpn_gateway | ddl_datalab | kafka_cluster | bgp_endpoint | scbl_sedb_cluster)
20-
[resource-types.{index}] Resource types to filter for. Only IPs attached to these types of resources will be returned (unknown_type | custom | instance_server | instance_ip | instance_private_nic | lb_server | fip_ip | vpc_gateway | vpc_gateway_network | k8s_node | k8s_cluster | rdb_instance | redis_cluster | baremetal_server | baremetal_private_nic | llm_deployment | mgdb_instance | apple_silicon_server | apple_silicon_private_nic | serverless_container | serverless_function | vpn_gateway | ddl_datalab | kafka_cluster | bgp_endpoint | scbl_sedb_cluster)
19+
[resource-type] Resource type to filter for. Only IPs attached to this type of resource will be returned (unknown_type | custom | instance_server | instance_ip | instance_private_nic | lb_server | fip_ip | vpc_gateway | vpc_gateway_network | k8s_node | k8s_cluster | rdb_instance | redis_cluster | baremetal_server | baremetal_private_nic | llm_deployment | mgdb_instance | apple_silicon_server | apple_silicon_private_nic | serverless_container | serverless_function | vpn_gateway | ddl_datalab | kafka_cluster | bgp_endpoint | scbl_sedb_cluster | dtwh_deployment)
20+
[resource-types.{index}] Resource types to filter for. Only IPs attached to these types of resources will be returned (unknown_type | custom | instance_server | instance_ip | instance_private_nic | lb_server | fip_ip | vpc_gateway | vpc_gateway_network | k8s_node | k8s_cluster | rdb_instance | redis_cluster | baremetal_server | baremetal_private_nic | llm_deployment | mgdb_instance | apple_silicon_server | apple_silicon_private_nic | serverless_container | serverless_function | vpn_gateway | ddl_datalab | kafka_cluster | bgp_endpoint | scbl_sedb_cluster | dtwh_deployment)
2121
[mac-address] MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned
2222
[tags.{index}] Tags to filter for, only IPs with one or more matching tags will be returned
2323
[is-ipv6] Defines whether to filter only for IPv4s or IPv6s

core/testing.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,13 @@ var DefaultRetryInterval *time.Duration
313313
var foldersUsingVCRv4 = []string{
314314
"instance",
315315
"k8s",
316+
"marketplace",
316317
}
317318

318319
func folderUsesVCRv4(fullFolderPath string) bool {
319-
fullPathSplit := strings.Split(fullFolderPath, "/")
320+
fullPathSplit := strings.Split(fullFolderPath, string(os.PathSeparator))
320321

321-
folder := fullPathSplit[len(fullPathSplit)-1]
322+
folder := fullPathSplit[len(fullPathSplit)-2]
322323
for _, migratedFolder := range foldersUsingVCRv4 {
323324
if migratedFolder == folder {
324325
return true

docs/commands/ipam.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ scw ipam ip list [arg=value ...]
111111
| resource-name | | Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned. |
112112
| resource-id | | Resource ID to filter for. Only IPs attached to this resource will be returned |
113113
| resource-ids.{index} | | Resource IDs to filter for. Only IPs attached to at least one of these resources will be returned |
114-
| resource-type | One of: `unknown_type`, `custom`, `instance_server`, `instance_ip`, `instance_private_nic`, `lb_server`, `fip_ip`, `vpc_gateway`, `vpc_gateway_network`, `k8s_node`, `k8s_cluster`, `rdb_instance`, `redis_cluster`, `baremetal_server`, `baremetal_private_nic`, `llm_deployment`, `mgdb_instance`, `apple_silicon_server`, `apple_silicon_private_nic`, `serverless_container`, `serverless_function`, `vpn_gateway`, `ddl_datalab`, `kafka_cluster`, `bgp_endpoint`, `scbl_sedb_cluster` | Resource type to filter for. Only IPs attached to this type of resource will be returned |
115-
| resource-types.{index} | One of: `unknown_type`, `custom`, `instance_server`, `instance_ip`, `instance_private_nic`, `lb_server`, `fip_ip`, `vpc_gateway`, `vpc_gateway_network`, `k8s_node`, `k8s_cluster`, `rdb_instance`, `redis_cluster`, `baremetal_server`, `baremetal_private_nic`, `llm_deployment`, `mgdb_instance`, `apple_silicon_server`, `apple_silicon_private_nic`, `serverless_container`, `serverless_function`, `vpn_gateway`, `ddl_datalab`, `kafka_cluster`, `bgp_endpoint`, `scbl_sedb_cluster` | Resource types to filter for. Only IPs attached to these types of resources will be returned |
114+
| resource-type | One of: `unknown_type`, `custom`, `instance_server`, `instance_ip`, `instance_private_nic`, `lb_server`, `fip_ip`, `vpc_gateway`, `vpc_gateway_network`, `k8s_node`, `k8s_cluster`, `rdb_instance`, `redis_cluster`, `baremetal_server`, `baremetal_private_nic`, `llm_deployment`, `mgdb_instance`, `apple_silicon_server`, `apple_silicon_private_nic`, `serverless_container`, `serverless_function`, `vpn_gateway`, `ddl_datalab`, `kafka_cluster`, `bgp_endpoint`, `scbl_sedb_cluster`, `dtwh_deployment` | Resource type to filter for. Only IPs attached to this type of resource will be returned |
115+
| resource-types.{index} | One of: `unknown_type`, `custom`, `instance_server`, `instance_ip`, `instance_private_nic`, `lb_server`, `fip_ip`, `vpc_gateway`, `vpc_gateway_network`, `k8s_node`, `k8s_cluster`, `rdb_instance`, `redis_cluster`, `baremetal_server`, `baremetal_private_nic`, `llm_deployment`, `mgdb_instance`, `apple_silicon_server`, `apple_silicon_private_nic`, `serverless_container`, `serverless_function`, `vpn_gateway`, `ddl_datalab`, `kafka_cluster`, `bgp_endpoint`, `scbl_sedb_cluster`, `dtwh_deployment` | Resource types to filter for. Only IPs attached to these types of resources will be returned |
116116
| mac-address | | MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned |
117117
| tags.{index} | | Tags to filter for, only IPs with one or more matching tags will be returned |
118118
| is-ipv6 | | Defines whether to filter only for IPv4s or IPv6s |

go.mod

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@ require (
2323
github.com/mattn/go-isatty v0.0.20
2424
github.com/moby/buildkit v0.25.2
2525
github.com/opencontainers/go-digest v1.0.0
26-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251029154854-a599ef194f4a
26+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251112085626-07500e4c9ab7
2727
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2828
github.com/spf13/cobra v1.10.1
2929
github.com/spf13/pflag v1.0.10
3030
github.com/stretchr/testify v1.11.1
31-
golang.org/x/crypto v0.43.0
32-
golang.org/x/sync v0.17.0
33-
golang.org/x/term v0.36.0
34-
golang.org/x/text v0.30.0
31+
golang.org/x/crypto v0.44.0
32+
golang.org/x/sync v0.18.0
33+
golang.org/x/term v0.37.0
34+
golang.org/x/text v0.31.0
3535
gopkg.in/yaml.v3 v3.0.1
3636
)
3737

3838
require (
39+
cyphar.com/go-pathrs v0.2.1 // indirect
3940
dario.cat/mergo v1.0.2 // indirect
4041
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect
4142
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
@@ -96,7 +97,7 @@ require (
9697
github.com/containerd/stargz-snapshotter/estargz v0.17.0 // indirect
9798
github.com/containerd/ttrpc v1.2.7 // indirect
9899
github.com/containerd/typeurl/v2 v2.2.3 // indirect
99-
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
100+
github.com/cyphar/filepath-securejoin v0.6.0 // indirect
100101
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
101102
github.com/dimchansky/utfbom v1.1.1 // indirect
102103
github.com/distribution/reference v0.6.0 // indirect
@@ -160,7 +161,7 @@ require (
160161
github.com/muesli/termenv v0.16.0 // indirect
161162
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
162163
github.com/opencontainers/image-spec v1.1.1 // indirect
163-
github.com/opencontainers/selinux v1.12.0 // indirect
164+
github.com/opencontainers/selinux v1.13.0 // indirect
164165
github.com/pjbgf/sha1cd v0.5.0 // indirect
165166
github.com/pkg/errors v0.9.1 // indirect
166167
github.com/pkg/term v1.2.0-beta.2 // indirect
@@ -199,11 +200,11 @@ require (
199200
go.opentelemetry.io/otel/trace v1.38.0 // indirect
200201
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
201202
go.yaml.in/yaml/v2 v2.4.2 // indirect
202-
golang.org/x/mod v0.28.0 // indirect
203-
golang.org/x/net v0.45.0 // indirect
204-
golang.org/x/sys v0.37.0 // indirect
203+
golang.org/x/mod v0.29.0 // indirect
204+
golang.org/x/net v0.46.0 // indirect
205+
golang.org/x/sys v0.38.0 // indirect
205206
golang.org/x/time v0.12.0 // indirect
206-
golang.org/x/tools v0.37.0 // indirect
207+
golang.org/x/tools v0.38.0 // indirect
207208
google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a // indirect
208209
google.golang.org/genproto/googleapis/rpc v0.0.0-20250721164621-a45f3dfb1074 // indirect
209210
google.golang.org/grpc v1.74.2 // indirect

0 commit comments

Comments
 (0)