Skip to content

Commit 67d354a

Browse files
authored
Merge branch 'master' into feat/rdb-benchmarks
2 parents 8b6d34b + 4fa7035 commit 67d354a

File tree

76 files changed

+24292
-14760
lines changed

Some content is hidden

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

76 files changed

+24292
-14760
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
# Initializes the CodeQL tools for scanning.
5050
- name: Initialize CodeQL
51-
uses: github/codeql-action/init@v3
51+
uses: github/codeql-action/init@v4
5252
with:
5353
languages: ${{ matrix.language }}
5454
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -59,7 +59,7 @@ jobs:
5959
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6060
# If this step fails, then you should remove it and run the build manually (see below)
6161
- name: Autobuild
62-
uses: github/codeql-action/autobuild@v3
62+
uses: github/codeql-action/autobuild@v4
6363

6464
# ℹ️ Command-line programs to run using the OS shell.
6565
# 📚 https://git.io/JvXDl
@@ -73,4 +73,4 @@ jobs:
7373
# make release
7474

7575
- name: Perform CodeQL Analysis
76-
uses: github/codeql-action/analyze@v3
76+
uses: github/codeql-action/analyze@v4

cmd/scw/testdata/test-all-usage-audit-trail-event-list-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ USAGE:
77

88
ARGS:
99
[project-id] (Optional) ID of the Project containing the Audit Trail events
10-
[resource-type] (Optional) Type of the Scaleway resource (unknown_type | secm_secret | secm_secret_version | kube_cluster | kube_pool | kube_node | kube_acl | keym_key | iam_user | iam_application | iam_group | iam_policy | iam_api_key | iam_ssh_key | iam_rule | iam_saml | iam_saml_certificate | secret_manager_secret | secret_manager_version | key_manager_key | account_user | account_organization | account_project | instance_server | instance_placement_group | instance_security_group | instance_volume | instance_snapshot | instance_image | apple_silicon_server | baremetal_server | baremetal_setting | ipam_ip | sbs_volume | sbs_snapshot | load_balancer_lb | load_balancer_ip | load_balancer_frontend | load_balancer_backend | load_balancer_route | load_balancer_acl | load_balancer_certificate | sfs_filesystem | vpc_private_network)
10+
[resource-type] (Optional) Type of the Scaleway resource (unknown_type | secm_secret | secm_secret_version | kube_cluster | kube_pool | kube_node | kube_acl | keym_key | iam_user | iam_application | iam_group | iam_policy | iam_api_key | iam_ssh_key | iam_rule | iam_saml | iam_saml_certificate | secret_manager_secret | secret_manager_version | key_manager_key | account_user | account_organization | account_project | instance_server | instance_placement_group | instance_security_group | instance_volume | instance_snapshot | instance_image | apple_silicon_server | baremetal_server | baremetal_setting | ipam_ip | sbs_volume | sbs_snapshot | load_balancer_lb | load_balancer_ip | load_balancer_frontend | load_balancer_backend | load_balancer_route | load_balancer_acl | load_balancer_certificate | sfs_filesystem | vpc_private_network | edge_services_plan | edge_services_pipeline | edge_services_dns_stage | edge_services_tls_stage | edge_services_cache_stage | edge_services_route_stage | edge_services_route_rules | edge_services_waf_stage | edge_services_backend_stage)
1111
[method-name] (Optional) Name of the method of the API call performed
1212
[status] (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied
1313
[recorded-after] (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default

cmd/scw/testdata/test-all-usage-registry-tag-delete-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ USAGE:
77

88
ARGS:
99
tag-id UUID of the tag
10+
[timeout] Maximum time to handle the request
1011
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1112

1213
DEPRECATED ARGS:

core/testing.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ var DefaultRetryInterval *time.Duration
312312

313313
var foldersUsingVCRv4 = []string{
314314
"instance",
315+
"k8s",
315316
}
316317

317318
func folderUsesVCRv4(fullFolderPath string) bool {
@@ -678,6 +679,14 @@ func ExecBeforeCmdArgs(args []string) BeforeFunc {
678679
}
679680
}
680681

682+
// ExecBeforeCmdWithResult executes the given command and returns its result.
683+
func ExecBeforeCmdWithResult(ctx *BeforeFuncCtx, cmd string) any {
684+
args := cmdToArgs(ctx.Meta, cmd)
685+
ctx.Logger.Debugf("ExecBeforeCmd: args=%s\n", args)
686+
687+
return ctx.ExecuteCmd(args)
688+
}
689+
681690
// ExecAfterCmd executes the given before command.
682691
func ExecAfterCmd(cmd string) AfterFunc {
683692
return func(ctx *AfterFuncCtx) error {

docs/commands/audit-trail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ scw audit-trail event list [arg=value ...]
2929
| Name | | Description |
3030
|------|---|-------------|
3131
| project-id | | (Optional) ID of the Project containing the Audit Trail events |
32-
| resource-type | One of: `unknown_type`, `secm_secret`, `secm_secret_version`, `kube_cluster`, `kube_pool`, `kube_node`, `kube_acl`, `keym_key`, `iam_user`, `iam_application`, `iam_group`, `iam_policy`, `iam_api_key`, `iam_ssh_key`, `iam_rule`, `iam_saml`, `iam_saml_certificate`, `secret_manager_secret`, `secret_manager_version`, `key_manager_key`, `account_user`, `account_organization`, `account_project`, `instance_server`, `instance_placement_group`, `instance_security_group`, `instance_volume`, `instance_snapshot`, `instance_image`, `apple_silicon_server`, `baremetal_server`, `baremetal_setting`, `ipam_ip`, `sbs_volume`, `sbs_snapshot`, `load_balancer_lb`, `load_balancer_ip`, `load_balancer_frontend`, `load_balancer_backend`, `load_balancer_route`, `load_balancer_acl`, `load_balancer_certificate`, `sfs_filesystem`, `vpc_private_network` | (Optional) Type of the Scaleway resource |
32+
| resource-type | One of: `unknown_type`, `secm_secret`, `secm_secret_version`, `kube_cluster`, `kube_pool`, `kube_node`, `kube_acl`, `keym_key`, `iam_user`, `iam_application`, `iam_group`, `iam_policy`, `iam_api_key`, `iam_ssh_key`, `iam_rule`, `iam_saml`, `iam_saml_certificate`, `secret_manager_secret`, `secret_manager_version`, `key_manager_key`, `account_user`, `account_organization`, `account_project`, `instance_server`, `instance_placement_group`, `instance_security_group`, `instance_volume`, `instance_snapshot`, `instance_image`, `apple_silicon_server`, `baremetal_server`, `baremetal_setting`, `ipam_ip`, `sbs_volume`, `sbs_snapshot`, `load_balancer_lb`, `load_balancer_ip`, `load_balancer_frontend`, `load_balancer_backend`, `load_balancer_route`, `load_balancer_acl`, `load_balancer_certificate`, `sfs_filesystem`, `vpc_private_network`, `edge_services_plan`, `edge_services_pipeline`, `edge_services_dns_stage`, `edge_services_tls_stage`, `edge_services_cache_stage`, `edge_services_route_stage`, `edge_services_route_rules`, `edge_services_waf_stage`, `edge_services_backend_stage` | (Optional) Type of the Scaleway resource |
3333
| method-name | | (Optional) Name of the method of the API call performed |
3434
| status | | (Optional) HTTP status code of the request. Returns either `200` if the request was successful or `403` if the permission was denied |
3535
| recorded-after | | (Optional) The `recorded_after` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns `one hour ago` by default |

docs/commands/registry.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ scw registry tag delete <tag-id ...> [arg=value ...]
332332
| Name | | Description |
333333
|------|---|-------------|
334334
| tag-id | Required | UUID of the tag |
335+
| timeout | | Maximum time to handle the request |
335336
| ~~force~~ | Deprecated | If two tags share the same digest the deletion will fail unless this parameter is set to true (deprecated) |
336337
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
337338

docs/cookbook.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,69 @@ scw instance server list zone=all -o template="{{.ID}} zone={{.Zone}}" | xargs -
8888
scw rdb backup list -ojson | jq --arg d "$(date -d "7 days ago" --utc --iso-8601=ns)" '.[] | select (.created_at < $d)'
8989
```
9090

91+
### Configure password storage for rdb connect
92+
93+
The `scw rdb instance connect` command can automatically use stored credentials to avoid typing passwords manually. Here's how to configure it for PostgreSQL and MySQL.
94+
95+
#### PostgreSQL - Using .pgpass file
96+
97+
Create a password file to store your connection credentials securely:
98+
99+
```bash
100+
# Linux/macOS: Create ~/.pgpass
101+
cat > ~/.pgpass << 'EOF'
102+
# Format: hostname:port:database:username:password
103+
51.159.25.206:13917:rdb:myuser:mypassword
104+
# You can use * as wildcard
105+
*:*:*:myuser:mypassword
106+
EOF
107+
chmod 600 ~/.pgpass
108+
109+
# Windows: Create %APPDATA%\postgresql\pgpass.conf
110+
# Same format as above
111+
```
112+
113+
Then connect without password prompt:
114+
```bash
115+
scw rdb instance connect <instance-id> username=myuser
116+
```
117+
118+
**Documentation:** https://www.postgresql.org/docs/current/libpq-pgpass.html
119+
120+
#### MySQL - Using mysql_config_editor
121+
122+
MySQL provides `mysql_config_editor` for secure, obfuscated password storage:
123+
124+
```bash
125+
# Configure credentials for a login path
126+
mysql_config_editor set --login-path=scw \
127+
--host=195.154.69.163 \
128+
--port=12210 \
129+
--user=myuser \
130+
--password
131+
# You'll be prompted to enter the password securely
132+
133+
# Verify configuration (password will be masked)
134+
mysql_config_editor print --login-path=scw
135+
136+
# Connect using the login path
137+
mysql --login-path=scw --database=rdb
138+
```
139+
140+
The credentials are stored in `~/.mylogin.cnf` (Linux/macOS) or `%APPDATA%\MySQL\.mylogin.cnf` (Windows).
141+
142+
**Alternative:** You can also use `~/.my.cnf` for plain-text storage (less secure):
143+
```bash
144+
cat > ~/.my.cnf << 'EOF'
145+
[client]
146+
user=myuser
147+
password=mypassword
148+
EOF
149+
chmod 600 ~/.my.cnf
150+
```
151+
152+
**Documentation:** https://dev.mysql.com/doc/refman/8.0/en/mysql-config-editor.html
153+
91154
## IPAM
92155

93156
### Find resource ipv4 with exact name using jq

go.mod

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ module github.com/scaleway/scaleway-cli/v2
33
go 1.25.0
44

55
require (
6-
github.com/aws/aws-sdk-go-v2 v1.39.5
7-
github.com/aws/aws-sdk-go-v2/service/s3 v1.89.0
6+
github.com/aws/aws-sdk-go-v2 v1.39.6
7+
github.com/aws/aws-sdk-go-v2/service/s3 v1.89.2
88
github.com/buildpacks/pack v0.38.2
99
github.com/c-bata/go-prompt v0.2.6
1010
github.com/charmbracelet/bubbletea v1.3.10
1111
github.com/chzyer/readline v1.5.1
1212
github.com/containerd/console v1.0.5
1313
github.com/dnaeon/go-vcr v1.2.0
14-
github.com/docker/docker v28.5.1+incompatible
14+
github.com/docker/docker v28.5.2+incompatible
1515
github.com/dustin/go-humanize v1.0.1
1616
github.com/fatih/color v1.18.0
1717
github.com/getsentry/sentry-go v0.36.2
@@ -21,7 +21,7 @@ require (
2121
github.com/karrick/tparse/v2 v2.8.2
2222
github.com/mattn/go-colorable v0.1.14
2323
github.com/mattn/go-isatty v0.0.20
24-
github.com/moby/buildkit v0.25.1
24+
github.com/moby/buildkit v0.25.2
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251029154854-a599ef194f4a
2727
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
@@ -54,24 +54,24 @@ require (
5454
github.com/ProtonMail/go-crypto v1.3.0 // indirect
5555
github.com/agext/levenshtein v1.2.3 // indirect
5656
github.com/apex/log v1.9.0 // indirect
57-
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.2 // indirect
57+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.3 // indirect
5858
github.com/aws/aws-sdk-go-v2/config v1.31.6 // indirect
5959
github.com/aws/aws-sdk-go-v2/credentials v1.18.10 // indirect
6060
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.6 // indirect
61-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.11 // indirect
62-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.11 // indirect
61+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.13 // indirect
62+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.13 // indirect
6363
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
64-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.11 // indirect
64+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.13 // indirect
6565
github.com/aws/aws-sdk-go-v2/service/ecr v1.50.1 // indirect
6666
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.37.2 // indirect
67-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.2 // indirect
68-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.2 // indirect
69-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.11 // indirect
70-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.11 // indirect
67+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.3 // indirect
68+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.4 // indirect
69+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.13 // indirect
70+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.13 // indirect
7171
github.com/aws/aws-sdk-go-v2/service/sso v1.29.1 // indirect
7272
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.2 // indirect
7373
github.com/aws/aws-sdk-go-v2/service/sts v1.38.2 // indirect
74-
github.com/aws/smithy-go v1.23.1 // indirect
74+
github.com/aws/smithy-go v1.23.2 // indirect
7575
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.10.1 // indirect
7676
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
7777
github.com/beorn7/perks v1.0.1 // indirect

0 commit comments

Comments
 (0)