Update cli imports to using local package

Also, rename a bunch of variable to not *shadow* the `opts` package
name.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester
2017-05-15 14:45:19 +02:00
parent 560dc7660f
commit d7f6563efc
48 changed files with 471 additions and 481 deletions

View File

@ -5,8 +5,8 @@ import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/opts"
"github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/opts"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/pkg/errors"
"github.com/spf13/cobra"
@ -19,7 +19,7 @@ var (
)
func newUpdateCommand(dockerCli command.Cli) *cobra.Command {
nodeOpts := newNodeOptions()
options := newNodeOptions()
cmd := &cobra.Command{
Use: "update [OPTIONS] NODE",
@ -31,9 +31,9 @@ func newUpdateCommand(dockerCli command.Cli) *cobra.Command {
}
flags := cmd.Flags()
flags.StringVar(&nodeOpts.role, flagRole, "", `Role of the node ("worker"|"manager")`)
flags.StringVar(&nodeOpts.availability, flagAvailability, "", `Availability of the node ("active"|"pause"|"drain")`)
flags.Var(&nodeOpts.annotations.labels, flagLabelAdd, "Add or update a node label (key=value)")
flags.StringVar(&options.role, flagRole, "", `Role of the node ("worker"|"manager")`)
flags.StringVar(&options.availability, flagAvailability, "", `Availability of the node ("active"|"pause"|"drain")`)
flags.Var(&options.annotations.labels, flagLabelAdd, "Add or update a node label (key=value)")
labelKeys := opts.NewListOpts(nil)
flags.Var(&labelKeys, flagLabelRemove, "Remove a node label if exists")
return cmd