Skip to content

Commit 8561404

Browse files
authored
fix(rdb): add missing transient status on snapshots, read replicas (#2589)
1 parent d708323 commit 8561404

16 files changed

+44
-16
lines changed

cmd/scw/testdata/test-all-usage-rdb-instance-upgrade-usage.golden

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Upgrade your current `node_type` or enable high availability on your standalone database instance.
3+
Upgrade your current instance specifications like node type, high availability, volume, or db engine version.
44

55
USAGE:
66
scw rdb instance upgrade <instance-id ...> [arg=value ...]
77

88
ARGS:
9-
instance-id UUID of the instance you want to upgrade
10-
[node-type] Node type of the instance you want to upgrade to (DB-DEV-S | DB-DEV-M | DB-DEV-L | DB-DEV-XL | DB-GP-XS | DB-GP-S | DB-GP-M | DB-GP-L | DB-GP-XL)
11-
[enable-ha] Set to true to enable high availability on your instance
12-
[volume-size] Increase your block storage volume size
13-
[volume-type] Change your instance storage type (lssd | bssd)
14-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
9+
instance-id UUID of the instance you want to upgrade
10+
[node-type] Node type of the instance you want to upgrade to (DB-DEV-S | DB-DEV-M | DB-DEV-L | DB-DEV-XL | DB-GP-XS | DB-GP-S | DB-GP-M | DB-GP-L | DB-GP-XL)
11+
[enable-ha] Set to true to enable high availability on your instance
12+
[volume-size] Increase your block storage volume size
13+
[volume-type] Change your instance storage type (lssd | bssd)
14+
[upgradable-version-id] Update your instance database engine to a newer version
15+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1516

1617
FLAGS:
1718
-h, --help help for upgrade

cmd/scw/testdata/test-all-usage-rdb-instance-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ AVAILABLE COMMANDS:
1616
renew-certificate Renew the TLS certificate of an instance
1717
restart Restart an instance
1818
update Update an instance
19-
upgrade Upgrade an instance to an higher instance type
19+
upgrade Upgrade an instance
2020
wait Wait for an instance to reach a stable state
2121

2222
FLAGS:

docs/commands/rdb.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Database RDB API
3333
- [Renew the TLS certificate of an instance](#renew-the-tls-certificate-of-an-instance)
3434
- [Restart an instance](#restart-an-instance)
3535
- [Update an instance](#update-an-instance)
36-
- [Upgrade an instance to an higher instance type](#upgrade-an-instance-to-an-higher-instance-type)
36+
- [Upgrade an instance](#upgrade-an-instance)
3737
- [Wait for an instance to reach a stable state](#wait-for-an-instance-to-reach-a-stable-state)
3838
- [Instance logs management commands](#instance-logs-management-commands)
3939
- [Get specific logs of a given instance](#get-specific-logs-of-a-given-instance)
@@ -713,9 +713,9 @@ scw rdb instance update 11111111-1111-1111-1111-111111111111 settings.0.name=tim
713713

714714

715715

716-
### Upgrade an instance to an higher instance type
716+
### Upgrade an instance
717717

718-
Upgrade your current `node_type` or enable high availability on your standalone database instance.
718+
Upgrade your current instance specifications like node type, high availability, volume, or db engine version.
719719

720720
**Usage:**
721721

@@ -733,6 +733,7 @@ scw rdb instance upgrade <instance-id ...> [arg=value ...]
733733
| enable-ha | | Set to true to enable high availability on your instance |
734734
| volume-size | | Increase your block storage volume size |
735735
| volume-type | One of: `lssd`, `bssd` | Change your instance storage type |
736+
| upgradable-version-id | | Update your instance database engine to a newer version |
736737
| 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 |
737738

738739

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/kubernetes-client/go-base v0.0.0-20190205182333-3d0e39759d98
1919
github.com/mattn/go-colorable v0.1.13
2020
github.com/mattn/go-isatty v0.0.16
21-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221028135716-52f31ff92d45
21+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20221110140415-da7aef73c340
2222
github.com/spf13/cobra v1.6.1
2323
github.com/spf13/pflag v1.0.5
2424
github.com/stretchr/testify v1.8.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw
7171
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
7272
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
7373
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
74-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221028135716-52f31ff92d45 h1:nmTv5yXEYMxlGi5keSEh2J324bKQidqUae4XcmzmPPA=
75-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221028135716-52f31ff92d45/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
74+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20221110140415-da7aef73c340 h1:tH8BcYA7PG4ayD9AEiskZJEgzx6y0SyJ46DDK03XA48=
75+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20221110140415-da7aef73c340/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
7676
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
7777
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
7878
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=

internal/namespaces/rdb/v1/rdb_cli.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ func rdbBackupExport() *core.Command {
573573

574574
func rdbInstanceUpgrade() *core.Command {
575575
return &core.Command{
576-
Short: `Upgrade an instance to an higher instance type`,
577-
Long: `Upgrade your current ` + "`" + `node_type` + "`" + ` or enable high availability on your standalone database instance.`,
576+
Short: `Upgrade an instance`,
577+
Long: `Upgrade your current instance specifications like node type, high availability, volume, or db engine version.`,
578578
Namespace: "rdb",
579579
Resource: "instance",
580580
Verb: "upgrade",
@@ -617,6 +617,13 @@ func rdbInstanceUpgrade() *core.Command {
617617
Positional: false,
618618
EnumValues: []string{"lssd", "bssd"},
619619
},
620+
{
621+
Name: "upgradable-version-id",
622+
Short: `Update your instance database engine to a newer version`,
623+
Required: false,
624+
Deprecated: false,
625+
Positional: false,
626+
},
620627
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
621628
},
622629
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

internal/namespaces/rdb/v1/testdata/test-clone-instance-simple.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ max_parallel_workers_per_gather 0
5252
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
5353
"status": "ready",
5454
"engine": "PostgreSQL-12",
55+
"upgradable_version": null,
5556
"endpoint": {
5657
"id": "389a42f1-9e27-49f6-8a54-73ffa3a80f03",
5758
"ip": "51.159.112.132",

internal/namespaces/rdb/v1/testdata/test-create-instance-simple.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ max_parallel_workers_per_gather 0
5252
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
5353
"status": "ready",
5454
"engine": "PostgreSQL-12",
55+
"upgradable_version": null,
5556
"endpoint": {
5657
"id": "a1800b6a-5a91-4bf4-8b62-0de378bfcfe0",
5758
"ip": "51.159.112.132",

internal/namespaces/rdb/v1/testdata/test-get-instance-simple.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ max_parallel_workers_per_gather 0
5252
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
5353
"status": "ready",
5454
"engine": "PostgreSQL-12",
55+
"upgradable_version": null,
5556
"endpoint": {
5657
"id": "ab0013b4-223a-4079-9a75-1e1308ab3b9d",
5758
"ip": "51.159.112.132",

internal/namespaces/rdb/v1/testdata/test-list-instance-simple.golden

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ b51d2372-01a1-4249-9ce3-0e47600033ae cli-test db-
2626
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
2727
"status": "ready",
2828
"engine": "PostgreSQL-12",
29+
"upgradable_version": null,
2930
"endpoint": {
3031
"id": "400a5d57-8c91-4cfe-bfed-b9748d24d8ac",
3132
"ip": "51.158.59.143",
@@ -98,6 +99,7 @@ b51d2372-01a1-4249-9ce3-0e47600033ae cli-test db-
9899
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
99100
"status": "ready",
100101
"engine": "PostgreSQL-12",
102+
"upgradable_version": null,
101103
"endpoint": {
102104
"id": "dc3e0459-77a1-4953-a43e-05f88f468857",
103105
"ip": "51.158.56.215",
@@ -170,6 +172,7 @@ b51d2372-01a1-4249-9ce3-0e47600033ae cli-test db-
170172
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
171173
"status": "ready",
172174
"engine": "PostgreSQL-12",
175+
"upgradable_version": null,
173176
"endpoint": {
174177
"id": "ac701eae-3bc0-4d36-a0e5-5a54e030c1df",
175178
"ip": "51.159.24.228",
@@ -242,6 +245,7 @@ b51d2372-01a1-4249-9ce3-0e47600033ae cli-test db-
242245
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
243246
"status": "ready",
244247
"engine": "PostgreSQL-12",
248+
"upgradable_version": null,
245249
"endpoint": {
246250
"id": "453374d4-2ed4-4a54-b142-01365a746c02",
247251
"ip": "195.154.69.177",
@@ -314,6 +318,7 @@ b51d2372-01a1-4249-9ce3-0e47600033ae cli-test db-
314318
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
315319
"status": "ready",
316320
"engine": "PostgreSQL-12",
321+
"upgradable_version": null,
317322
"endpoint": {
318323
"id": "f21b6d40-f053-4384-9b6c-5b8ed6d3cd25",
319324
"ip": "195.154.71.177",
@@ -386,6 +391,7 @@ b51d2372-01a1-4249-9ce3-0e47600033ae cli-test db-
386391
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
387392
"status": "initializing",
388393
"engine": "PostgreSQL-12",
394+
"upgradable_version": null,
389395
"endpoint": {
390396
"id": "63a508a6-9d76-4656-a420-320e21ab1ece",
391397
"ip": "195.154.70.113",
@@ -458,6 +464,7 @@ b51d2372-01a1-4249-9ce3-0e47600033ae cli-test db-
458464
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
459465
"status": "deleting",
460466
"engine": "PostgreSQL-12",
467+
"upgradable_version": null,
461468
"endpoint": {
462469
"id": "ab0013b4-223a-4079-9a75-1e1308ab3b9d",
463470
"ip": "51.159.112.132",
@@ -530,6 +537,7 @@ b51d2372-01a1-4249-9ce3-0e47600033ae cli-test db-
530537
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
531538
"status": "backuping",
532539
"engine": "PostgreSQL-12",
540+
"upgradable_version": null,
533541
"endpoint": {
534542
"id": "fb0f23b8-8c13-4748-b1ab-11b160ddf0ab",
535543
"ip": "195.154.69.50",
@@ -602,6 +610,7 @@ b51d2372-01a1-4249-9ce3-0e47600033ae cli-test db-
602610
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
603611
"status": "ready",
604612
"engine": "PostgreSQL-12",
613+
"upgradable_version": null,
605614
"endpoint": {
606615
"id": "e3eb041d-2b02-41b0-a879-dad257ae1830",
607616
"ip": "195.154.69.50",
@@ -674,6 +683,7 @@ b51d2372-01a1-4249-9ce3-0e47600033ae cli-test db-
674683
"project_id": "951df375-e094-4d26-97c1-ba548eeb9c42",
675684
"status": "provisioning",
676685
"engine": "PostgreSQL-12",
686+
"upgradable_version": null,
677687
"tags": [],
678688
"settings": [
679689
{

0 commit comments

Comments
 (0)