diff --git a/README.md b/README.md index 6a1ade2..fa88cfc 100644 --- a/README.md +++ b/README.md @@ -331,8 +331,12 @@ $ biko gcp [product] [flag(s)] | Product | What | Command | Flags(Optional) | |:----:|:----:|:----:|:----:| -| Container Registry | Go to container registry or the container detail | `gcr` | `--name, -n` | -| Secret Manager | Go to secret manager's detail | `secretmanager`, `sm` | `--secret, -s`, `--version`, `-v` | +| Container Registry | Go to container registry or the container detail | `gcr` | `--name, -n` | + + +**Security** + +| Secret Manager | Go to secret manager's detail | `secret-manager`, `sm`, `secretmanager`, `secretManager` | `--secret, -s` | **Big Data** diff --git a/cli/gcp.go b/cli/gcp.go index f436c6f..18302d2 100644 --- a/cli/gcp.go +++ b/cli/gcp.go @@ -187,7 +187,8 @@ func newGCPSpannerCmd() cli.Command { func newGCPSecretManagerCmd() cli.Command { return cli.Command{ - Name: "secretManager", + Name: "secret-manager", + Aliases: []string{"sm", "secretmanager", "secretManager"}, Usage: "Open Secret Manager page", Category: categoryStorage, Flags: []cli.Flag{ @@ -199,10 +200,6 @@ func newGCPSecretManagerCmd() cli.Command { Name: "secret, s", Usage: "Secret name", }, - cli.StringFlag{ - Name: "version, v", - Usage: "Secret version", - }, }, Action: func(c *cli.Context) error { gcp, err := gcp.GetProvider() diff --git a/providers/gcp/gcp.go b/providers/gcp/gcp.go index 754bfbd..18991f9 100644 --- a/providers/gcp/gcp.go +++ b/providers/gcp/gcp.go @@ -158,6 +158,12 @@ func (p *Provider) addProductPath(product string) { p.join("workload") p.addGKEPageStateParam(namespaces) } + case "secret-manager": + p.join(fmt.Sprintf("security/%s", product)) + var secret string + if secret = p.GetCtxString("secret"); secret != "" { + p.join(fmt.Sprintf("secret/%s", secret)) + } case "spanner": p.join(product) var instance, db, scheme string