Skip to content

Commit 9ea9567

Browse files
authored
feat(k8s): list cluster types (#3180)
1 parent 6a0f50e commit 9ea9567

File tree

6 files changed

+56
-8
lines changed

6 files changed

+56
-8
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
All cluster types available in a specified region
4+
A cluster type represents the different commercial types of clusters offered by Scaleway.
5+
6+
USAGE:
7+
scw k8s cluster-type
8+
9+
FLAGS:
10+
-h, --help help for cluster-type
11+
12+
GLOBAL FLAGS:
13+
-c, --config string The path to the config file
14+
-D, --debug Enable debug mode
15+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
16+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-k8s-usage.golden

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ USAGE:
66
scw k8s <command>
77

88
AVAILABLE COMMANDS:
9-
cluster Kapsule cluster management commands
10-
kubeconfig Manage your Kubernetes Kapsule cluster's kubeconfig files
11-
node Kapsule node management commands
12-
pool Kapsule pool management commands
13-
version Available Kubernetes versions commands
9+
cluster Kapsule cluster management commands
10+
cluster-type Cluster type management commands
11+
kubeconfig Manage your Kubernetes Kapsule cluster's kubeconfig files
12+
node Kapsule node management commands
13+
pool Kapsule pool management commands
14+
version Available Kubernetes versions commands
1415

1516
FLAGS:
1617
-h, --help help for k8s

docs/commands/k8s.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Kubernetes API.
1414
- [Update a Cluster](#update-a-cluster)
1515
- [Upgrade a Cluster](#upgrade-a-cluster)
1616
- [Wait for a cluster to reach a stable state](#wait-for-a-cluster-to-reach-a-stable-state)
17+
- [Cluster type management commands](#cluster-type-management-commands)
1718
- [Manage your Kubernetes Kapsule cluster's kubeconfig files](#manage-your-kubernetes-kapsule-cluster's-kubeconfig-files)
1819
- [Retrieve a kubeconfig](#retrieve-a-kubeconfig)
1920
- [Install a kubeconfig](#install-a-kubeconfig)
@@ -494,6 +495,24 @@ scw k8s cluster wait 11111111-1111-1111-1111-111111111111
494495

495496

496497

498+
## Cluster type management commands
499+
500+
All cluster types available in a specified region
501+
A cluster type represents the different commercial types of clusters offered by Scaleway.
502+
503+
504+
All cluster types available in a specified region
505+
A cluster type represents the different commercial types of clusters offered by Scaleway.
506+
507+
508+
**Usage:**
509+
510+
```
511+
scw k8s cluster-type
512+
```
513+
514+
515+
497516
## Manage your Kubernetes Kapsule cluster's kubeconfig files
498517

499518

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/moby/buildkit v0.11.6
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/pkg/errors v0.9.1
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230605161902-063dd98719c5
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230607131757-da39ca1baa1d
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.7.0
3030
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
499499
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
500500
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
501501
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
502-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230605161902-063dd98719c5 h1:cvEzMB3pnmV7nz/UL8otnJkuQ6HZ9JtkB03REanoWPE=
503-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230605161902-063dd98719c5/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
502+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230607131757-da39ca1baa1d h1:EbuHNXcO1NY4igtlTajsP00QpMfe7Bk0O3mYt9OED68=
503+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230607131757-da39ca1baa1d/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
504504
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
505505
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
506506
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/k8s/v1/k8s_cli.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func GetGeneratedCommands() *core.Commands {
2424
k8sPool(),
2525
k8sNode(),
2626
k8sVersion(),
27+
k8sClusterType(),
2728
k8sClusterList(),
2829
k8sClusterCreate(),
2930
k8sClusterGet(),
@@ -101,6 +102,17 @@ It comprises a major version ` + "`" + `x` + "`" + `, a minor version ` + "`" +
101102
}
102103
}
103104

105+
func k8sClusterType() *core.Command {
106+
return &core.Command{
107+
Short: `Cluster type management commands`,
108+
Long: `All cluster types available in a specified region
109+
A cluster type represents the different commercial types of clusters offered by Scaleway.
110+
`,
111+
Namespace: "k8s",
112+
Resource: "cluster-type",
113+
}
114+
}
115+
104116
func k8sClusterList() *core.Command {
105117
return &core.Command{
106118
Short: `List Clusters`,

0 commit comments

Comments
 (0)