Skip to content

Commit 9a933af

Browse files
committed
fix: CLI from expecting secret name when listing secrets
CLI expects secret name when trying to list all secrets in a namespace
1 parent 45159e7 commit 9a933af

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/vclusterctl/cmd/platform/get/secret.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,19 @@ vcluster platform get secret test-secret.key
5454
vcluster platform get secret test-secret.key --project myproject
5555
########################################################
5656
`)
57+
5758
useLine, validator := util.NamedPositionalArgsValidator(true, true, "SECRET_NAME")
5859
c := &cobra.Command{
5960
Use: "secret" + useLine,
6061
Short: "Returns the key value of a project / shared secret",
6162
Long: description,
62-
Args: validator,
63+
Args: func(cmd *cobra.Command, args []string) error {
64+
// bypass validation if the "all" flag is set
65+
if cmd.Flag("all").Value.String() == "false" {
66+
return validator(cmd, args)
67+
}
68+
return nil
69+
},
6370
RunE: func(cobraCmd *cobra.Command, args []string) error {
6471
return cmd.Run(cobraCmd.Context(), args)
6572
},

0 commit comments

Comments
 (0)