Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2749843368 | ||
|
|
c31d0ea160 | ||
|
|
3c6ad54e95 | ||
|
|
b3f1fb5418 | ||
|
|
37890ac58d | ||
|
|
df806ee61c | ||
|
|
ee7705035c | ||
|
|
46d424b49b | ||
|
|
c2fa77357a | ||
|
|
3dbd9eaf78 | ||
|
|
35d05c2de6 | ||
|
|
911e86cb9f | ||
|
|
050f334818 | ||
|
|
2c9ca7465d | ||
|
|
11720451eb | ||
|
|
65a42c8236 | ||
|
|
ddad2f519a | ||
|
|
4e6dbe6a5c |
+2
-2
@@ -1,8 +1,8 @@
|
||||
# GitHub code owners
|
||||
# See https://github.com/blog/2392-introducing-code-owners
|
||||
|
||||
cli/command/stack/** @vdemeester
|
||||
cli/command/stack/** @vdemeester @silvin-lubecki
|
||||
cli/compose/** @vdemeester
|
||||
contrib/completion/bash/** @albers
|
||||
contrib/completion/zsh/** @sdurrheimer
|
||||
docs/** @mistyhacks @vdemeester @thaJeztah
|
||||
docs/** @vdemeester @thaJeztah
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
# TODO Describe the docs maintainers role.
|
||||
|
||||
people = [
|
||||
"misty",
|
||||
"thajeztah"
|
||||
]
|
||||
|
||||
@@ -95,11 +94,6 @@
|
||||
Email = "justin.cormack@docker.com"
|
||||
GitHub = "justincormack"
|
||||
|
||||
[people.misty]
|
||||
Name = "Misty Stanley-Jones"
|
||||
Email = "misty@docker.com"
|
||||
GitHub = "mistyhacks"
|
||||
|
||||
[people.programmerq]
|
||||
Name = "Jeff Anderson"
|
||||
Email = "jeff@docker.com"
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/docker/cli/cli"
|
||||
"github.com/docker/cli/cli/command"
|
||||
cliconfig "github.com/docker/cli/cli/config"
|
||||
"github.com/docker/cli/cli/config/configfile"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
@@ -27,7 +28,11 @@ func NewStackCommand(dockerCli command.Cli) *cobra.Command {
|
||||
Short: "Manage Docker stacks",
|
||||
Args: cli.NoArgs,
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
orchestrator, err := getOrchestrator(dockerCli.ConfigFile(), cmd, dockerCli.Err())
|
||||
configFile := dockerCli.ConfigFile()
|
||||
if configFile == nil {
|
||||
configFile = cliconfig.LoadDefaultConfigFile(dockerCli.Err())
|
||||
}
|
||||
orchestrator, err := getOrchestrator(configFile, cmd, dockerCli.Err())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -42,9 +47,13 @@ func NewStackCommand(dockerCli command.Cli) *cobra.Command {
|
||||
},
|
||||
}
|
||||
defaultHelpFunc := cmd.HelpFunc()
|
||||
cmd.SetHelpFunc(func(cmd *cobra.Command, args []string) {
|
||||
hideOrchestrationFlags(cmd, opts.orchestrator)
|
||||
defaultHelpFunc(cmd, args)
|
||||
cmd.SetHelpFunc(func(c *cobra.Command, args []string) {
|
||||
if err := cmd.PersistentPreRunE(c, args); err != nil {
|
||||
fmt.Fprintln(dockerCli.Err(), err)
|
||||
return
|
||||
}
|
||||
hideOrchestrationFlags(c, opts.orchestrator)
|
||||
defaultHelpFunc(c, args)
|
||||
})
|
||||
cmd.AddCommand(
|
||||
newDeployCommand(dockerCli, &opts),
|
||||
|
||||
@@ -58,7 +58,7 @@ func newDeployCommand(dockerCli command.Cli, common *commonOptions) *cobra.Comma
|
||||
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")
|
||||
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")
|
||||
flags.SetAnnotation("with-registry-auth", "swarm", nil)
|
||||
|
||||
@@ -96,12 +96,12 @@ func Load(configDir string) (*configfile.ConfigFile, error) {
|
||||
}
|
||||
file, err := os.Open(confFile)
|
||||
if err != nil {
|
||||
return configFile, errors.Wrap(err, confFile)
|
||||
return configFile, errors.Wrap(err, filename)
|
||||
}
|
||||
defer file.Close()
|
||||
err = configFile.LegacyLoadFromReader(file)
|
||||
if err != nil {
|
||||
return configFile, errors.Wrap(err, confFile)
|
||||
return configFile, errors.Wrap(err, filename)
|
||||
}
|
||||
return configFile, nil
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Tianon Gravi <admwiggin@gmail.com> (@tianon)
|
||||
Jessie Frazelle <jess@docker.com> (@jfrazelle)
|
||||
+101
-32
@@ -288,10 +288,9 @@ __docker_complete_networks() {
|
||||
COMPREPLY=( $(compgen -W "$(__docker_networks "$@")" -- "$current") )
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2128,SC2178
|
||||
__docker_complete_containers_in_network() {
|
||||
local containers=$(__docker_q network inspect -f '{{range $i, $c := .Containers}}{{$i}} {{$c.Name}} {{end}}' "$1")
|
||||
COMPREPLY=( $(compgen -W "$containers" -- "$cur") )
|
||||
local containers=($(__docker_q network inspect -f '{{range $i, $c := .Containers}}{{$i}} {{$c.Name}} {{end}}' "$1"))
|
||||
COMPREPLY=( $(compgen -W "${containers[*]}" -- "$cur") )
|
||||
}
|
||||
|
||||
# __docker_volumes returns a list of all volumes. Additional options to
|
||||
@@ -347,8 +346,7 @@ __docker_plugins_bundled() {
|
||||
for del in "${remove[@]}" ; do
|
||||
plugins=(${plugins[@]/$del/})
|
||||
done
|
||||
# shellcheck disable=SC2145
|
||||
echo "${plugins[@]} ${add[@]}"
|
||||
echo "${plugins[@]}" "${add[@]}"
|
||||
}
|
||||
|
||||
# __docker_complete_plugins_bundled applies completion of plugins based on the current
|
||||
@@ -584,6 +582,31 @@ __docker_daemon_os_is() {
|
||||
[ "$actual_os" = "$expected_os" ]
|
||||
}
|
||||
|
||||
# __docker_stack_orchestrator_is tests whether the client is configured to use
|
||||
# the orchestrator that is passed in as the first argument.
|
||||
__docker_stack_orchestrator_is() {
|
||||
case "$1" in
|
||||
kubernetes)
|
||||
if [ -z "$stack_orchestrator_is_kubernetes" ] ; then
|
||||
__docker_q stack ls --help | grep -qe --namespace
|
||||
stack_orchestrator_is_kubernetes=$?
|
||||
fi
|
||||
return $stack_orchestrator_is_kubernetes
|
||||
;;
|
||||
swarm)
|
||||
if [ -z "$stack_orchestrator_is_swarm" ] ; then
|
||||
__docker_q stack deploy --help | grep -qe "with-registry-auth"
|
||||
stack_orchestrator_is_swarm=$?
|
||||
fi
|
||||
return $stack_orchestrator_is_swarm
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
|
||||
esac
|
||||
}
|
||||
|
||||
# __docker_pos_first_nonflag finds the position of the first word that is neither
|
||||
# option nor an option's argument. If there are options that require arguments,
|
||||
# you should pass a glob describing those options, e.g. "--option1|-o|--option2"
|
||||
@@ -1050,6 +1073,23 @@ __docker_complete_signals() {
|
||||
COMPREPLY=( $( compgen -W "${signals[*]} ${signals[*]#SIG}" -- "$( echo "$cur" | tr '[:lower:]' '[:upper:]')" ) )
|
||||
}
|
||||
|
||||
__docker_complete_stack_orchestrator_options() {
|
||||
case "$prev" in
|
||||
--kubeconfig)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--namespace)
|
||||
return 0
|
||||
;;
|
||||
--orchestrator)
|
||||
COMPREPLY=( $( compgen -W "all kubernetes swarm" -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
__docker_complete_user_group() {
|
||||
if [[ $cur == *:* ]] ; then
|
||||
COMPREPLY=( $(compgen -g -- "${cur#*:}") )
|
||||
@@ -1395,7 +1435,7 @@ _docker_container_commit() {
|
||||
_docker_container_cp() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--follow-link -L --help" -- "$cur" ) )
|
||||
COMPREPLY=( $( compgen -W "--archive -a --follow-link -L --help" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
local counter=$(__docker_pos_first_nonflag)
|
||||
@@ -1414,8 +1454,7 @@ _docker_container_cp() {
|
||||
local containers=( ${COMPREPLY[@]} )
|
||||
|
||||
COMPREPLY=( $( compgen -W "${files[*]} ${containers[*]}" -- "$cur" ) )
|
||||
# shellcheck disable=SC2128
|
||||
if [[ "$COMPREPLY" == *: ]]; then
|
||||
if [[ "${COMPREPLY[*]}" = *: ]]; then
|
||||
__docker_nospace
|
||||
fi
|
||||
return
|
||||
@@ -1913,8 +1952,7 @@ _docker_container_run_and_create() {
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W 'none host private shareable container:' -- "$cur" ) )
|
||||
# shellcheck disable=SC2128
|
||||
if [ "$COMPREPLY" = "container:" ]; then
|
||||
if [ "${COMPREPLY[*]}" = "container:" ]; then
|
||||
__docker_nospace
|
||||
fi
|
||||
;;
|
||||
@@ -1968,8 +2006,7 @@ _docker_container_run_and_create() {
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W 'host container:' -- "$cur" ) )
|
||||
# shellcheck disable=SC2128
|
||||
if [ "$COMPREPLY" = "container:" ]; then
|
||||
if [ "${COMPREPLY[*]}" = "container:" ]; then
|
||||
__docker_nospace
|
||||
fi
|
||||
;;
|
||||
@@ -2032,15 +2069,14 @@ _docker_container_run_and_create() {
|
||||
|
||||
_docker_container_start() {
|
||||
__docker_complete_detach_keys && return
|
||||
# shellcheck disable=SC2078
|
||||
case "$prev" in
|
||||
--checkpoint)
|
||||
if [ __docker_daemon_is_experimental ] ; then
|
||||
if __docker_daemon_is_experimental ; then
|
||||
return
|
||||
fi
|
||||
;;
|
||||
--checkpoint-dir)
|
||||
if [ __docker_daemon_is_experimental ] ; then
|
||||
if __docker_daemon_is_experimental ; then
|
||||
_filedir -d
|
||||
return
|
||||
fi
|
||||
@@ -3220,7 +3256,7 @@ _docker_service_logs() {
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--follow -f --help --no-resolve --no-task-ids --no-trunc --since --tail --timestamps -t" -- "$cur" ) )
|
||||
COMPREPLY=( $( compgen -W "--details --follow -f --help --no-resolve --no-task-ids --no-trunc --raw --since --tail --timestamps -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
local counter=$(__docker_pos_first_nonflag '--since|--tail')
|
||||
@@ -4378,11 +4414,15 @@ _docker_stack() {
|
||||
remove
|
||||
up
|
||||
"
|
||||
|
||||
__docker_complete_stack_orchestrator_options && return
|
||||
__docker_subcommands "$subcommands $aliases" && return
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
local options="--help --orchestrator"
|
||||
__docker_stack_orchestrator_is kubernetes && options+=" --kubeconfig"
|
||||
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) )
|
||||
@@ -4391,12 +4431,12 @@ _docker_stack() {
|
||||
}
|
||||
|
||||
_docker_stack_deploy() {
|
||||
__docker_complete_stack_orchestrator_options && return
|
||||
|
||||
case "$prev" in
|
||||
--bundle-file)
|
||||
if __docker_daemon_is_experimental ; then
|
||||
_filedir dab
|
||||
return
|
||||
fi
|
||||
_filedir dab
|
||||
return
|
||||
;;
|
||||
--compose-file|-c)
|
||||
_filedir yml
|
||||
@@ -4410,12 +4450,14 @@ _docker_stack_deploy() {
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
local options="--compose-file -c --help --prune --resolve-image --with-registry-auth"
|
||||
__docker_daemon_is_experimental && options+=" --bundle-file"
|
||||
local options="--compose-file -c --help --orchestrator"
|
||||
__docker_daemon_is_experimental && __docker_stack_orchestrator_is swarm && options+=" --bundle-file"
|
||||
__docker_stack_orchestrator_is kubernetes && options+=" --kubeconfig --namespace"
|
||||
__docker_stack_orchestrator_is swarm && options+=" --prune --resolve-image --with-registry-auth"
|
||||
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
local counter=$(__docker_pos_first_nonflag '--bundle-file|--compose-file|-c|--resolve-image')
|
||||
local counter=$(__docker_pos_first_nonflag '--bundle-file|--compose-file|-c|--kubeconfig|--namespace|--orchestrator|--resolve-image')
|
||||
if [ "$cword" -eq "$counter" ]; then
|
||||
__docker_complete_stacks
|
||||
fi
|
||||
@@ -4432,6 +4474,8 @@ _docker_stack_list() {
|
||||
}
|
||||
|
||||
_docker_stack_ls() {
|
||||
__docker_complete_stack_orchestrator_options && return
|
||||
|
||||
case "$prev" in
|
||||
--format)
|
||||
return
|
||||
@@ -4440,7 +4484,9 @@ _docker_stack_ls() {
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--format --help" -- "$cur" ) )
|
||||
local options="--format --help --orchestrator"
|
||||
__docker_stack_orchestrator_is kubernetes && options+=" --all-namespaces --kubeconfig --namespace"
|
||||
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -4462,6 +4508,8 @@ _docker_stack_ps() {
|
||||
;;
|
||||
esac
|
||||
|
||||
__docker_complete_stack_orchestrator_options && return
|
||||
|
||||
case "$prev" in
|
||||
--filter|-f)
|
||||
COMPREPLY=( $( compgen -S = -W "id name desired-state" -- "$cur" ) )
|
||||
@@ -4475,10 +4523,12 @@ _docker_stack_ps() {
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--filter -f --format --help --no-resolve --no-trunc --quiet -q" -- "$cur" ) )
|
||||
local options="--filter -f --format --help --no-resolve --no-trunc --orchestrator --quiet -q"
|
||||
__docker_stack_orchestrator_is kubernetes && options+=" --all-namespaces --kubeconfig --namespace"
|
||||
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
local counter=$(__docker_pos_first_nonflag '--filter|-f')
|
||||
local counter=$(__docker_pos_first_nonflag '--all-namespaces|--filter|-f|--format|--kubeconfig|--namespace')
|
||||
if [ "$cword" -eq "$counter" ]; then
|
||||
__docker_complete_stacks
|
||||
fi
|
||||
@@ -4491,9 +4541,13 @@ _docker_stack_remove() {
|
||||
}
|
||||
|
||||
_docker_stack_rm() {
|
||||
__docker_complete_stack_orchestrator_options && return
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
local options="--help --orchestrator"
|
||||
__docker_stack_orchestrator_is kubernetes && options+=" --kubeconfig --namespace"
|
||||
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_complete_stacks
|
||||
@@ -4517,6 +4571,8 @@ _docker_stack_services() {
|
||||
;;
|
||||
esac
|
||||
|
||||
__docker_complete_stack_orchestrator_options && return
|
||||
|
||||
case "$prev" in
|
||||
--filter|-f)
|
||||
COMPREPLY=( $( compgen -S = -W "id label name" -- "$cur" ) )
|
||||
@@ -4530,10 +4586,12 @@ _docker_stack_services() {
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--filter -f --format --help --quiet -q" -- "$cur" ) )
|
||||
local options="--filter -f --format --help --orchestrator --quiet -q"
|
||||
__docker_stack_orchestrator_is kubernetes && options+=" --kubeconfig --namespace"
|
||||
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
local counter=$(__docker_pos_first_nonflag '--filter|-f|--format')
|
||||
local counter=$(__docker_pos_first_nonflag '--filter|-f|--format|--kubeconfig|--namespace|--orchestrator')
|
||||
if [ "$cword" -eq "$counter" ]; then
|
||||
__docker_complete_stacks
|
||||
fi
|
||||
@@ -4658,6 +4716,10 @@ _docker_system_events() {
|
||||
__docker_complete_networks --cur "${cur##*=}"
|
||||
return
|
||||
;;
|
||||
scope)
|
||||
COMPREPLY=( $( compgen -W "local swarm" -- "${cur##*=}" ) )
|
||||
return
|
||||
;;
|
||||
type)
|
||||
COMPREPLY=( $( compgen -W "config container daemon image network plugin secret service volume" -- "${cur##*=}" ) )
|
||||
return
|
||||
@@ -4670,7 +4732,7 @@ _docker_system_events() {
|
||||
|
||||
case "$prev" in
|
||||
--filter|-f)
|
||||
COMPREPLY=( $( compgen -S = -W "container daemon event image label network type volume" -- "$cur" ) )
|
||||
COMPREPLY=( $( compgen -S = -W "container daemon event image label network scope type volume" -- "$cur" ) )
|
||||
__docker_nospace
|
||||
return
|
||||
;;
|
||||
@@ -4796,6 +4858,8 @@ _docker_top() {
|
||||
}
|
||||
|
||||
_docker_version() {
|
||||
__docker_complete_stack_orchestrator_options && return
|
||||
|
||||
case "$prev" in
|
||||
--format|-f)
|
||||
return
|
||||
@@ -4804,7 +4868,9 @@ _docker_version() {
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--format -f --help" -- "$cur" ) )
|
||||
local options="--format -f --help"
|
||||
__docker_stack_orchestrator_is kubernetes && options+=" --kubeconfig"
|
||||
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -5034,6 +5100,9 @@ _docker() {
|
||||
|
||||
local host config daemon_os
|
||||
|
||||
# variables to cache client info, populated on demand for performance reasons
|
||||
local stack_orchestrator_is_kubernetes stack_orchestrator_is_swarm
|
||||
|
||||
COMPREPLY=()
|
||||
local cur prev words cword
|
||||
_get_comp_words_by_ref -n : cur prev words cword
|
||||
|
||||
@@ -431,7 +431,7 @@ __docker_complete_events_filter() {
|
||||
integer ret=1
|
||||
declare -a opts
|
||||
|
||||
opts=('container' 'daemon' 'event' 'image' 'label' 'network' 'type' 'volume')
|
||||
opts=('container' 'daemon' 'event' 'image' 'label' 'network' 'scope' 'type' 'volume')
|
||||
|
||||
if compset -P '*='; then
|
||||
case "${${words[-1]%=*}#*=}" in
|
||||
@@ -461,6 +461,11 @@ __docker_complete_events_filter() {
|
||||
(network)
|
||||
__docker_complete_networks && ret=0
|
||||
;;
|
||||
(scope)
|
||||
local -a scope_opts
|
||||
scope_opts=('local' 'swarm')
|
||||
_describe -t scope-filter-opts "scope filter options" scope_opts && ret=0
|
||||
;;
|
||||
(type)
|
||||
local -a type_opts
|
||||
type_opts=('container' 'daemon' 'image' 'network' 'volume')
|
||||
@@ -923,7 +928,7 @@ __docker_container_subcommand() {
|
||||
local state
|
||||
_arguments $(__docker_arguments) \
|
||||
$opts_help \
|
||||
opts_create_run_update \
|
||||
$opts_create_run_update \
|
||||
"($help -)*: :->values" && ret=0
|
||||
case $state in
|
||||
(values)
|
||||
@@ -2209,7 +2214,7 @@ __docker_stack_subcommand() {
|
||||
_arguments $(__docker_arguments) \
|
||||
$opts_help \
|
||||
"($help)--bundle-file=[Path to a Distributed Application Bundle file]:dab:_files -g \"*.dab\"" \
|
||||
"($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file]:compose file:_files -g \"*.(yml|yaml)\"" \
|
||||
"($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file, or '-' to read from stdin]:compose file:_files -g \"*.(yml|yaml)\"" \
|
||||
"($help)--with-registry-auth[Send registry authentication details to Swarm agents]" \
|
||||
"($help -):stack:__docker_complete_stacks" && ret=0
|
||||
;;
|
||||
|
||||
@@ -28,7 +28,7 @@ Aliases:
|
||||
|
||||
Options:
|
||||
--bundle-file string Path to a Distributed Application Bundle file
|
||||
--compose-file string Path to a Compose file
|
||||
--compose-file string Path to a Compose file, or "-" to read from stdin
|
||||
--help Print usage
|
||||
--prune Prune services that are no longer referenced
|
||||
--with-registry-auth Send registry authentication details to Swarm agents
|
||||
|
||||
@@ -25,7 +25,7 @@ Aliases:
|
||||
|
||||
Options:
|
||||
--bundle-file string Path to a Distributed Application Bundle file
|
||||
-c, --compose-file strings Path to a Compose file
|
||||
-c, --compose-file strings Path to a Compose file, or "-" to read from stdin
|
||||
--help Print usage
|
||||
--kubeconfig string Kubernetes config file
|
||||
--namespace string Kubernetes namespace to use
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package stack
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"gotest.tools/golden"
|
||||
"gotest.tools/icmd"
|
||||
)
|
||||
|
||||
func TestStackDeployHelp(t *testing.T) {
|
||||
t.Run("Swarm", func(t *testing.T) {
|
||||
testStackDeployHelp(t, "swarm")
|
||||
})
|
||||
t.Run("Kubernetes", func(t *testing.T) {
|
||||
testStackDeployHelp(t, "kubernetes")
|
||||
})
|
||||
}
|
||||
|
||||
func testStackDeployHelp(t *testing.T, orchestrator string) {
|
||||
result := icmd.RunCommand("docker", "stack", "deploy", "--orchestrator", orchestrator, "--help")
|
||||
result.Assert(t, icmd.Success)
|
||||
golden.Assert(t, result.Stdout(), fmt.Sprintf("stack-deploy-help-%s.golden", orchestrator))
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
Usage: docker stack deploy [OPTIONS] STACK
|
||||
|
||||
Deploy a new stack or update an existing stack
|
||||
|
||||
Aliases:
|
||||
deploy, up
|
||||
|
||||
Options:
|
||||
-c, --compose-file strings Path to a Compose file, or "-" to read
|
||||
from stdin
|
||||
--kubeconfig string Kubernetes config file
|
||||
--namespace string Kubernetes namespace to use
|
||||
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
Usage: docker stack deploy [OPTIONS] STACK
|
||||
|
||||
Deploy a new stack or update an existing stack
|
||||
|
||||
Aliases:
|
||||
deploy, up
|
||||
|
||||
Options:
|
||||
--bundle-file string Path to a Distributed Application Bundle file
|
||||
-c, --compose-file strings Path to a Compose file, or "-" to read
|
||||
from stdin
|
||||
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
|
||||
--prune Prune services that are no longer referenced
|
||||
--resolve-image string Query the registry to resolve image digest
|
||||
and supported platforms
|
||||
("always"|"changed"|"never") (default "always")
|
||||
--with-registry-auth Send registry authentication details to
|
||||
Swarm agents
|
||||
Reference in New Issue
Block a user