From 574f1e22c8cc10a40d4143970445e0598cb7620f Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Wed, 30 Mar 2022 09:01:01 +0000 Subject: [PATCH 1/3] feat: update generated cli --- ...-all-usage-k8s-cluster-create-usage.golden | 2 +- ...-all-usage-k8s-cluster-update-usage.golden | 2 +- ...st-all-usage-rdb-read-replica-usage.golden | 15 +++++++++++++ .../testdata/test-all-usage-rdb-usage.golden | 21 ++++++++++--------- docs/commands/k8s.md | 4 ++-- docs/commands/rdb.md | 17 +++++++++++++++ go.mod | 4 ---- internal/namespaces/k8s/v1/k8s_cli.go | 4 ++-- internal/namespaces/rdb/v1/rdb_cli.go | 11 ++++++++++ 9 files changed, 60 insertions(+), 20 deletions(-) create mode 100644 cmd/scw/testdata/test-all-usage-rdb-read-replica-usage.golden diff --git a/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden b/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden index a131d94e67..1d481efa90 100644 --- a/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden @@ -20,7 +20,6 @@ ARGS: [tags.{index}] The tags associated with the cluster version=latest The Kubernetes version of the cluster cni=cilium The Container Network Interface (CNI) plugin that will run in the cluster (unknown_cni | cilium | calico | weave | flannel | kilo) - [ingress] The Ingress Controller that will run in the cluster (unknown_ingress | none | nginx | traefik | traefik2) pools.{index}.name The name of the pool pools.{index}.node-type The node type is the type of Scaleway Instance wanted for the pool [pools.{index}.placement-group-id] The placement group ID in which all the nodes of the pool will be created @@ -63,6 +62,7 @@ ARGS: DEPRECATED ARGS: [enable-dashboard] The enablement of the Kubernetes Dashboard in the cluster + [ingress] The Ingress Controller that will run in the cluster (unknown_ingress | none | nginx | traefik | traefik2) FLAGS: -h, --help help for create diff --git a/cmd/scw/testdata/test-all-usage-k8s-cluster-update-usage.golden b/cmd/scw/testdata/test-all-usage-k8s-cluster-update-usage.golden index 006bd45378..dd653291e6 100644 --- a/cmd/scw/testdata/test-all-usage-k8s-cluster-update-usage.golden +++ b/cmd/scw/testdata/test-all-usage-k8s-cluster-update-usage.golden @@ -27,7 +27,6 @@ ARGS: [autoscaler-config.scale-down-unneeded-time] How long a node should be unneeded before it is eligible for scale down [autoscaler-config.scale-down-utilization-threshold] Node utilization level, defined as sum of requested resources divided by capacity, below which a node can be considered for scale down [autoscaler-config.max-graceful-termination-sec] Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node - [ingress] The new Ingress Controller for the cluster (unknown_ingress | none | nginx | traefik | traefik2) [auto-upgrade.enable] Whether or not auto upgrade is enabled for the cluster [auto-upgrade.maintenance-window.start-hour] The start hour of the 2-hour maintenance window [auto-upgrade.maintenance-window.day] The day of the week for the maintenance window (any | monday | tuesday | wednesday | thursday | friday | saturday | sunday) @@ -45,6 +44,7 @@ ARGS: DEPRECATED ARGS: [enable-dashboard] The new value of the Kubernetes Dashboard enablement + [ingress] The new Ingress Controller for the cluster (unknown_ingress | none | nginx | traefik | traefik2) FLAGS: -h, --help help for update diff --git a/cmd/scw/testdata/test-all-usage-rdb-read-replica-usage.golden b/cmd/scw/testdata/test-all-usage-rdb-read-replica-usage.golden new file mode 100644 index 0000000000..d8dc15345a --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-rdb-read-replica-usage.golden @@ -0,0 +1,15 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. + +USAGE: + scw rdb read-replica + +FLAGS: + -h, --help help for read-replica + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-rdb-usage.golden b/cmd/scw/testdata/test-all-usage-rdb-usage.golden index bbf10bae91..bae8df2453 100644 --- a/cmd/scw/testdata/test-all-usage-rdb-usage.golden +++ b/cmd/scw/testdata/test-all-usage-rdb-usage.golden @@ -6,16 +6,17 @@ USAGE: scw rdb AVAILABLE COMMANDS: - acl Access Control List (ACL) management commands - backup Backup management commands - database Database management commands - engine Database engines commands - instance Instance management commands - log Instance logs management commands - node-type Node types management commands - privilege User privileges management commands - snapshot Block snapshot management - user User management commands + acl Access Control List (ACL) management commands + backup Backup management commands + database Database management commands + engine Database engines commands + instance Instance management commands + log Instance logs management commands + node-type Node types management commands + privilege User privileges management commands + read-replica Read replica management + snapshot Block snapshot management + user User management commands FLAGS: -h, --help help for rdb diff --git a/docs/commands/k8s.md b/docs/commands/k8s.md index b6f1da931d..79c6de2be7 100644 --- a/docs/commands/k8s.md +++ b/docs/commands/k8s.md @@ -66,7 +66,7 @@ scw k8s cluster create [arg=value ...] | version | Required
Default: `latest` | The Kubernetes version of the cluster | | cni | Required
Default: `cilium`
One of: `unknown_cni`, `cilium`, `calico`, `weave`, `flannel`, `kilo` | The Container Network Interface (CNI) plugin that will run in the cluster | | ~~enable-dashboard~~ | Deprecated | The enablement of the Kubernetes Dashboard in the cluster | -| ingress | One of: `unknown_ingress`, `none`, `nginx`, `traefik`, `traefik2` | The Ingress Controller that will run in the cluster | +| ~~ingress~~ | Deprecated
One of: `unknown_ingress`, `none`, `nginx`, `traefik`, `traefik2` | The Ingress Controller that will run in the cluster | | pools.{index}.name | Required | The name of the pool | | pools.{index}.node-type | Required | The node type is the type of Scaleway Instance wanted for the pool | | pools.{index}.placement-group-id | | The placement group ID in which all the nodes of the pool will be created | @@ -320,7 +320,7 @@ scw k8s cluster update [arg=value ...] | autoscaler-config.scale-down-utilization-threshold | | Node utilization level, defined as sum of requested resources divided by capacity, below which a node can be considered for scale down | | autoscaler-config.max-graceful-termination-sec | | Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node | | ~~enable-dashboard~~ | Deprecated | The new value of the Kubernetes Dashboard enablement | -| ingress | One of: `unknown_ingress`, `none`, `nginx`, `traefik`, `traefik2` | The new Ingress Controller for the cluster | +| ~~ingress~~ | Deprecated
One of: `unknown_ingress`, `none`, `nginx`, `traefik`, `traefik2` | The new Ingress Controller for the cluster | | auto-upgrade.enable | | Whether or not auto upgrade is enabled for the cluster | | auto-upgrade.maintenance-window.start-hour | | The start hour of the 2-hour maintenance window | | auto-upgrade.maintenance-window.day | One of: `any`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday` | The day of the week for the maintenance window | diff --git a/docs/commands/rdb.md b/docs/commands/rdb.md index 17139518e8..5e799d9424 100644 --- a/docs/commands/rdb.md +++ b/docs/commands/rdb.md @@ -46,6 +46,7 @@ Database RDB API - [User privileges management commands](#user-privileges-management-commands) - [List privileges of a given user for a given database on a given instance](#list-privileges-of-a-given-user-for-a-given-database-on-a-given-instance) - [Set privileges of a given user for a given database on a given instance](#set-privileges-of-a-given-user-for-a-given-database-on-a-given-instance) +- [Read replica management](#read-replica-management) - [Block snapshot management](#block-snapshot-management) - [Create an instance snapshot](#create-an-instance-snapshot) - [Delete an instance snapshot](#delete-an-instance-snapshot) @@ -924,6 +925,22 @@ scw rdb privilege set [arg=value ...] +## Read replica management + +A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. + + +A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. + + +**Usage:** + +``` +scw rdb read-replica +``` + + + ## Block snapshot management Create, restore and manage block snapshot diff --git a/go.mod b/go.mod index a2e1afddf5..9f92f0c80d 100644 --- a/go.mod +++ b/go.mod @@ -31,12 +31,8 @@ require ( github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect github.com/chzyer/logex v1.2.0 // indirect github.com/chzyer/test v0.0.0-20210722231415-061457976a23 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/etdub/goparsetime v0.0.0-20160315173935-ea17b0ac3318 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/pkg/errors v0.8.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sergi/go-diff v1.2.0 // indirect golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/internal/namespaces/k8s/v1/k8s_cli.go b/internal/namespaces/k8s/v1/k8s_cli.go index 64de66da92..f8091a4d71 100644 --- a/internal/namespaces/k8s/v1/k8s_cli.go +++ b/internal/namespaces/k8s/v1/k8s_cli.go @@ -296,7 +296,7 @@ func k8sClusterCreate() *core.Command { Name: "ingress", Short: `The Ingress Controller that will run in the cluster`, Required: false, - Deprecated: false, + Deprecated: true, Positional: false, EnumValues: []string{"unknown_ingress", "none", "nginx", "traefik", "traefik2"}, }, @@ -743,7 +743,7 @@ func k8sClusterUpdate() *core.Command { Name: "ingress", Short: `The new Ingress Controller for the cluster`, Required: false, - Deprecated: false, + Deprecated: true, Positional: false, EnumValues: []string{"unknown_ingress", "none", "nginx", "traefik", "traefik2"}, }, diff --git a/internal/namespaces/rdb/v1/rdb_cli.go b/internal/namespaces/rdb/v1/rdb_cli.go index 9396cf2e11..a401699037 100644 --- a/internal/namespaces/rdb/v1/rdb_cli.go +++ b/internal/namespaces/rdb/v1/rdb_cli.go @@ -30,6 +30,7 @@ func GetGeneratedCommands() *core.Commands { rdbNodeType(), rdbLog(), rdbSnapshot(), + rdbReadReplica(), rdbEngineList(), rdbNodeTypeList(), rdbBackupList(), @@ -181,6 +182,16 @@ func rdbSnapshot() *core.Command { } } +func rdbReadReplica() *core.Command { + return &core.Command{ + Short: `Read replica management`, + Long: `A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. +`, + Namespace: "rdb", + Resource: "read-replica", + } +} + func rdbEngineList() *core.Command { return &core.Command{ Short: `List available database engines`, From a70bb40deca528099b90ca43d07b4daa72d72ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 30 Mar 2022 11:04:33 +0200 Subject: [PATCH 2/3] Fix --- ...st-all-usage-rdb-read-replica-usage.golden | 15 ------------- .../testdata/test-all-usage-rdb-usage.golden | 21 +++++++++---------- docs/commands/rdb.md | 17 --------------- internal/namespaces/rdb/v1/rdb_cli.go | 11 ---------- 4 files changed, 10 insertions(+), 54 deletions(-) delete mode 100644 cmd/scw/testdata/test-all-usage-rdb-read-replica-usage.golden diff --git a/cmd/scw/testdata/test-all-usage-rdb-read-replica-usage.golden b/cmd/scw/testdata/test-all-usage-rdb-read-replica-usage.golden deleted file mode 100644 index d8dc15345a..0000000000 --- a/cmd/scw/testdata/test-all-usage-rdb-read-replica-usage.golden +++ /dev/null @@ -1,15 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. - -USAGE: - scw rdb read-replica - -FLAGS: - -h, --help help for read-replica - -GLOBAL FLAGS: - -c, --config string The path to the config file - -D, --debug Enable debug mode - -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") - -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-rdb-usage.golden b/cmd/scw/testdata/test-all-usage-rdb-usage.golden index bae8df2453..bbf10bae91 100644 --- a/cmd/scw/testdata/test-all-usage-rdb-usage.golden +++ b/cmd/scw/testdata/test-all-usage-rdb-usage.golden @@ -6,17 +6,16 @@ USAGE: scw rdb AVAILABLE COMMANDS: - acl Access Control List (ACL) management commands - backup Backup management commands - database Database management commands - engine Database engines commands - instance Instance management commands - log Instance logs management commands - node-type Node types management commands - privilege User privileges management commands - read-replica Read replica management - snapshot Block snapshot management - user User management commands + acl Access Control List (ACL) management commands + backup Backup management commands + database Database management commands + engine Database engines commands + instance Instance management commands + log Instance logs management commands + node-type Node types management commands + privilege User privileges management commands + snapshot Block snapshot management + user User management commands FLAGS: -h, --help help for rdb diff --git a/docs/commands/rdb.md b/docs/commands/rdb.md index 5e799d9424..17139518e8 100644 --- a/docs/commands/rdb.md +++ b/docs/commands/rdb.md @@ -46,7 +46,6 @@ Database RDB API - [User privileges management commands](#user-privileges-management-commands) - [List privileges of a given user for a given database on a given instance](#list-privileges-of-a-given-user-for-a-given-database-on-a-given-instance) - [Set privileges of a given user for a given database on a given instance](#set-privileges-of-a-given-user-for-a-given-database-on-a-given-instance) -- [Read replica management](#read-replica-management) - [Block snapshot management](#block-snapshot-management) - [Create an instance snapshot](#create-an-instance-snapshot) - [Delete an instance snapshot](#delete-an-instance-snapshot) @@ -925,22 +924,6 @@ scw rdb privilege set [arg=value ...] -## Read replica management - -A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. - - -A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. - - -**Usage:** - -``` -scw rdb read-replica -``` - - - ## Block snapshot management Create, restore and manage block snapshot diff --git a/internal/namespaces/rdb/v1/rdb_cli.go b/internal/namespaces/rdb/v1/rdb_cli.go index a401699037..9396cf2e11 100644 --- a/internal/namespaces/rdb/v1/rdb_cli.go +++ b/internal/namespaces/rdb/v1/rdb_cli.go @@ -30,7 +30,6 @@ func GetGeneratedCommands() *core.Commands { rdbNodeType(), rdbLog(), rdbSnapshot(), - rdbReadReplica(), rdbEngineList(), rdbNodeTypeList(), rdbBackupList(), @@ -182,16 +181,6 @@ func rdbSnapshot() *core.Command { } } -func rdbReadReplica() *core.Command { - return &core.Command{ - Short: `Read replica management`, - Long: `A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. -`, - Namespace: "rdb", - Resource: "read-replica", - } -} - func rdbEngineList() *core.Command { return &core.Command{ Short: `List available database engines`, From 368a41e091951a7bb467bc5a86829fb97f2bb9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 30 Mar 2022 11:05:34 +0200 Subject: [PATCH 3/3] Fix --- go.mod | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go.mod b/go.mod index 9f92f0c80d..a2e1afddf5 100644 --- a/go.mod +++ b/go.mod @@ -31,8 +31,12 @@ require ( github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect github.com/chzyer/logex v1.2.0 // indirect github.com/chzyer/test v0.0.0-20210722231415-061457976a23 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/etdub/goparsetime v0.0.0-20160315173935-ea17b0ac3318 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/pkg/errors v0.8.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sergi/go-diff v1.2.0 // indirect golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect )