File tree 1 file changed +8
-1
lines changed
cmd/vclusterctl/cmd/platform/get
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,19 @@ vcluster platform get secret test-secret.key
54
54
vcluster platform get secret test-secret.key --project myproject
55
55
########################################################
56
56
` )
57
+
57
58
useLine , validator := util .NamedPositionalArgsValidator (true , true , "SECRET_NAME" )
58
59
c := & cobra.Command {
59
60
Use : "secret" + useLine ,
60
61
Short : "Returns the key value of a project / shared secret" ,
61
62
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
+ },
63
70
RunE : func (cobraCmd * cobra.Command , args []string ) error {
64
71
return cmd .Run (cobraCmd .Context (), args )
65
72
},
You can’t perform that action at this time.
0 commit comments