This repository was archived by the owner on Jul 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ func NewRootCmd(use string, dockerCli command.Cli) *cobra.Command {
48
48
}
49
49
50
50
func addCommands (cmd * cobra.Command , dockerCli command.Cli ) {
51
- cmd . AddCommand (
51
+ listOfCommands := [] * cobra. Command {
52
52
runCmd (dockerCli ),
53
53
updateCmd (dockerCli ),
54
54
removeCmd (dockerCli ),
@@ -59,8 +59,19 @@ func addCommands(cmd *cobra.Command, dockerCli command.Cli) {
59
59
pullCmd (dockerCli ),
60
60
image .Cmd (dockerCli ),
61
61
build .Cmd (dockerCli ),
62
- inspectCmd (dockerCli ),
63
- )
62
+ }
63
+
64
+ isExperimentalMode := dockerCli .ClientInfo ().HasExperimental
65
+ for _ , ccmd := range listOfCommands {
66
+ switch ccmd .Annotations ["experimental" ] {
67
+ case "true" :
68
+ if isExperimentalMode {
69
+ cmd .AddCommand (ccmd )
70
+ }
71
+ default :
72
+ cmd .AddCommand (ccmd )
73
+ }
74
+ }
64
75
}
65
76
66
77
func firstOrEmpty (list []string ) string {
Original file line number Diff line number Diff line change @@ -22,10 +22,11 @@ type validateOptions struct {
22
22
func validateCmd () * cobra.Command {
23
23
var opts validateOptions
24
24
cmd := & cobra.Command {
25
- Use : "validate [OPTIONS] APP_DEFINITION" ,
26
- Short : "Check that an App definition (.dockerapp) is syntactically correct" ,
27
- Example : `$ docker app validate myapp.dockerapp --set key=value --parameters-file myparam.yml` ,
28
- Args : cli .RequiresMaxArgs (1 ),
25
+ Use : "validate [OPTIONS] APP_DEFINITION" ,
26
+ Short : "Check that an App definition (.dockerapp) is syntactically correct" ,
27
+ Example : `$ docker app validate myapp.dockerapp --set key=value --parameters-file myparam.yml` ,
28
+ Args : cli .RequiresMaxArgs (1 ),
29
+ Annotations : map [string ]string {"experimental" : "true" },
29
30
RunE : func (cmd * cobra.Command , args []string ) error {
30
31
return runValidate (args , opts )
31
32
},
You can’t perform that action at this time.
0 commit comments