Move api/client -> cli/command
Using
gomvpkg
-from github.com/docker/docker/api/client
-to github.com/docker/docker/cli/command
-vcs_mv_cmd 'git mv {{.Src}} {{.Dst}}'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
41
command/stack/config.go
Normal file
41
command/stack/config.go
Normal file
@ -0,0 +1,41 @@
|
||||
// +build experimental
|
||||
|
||||
package stack
|
||||
|
||||
import (
|
||||
"github.com/docker/docker/api/client"
|
||||
"github.com/docker/docker/api/client/bundlefile"
|
||||
"github.com/docker/docker/cli"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
type configOptions struct {
|
||||
bundlefile string
|
||||
namespace string
|
||||
}
|
||||
|
||||
func newConfigCommand(dockerCli *client.DockerCli) *cobra.Command {
|
||||
var opts configOptions
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "config [OPTIONS] STACK",
|
||||
Short: "Print the stack configuration",
|
||||
Args: cli.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
opts.namespace = args[0]
|
||||
return runConfig(dockerCli, opts)
|
||||
},
|
||||
}
|
||||
|
||||
flags := cmd.Flags()
|
||||
addBundlefileFlag(&opts.bundlefile, flags)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func runConfig(dockerCli *client.DockerCli, opts configOptions) error {
|
||||
bundle, err := loadBundlefile(dockerCli.Err(), opts.namespace, opts.bundlefile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return bundlefile.Print(dockerCli.Out(), bundle)
|
||||
}
|
||||
Reference in New Issue
Block a user