diff --git a/command/checkpoint/cmd.go b/command/checkpoint/cmd.go index 84084ab716..7f9e537779 100644 --- a/command/checkpoint/cmd.go +++ b/command/checkpoint/cmd.go @@ -17,6 +17,7 @@ func NewCheckpointCommand(dockerCli *command.DockerCli) *cobra.Command { Run: func(cmd *cobra.Command, args []string) { fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString()) }, + Tags: map[string]string{"experimental": ""}, } cmd.AddCommand( newCreateCommand(dockerCli), diff --git a/command/cli.go b/command/cli.go index 9b61492442..33a26c4c64 100644 --- a/command/cli.go +++ b/command/cli.go @@ -32,27 +32,21 @@ type Streams interface { // DockerCli represents the docker command line client. // Instances of the client can be returned from NewDockerCli. type DockerCli struct { - configFile *configfile.ConfigFile - in *InStream - out *OutStream - err io.Writer - keyFile string - client client.APIClient - hasExperimental *bool + configFile *configfile.ConfigFile + in *InStream + out *OutStream + err io.Writer + keyFile string + client client.APIClient } // HasExperimental returns true if experimental features are accessible func (cli *DockerCli) HasExperimental() bool { - if cli.hasExperimental == nil { - if cli.client == nil { - return false - } - enabled := false - cli.hasExperimental = &enabled - enabled, _ = cli.client.Ping(context.Background()) + if cli.client == nil { + return false } - - return *cli.hasExperimental + enabled, _ := cli.client.Ping(context.Background()) + return enabled } // Client returns the APIClient diff --git a/command/container/start.go b/command/container/start.go index e544028932..87e815fed5 100644 --- a/command/container/start.go +++ b/command/container/start.go @@ -46,8 +46,8 @@ func NewStartCommand(dockerCli *command.DockerCli) *cobra.Command { flags.StringVar(&opts.detachKeys, "detach-keys", "", "Override the key sequence for detaching a container") flags.StringVar(&opts.checkpoint, "checkpoint", "", "Restore from this checkpoint") - flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory") flags.SetAnnotation("checkpoint", "experimental", nil) + flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory") flags.SetAnnotation("checkpoint-dir", "experimental", nil) return cmd } diff --git a/command/plugin/cmd.go b/command/plugin/cmd.go index 80fa61cb1c..c78f43a8d4 100644 --- a/command/plugin/cmd.go +++ b/command/plugin/cmd.go @@ -17,6 +17,7 @@ func NewPluginCommand(dockerCli *command.DockerCli) *cobra.Command { Run: func(cmd *cobra.Command, args []string) { fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString()) }, + Tags: map[string]string{"experimental": ""}, } cmd.AddCommand( diff --git a/command/stack/cmd.go b/command/stack/cmd.go index 49fcedf209..70afec9c6d 100644 --- a/command/stack/cmd.go +++ b/command/stack/cmd.go @@ -17,6 +17,7 @@ func NewStackCommand(dockerCli *command.DockerCli) *cobra.Command { Run: func(cmd *cobra.Command, args []string) { fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString()) }, + Tags: map[string]string{"experimental": ""}, } cmd.AddCommand( newConfigCommand(dockerCli), diff --git a/command/stack/deploy.go b/command/stack/deploy.go index fcf55fb7d2..b0f6b455a8 100644 --- a/command/stack/deploy.go +++ b/command/stack/deploy.go @@ -36,6 +36,7 @@ func newDeployCommand(dockerCli *command.DockerCli) *cobra.Command { opts.namespace = strings.TrimSuffix(args[0], ".dab") return runDeploy(dockerCli, opts) }, + Tags: map[string]string{"experimental": ""}, } flags := cmd.Flags()