Hide "builder" and "network" commands on old API versions
- The `/build/prune` endpoint was added in API v1.31 - The `/network` endpoints were added in API v1.21 This patch hides these commands on older API versions Before this change: ``` DOCKER_API_VERSION=1.0 docker ... Management Commands: builder Manage builds container Manage containers image Manage images manifest Manage Docker image manifests and manifest lists network Manage networks system Manage Docker trust Manage trust on Docker images ``` After this change ``` DOCKER_API_VERSION=1.0 docker ... Management Commands: container Manage containers image Manage images manifest Manage Docker image manifests and manifest lists system Manage Docker trust Manage trust on Docker images ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a17f67e456
commit
99fb2c1baa
@ -10,10 +10,11 @@ import (
|
|||||||
// NewBuilderCommand returns a cobra command for `builder` subcommands
|
// NewBuilderCommand returns a cobra command for `builder` subcommands
|
||||||
func NewBuilderCommand(dockerCli command.Cli) *cobra.Command {
|
func NewBuilderCommand(dockerCli command.Cli) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "builder",
|
Use: "builder",
|
||||||
Short: "Manage builds",
|
Short: "Manage builds",
|
||||||
Args: cli.NoArgs,
|
Args: cli.NoArgs,
|
||||||
RunE: command.ShowHelp(dockerCli.Err()),
|
RunE: command.ShowHelp(dockerCli.Err()),
|
||||||
|
Annotations: map[string]string{"version": "1.31"},
|
||||||
}
|
}
|
||||||
cmd.AddCommand(
|
cmd.AddCommand(
|
||||||
NewPruneCommand(dockerCli),
|
NewPruneCommand(dockerCli),
|
||||||
|
@ -10,10 +10,11 @@ import (
|
|||||||
// NewNetworkCommand returns a cobra command for `network` subcommands
|
// NewNetworkCommand returns a cobra command for `network` subcommands
|
||||||
func NewNetworkCommand(dockerCli command.Cli) *cobra.Command {
|
func NewNetworkCommand(dockerCli command.Cli) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "network",
|
Use: "network",
|
||||||
Short: "Manage networks",
|
Short: "Manage networks",
|
||||||
Args: cli.NoArgs,
|
Args: cli.NoArgs,
|
||||||
RunE: command.ShowHelp(dockerCli.Err()),
|
RunE: command.ShowHelp(dockerCli.Err()),
|
||||||
|
Annotations: map[string]string{"version": "1.21"},
|
||||||
}
|
}
|
||||||
cmd.AddCommand(
|
cmd.AddCommand(
|
||||||
newConnectCommand(dockerCli),
|
newConnectCommand(dockerCli),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user