File tree 1 file changed +12
-1
lines changed
cmd/vclusterctl/cmd/platform/get
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,23 @@ 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
+ all , err := cmd .Flags ().GetBool ("all" )
66
+ if err != nil {
67
+ return err
68
+ }
69
+ if ! all {
70
+ return validator (cmd , args )
71
+ }
72
+ return nil
73
+ },
63
74
RunE : func (cobraCmd * cobra.Command , args []string ) error {
64
75
return cmd .Run (cobraCmd .Context (), args )
65
76
},
You can’t perform that action at this time.
0 commit comments