Skip to content

Commit

Permalink
Add GCP secret manager
Browse files Browse the repository at this point in the history
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
  • Loading branch information
KeisukeYamashita committed Jun 28, 2021
1 parent 9a44049 commit 8245494
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
7 changes: 2 additions & 5 deletions cli/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions providers/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8245494

Please sign in to comment.