Skip to content

Commit

Permalink
Remove experimental "deploy" from "dab" files
Browse files Browse the repository at this point in the history
The top-level `docker deploy` command (using the "Docker Application Bundle"
(`.dab`) file format was introduced as an experimental feature in Docker 1.13 /
17.03, but superseded by support for Docker Compose files.

With no development being done on this feature, and no active use of the file
format, support for the DAB file format and the top-level `docker deploy` command
(hidden by default in 19.03), is removed in this patch, in favour of `docker stack deploy`
using compose files.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Dec 6, 2019
1 parent 8547dfc commit 9205e95
Show file tree
Hide file tree
Showing 17 changed files with 4 additions and 749 deletions.
70 changes: 0 additions & 70 deletions cli/command/bundlefile/bundlefile.go

This file was deleted.

78 changes: 0 additions & 78 deletions cli/command/bundlefile/bundlefile_test.go

This file was deleted.

1 change: 0 additions & 1 deletion cli/command/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
context.NewContextCommand(dockerCli),

// legacy commands may be hidden
hide(stack.NewTopLevelDeployCommand(dockerCli)),
hide(system.NewEventsCommand(dockerCli)),
hide(system.NewInfoCommand(dockerCli)),
hide(system.NewInspectCommand(dockerCli)),
Expand Down
12 changes: 0 additions & 12 deletions cli/command/stack/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,6 @@ func NewStackCommand(dockerCli command.Cli) *cobra.Command {
return cmd
}

// NewTopLevelDeployCommand returns a command for `docker deploy`
func NewTopLevelDeployCommand(dockerCli command.Cli) *cobra.Command {
cmd := newDeployCommand(dockerCli, nil)
// Remove the aliases at the top level
cmd.Aliases = []string{}
cmd.Annotations = map[string]string{
"experimental": "",
"version": "1.25",
}
return cmd
}

func getOrchestrator(dockerCli command.Cli, cmd *cobra.Command) (command.Orchestrator, error) {
var orchestratorFlag string
if o, err := cmd.Flags().GetString("orchestrator"); err == nil {
Expand Down
24 changes: 0 additions & 24 deletions cli/command/stack/deploy.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package stack

import (
"context"

"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/stack/kubernetes"
"github.com/docker/cli/cli/command/stack/loader"
"github.com/docker/cli/cli/command/stack/options"
"github.com/docker/cli/cli/command/stack/swarm"
composetypes "github.com/docker/cli/cli/compose/types"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
Expand All @@ -28,24 +25,6 @@ func newDeployCommand(dockerCli command.Cli, common *commonOptions) *cobra.Comma
if err := validateStackName(opts.Namespace); err != nil {
return err
}

commonOrchestrator := command.OrchestratorSwarm // default for top-level deploy command
if common != nil {
commonOrchestrator = common.orchestrator
}

switch {
case opts.Bundlefile == "" && len(opts.Composefiles) == 0:
return errors.Errorf("Please specify either a bundle file (with --bundle-file) or a Compose file (with --compose-file).")
case opts.Bundlefile != "" && len(opts.Composefiles) != 0:
return errors.Errorf("You cannot specify both a bundle file and a Compose file.")
case opts.Bundlefile != "":
if commonOrchestrator != command.OrchestratorSwarm {
return errors.Errorf("bundle files are not supported on another orchestrator than swarm.")
}
return swarm.DeployBundle(context.Background(), dockerCli, opts)
}

config, err := loader.LoadComposefile(dockerCli, opts)
if err != nil {
return err
Expand All @@ -55,9 +34,6 @@ func newDeployCommand(dockerCli command.Cli, common *commonOptions) *cobra.Comma
}

flags := cmd.Flags()
flags.StringVar(&opts.Bundlefile, "bundle-file", "", "Path to a Distributed Application Bundle file")
flags.SetAnnotation("bundle-file", "experimental", nil)
flags.SetAnnotation("bundle-file", "swarm", nil)
flags.StringSliceVarP(&opts.Composefiles, "compose-file", "c", []string{}, `Path to a Compose file, or "-" to read from stdin`)
flags.SetAnnotation("compose-file", "version", []string{"1.25"})
flags.BoolVar(&opts.SendRegistryAuth, "with-registry-auth", false, "Send registry authentication details to Swarm agents")
Expand Down
2 changes: 1 addition & 1 deletion cli/command/stack/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func getConfigDetails(composefiles []string, stdin io.Reader) (composetypes.Conf
var details composetypes.ConfigDetails

if len(composefiles) == 0 {
return details, errors.New("no composefile(s)")
return details, errors.New("Please specify a Compose file (with --compose-file)")
}

if composefiles[0] == "-" && len(composefiles) == 1 {
Expand Down
1 change: 0 additions & 1 deletion cli/command/stack/options/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import "github.com/docker/cli/opts"

// Deploy holds docker stack deploy options
type Deploy struct {
Bundlefile string
Composefiles []string
Namespace string
ResolveImage string
Expand Down
124 changes: 0 additions & 124 deletions cli/command/stack/swarm/deploy_bundlefile.go

This file was deleted.

Loading

0 comments on commit 9205e95

Please # to comment.