Scope orchestration selection to stack commands only
* Renaming DOCKER_ORCHESTRATOR to DOCKER_STACK_ORCHESTRATOR * Renaming config file option "orchestrator" to "stackOrchestrator" * "--orchestrator" flag is no more global but local to stack command and subcommands * Cleaning all global orchestrator code * Replicating Hidden flags in help and Supported flags from root command to stack command Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
8de0753869
commit
71272dd203
@ -10,7 +10,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func newPsCommand(dockerCli command.Cli) *cobra.Command {
|
||||
func newPsCommand(dockerCli command.Cli, common *commonOptions) *cobra.Command {
|
||||
opts := options.PS{Filter: cliopts.NewFilterOpt()}
|
||||
|
||||
cmd := &cobra.Command{
|
||||
@ -20,10 +20,10 @@ func newPsCommand(dockerCli command.Cli) *cobra.Command {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
opts.Namespace = args[0]
|
||||
switch {
|
||||
case dockerCli.ClientInfo().HasAll():
|
||||
case common.orchestrator.HasAll():
|
||||
return errUnsupportedAllOrchestrator
|
||||
case dockerCli.ClientInfo().HasKubernetes():
|
||||
kli, err := kubernetes.WrapCli(dockerCli, kubernetes.NewOptions(cmd.Flags()))
|
||||
case common.orchestrator.HasKubernetes():
|
||||
kli, err := kubernetes.WrapCli(dockerCli, kubernetes.NewOptions(cmd.Flags(), common.orchestrator))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user