Skip to content

Commit 848c07a

Browse files
authored
Merge branch 'scaleway:master' into master
2 parents 6de172e + 7e180e4 commit 848c07a

File tree

200 files changed

+42506
-234966
lines changed

Some content is hidden

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

200 files changed

+42506
-234966
lines changed

.github/workflows/unit-tests.yaml renamed to .github/workflows/build.yml

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ var foldersUsingVCRv4 = []string{
316316
}
317317

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

321-
folder := fullPathSplit[len(fullPathSplit)-1]
321+
folder := fullPathSplit[len(fullPathSplit)-2]
322322
for _, migratedFolder := range foldersUsingVCRv4 {
323323
if migratedFolder == folder {
324324
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ 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

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
464464
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
465465
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
466466
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
467-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251029154854-a599ef194f4a h1:hV/QEq3wgx5brT5CQQstOJ3XoT2/oBT4rSTGixl/Kig=
468-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251029154854-a599ef194f4a/go.mod h1:SVm1Zk6UpZtqZN6KtEQpjC+v+Lir4tyVfhQTU19q3PA=
467+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251112085626-07500e4c9ab7 h1:wNX0zhJJSya6OpoA7LYiJFm6ghM7vr2OjO2M53v9AdM=
468+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251112085626-07500e4c9ab7/go.mod h1:BBENv1W9QH4COViJkDJB/0D1T6CweMAkDP7XehRsHQ8=
469469
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
470470
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
471471
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

internal/namespaces/instance/v1/custom_image_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
func Test_ImageCreate(t *testing.T) {
16-
t.Run("Create simple image", core.Test(&core.TestConfig{
16+
t.Run("Simple", core.Test(&core.TestConfig{
1717
BeforeFunc: core.BeforeFuncCombine(
1818
core.ExecStoreBeforeCmd(
1919
"Server",
@@ -68,7 +68,7 @@ func Test_ImageCreate(t *testing.T) {
6868
}
6969

7070
func Test_ImageDelete(t *testing.T) {
71-
t.Run("simple", core.Test(&core.TestConfig{
71+
t.Run("Simple", core.Test(&core.TestConfig{
7272
BeforeFunc: createImage("Image"),
7373
Commands: instance.GetCommands(),
7474
Cmd: "scw instance image delete {{ .Image.Image.ID }} with-snapshots=true",

0 commit comments

Comments
 (0)