Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Cherry picks 1.12.0 rc4 #24467

Merged
merged 105 commits into from
Jul 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
6387822
[Docs] clarified local volume driver docs
nicolaka Jun 30, 2016
76aed24
Improve systemd service unit in *Automatically start containers*
vdemeester Jul 1, 2016
67f4f5d
rename desired_state filter to desired-state
thaJeztah Jun 29, 2016
bb41792
add menu.md, make index.md command line reference, update typos/minor…
sfsmithcha Jun 28, 2016
855dc5b
Volume mounts need to use "Binds" API field
cpuguy83 Jun 24, 2016
7e086db
Fix --auto-accept documentation
aaronlehmann Jul 1, 2016
15dee37
Improve timestamp formatting
thaJeztah Jul 2, 2016
5c9db19
Update network_create.md
cloojure Jul 1, 2016
a4bc0cf
fix typo in "readonly" flag in documentation
thaJeztah Jul 2, 2016
7dc8b03
[doc] add missing whitespace
bamarni Jul 3, 2016
98e4b00
Fix typo
aochagavia Jul 3, 2016
18d85f7
man: add missing --add-runtime
runcom Jul 2, 2016
0e1d691
23837 Added long flag to docker ps for checking latest n containers. …
sbose78 Jun 22, 2016
be2bec4
remove incorrect L3 recommendation
thaJeztah Jul 2, 2016
664c75e
Fix spelling in comments, strings and documentation
ottok Jul 3, 2016
46a866e
Add zsh completion for 'docker node' commands
sdurrheimer Jul 2, 2016
dbdd38e
Add zsh completion for 'docker swarm' commands
sdurrheimer Jul 2, 2016
8b72a21
add a whitespace in plugin's logging
allencloud Jul 4, 2016
a8bd5c6
Add fchmod and fchmodat to TestRunSeccompProfileDenyChmod
coolljt0725 Jul 4, 2016
65e339b
Add zsh completion for 'docker daemon --runtimes' and 'docker run --r…
sdurrheimer Jun 21, 2016
4cedd8f
Add zsh completion for 'docker service' commands
sdurrheimer Jul 2, 2016
aa89297
Fix typo - stacks being managed, not tasks?
skaasten Jul 4, 2016
9d4117a
Add NoArm64 testRequires and skip Schema1RegistrySuite on arm64
coolljt0725 Jul 4, 2016
e54d291
Fix a grammatical error in errClusterNetworkOnRun()'s error message.
F21 Jul 5, 2016
3eb83b5
fix typos
allencloud Jul 3, 2016
ef62360
Mask swarm secrets from daemon logs
tonistiigi Jun 30, 2016
d81ed3e
Always store the image digest when pulling and pushing an image.
dmcgowan Jun 27, 2016
dd7fe47
Treat digest only images as dangling
dmcgowan Jun 30, 2016
58eb747
fix stdout and stderr in api client
allencloud Jul 4, 2016
bbc85af
Allow service and node filter to be name…
vdemeester Jun 30, 2016
fcdaa2d
Atomically save libtrust key file
dmcgowan Jun 27, 2016
65c03f1
contrib: systemd: set Limit* to infinity
cyphar Jul 4, 2016
b6349ac
Fixed a few network UI issues in swarm-mode
mavenugo Jun 30, 2016
da2ad48
image spec: Correct set of acceptable characters in tags
aaronlehmann Jul 5, 2016
e8c1361
fix severe fd leak in stack
allencloud Jul 5, 2016
6966df5
Validate hostname starting from 1.24 API.
vdemeester Jul 6, 2016
b18cea6
Improve the warning messages when leaving a Swarm cluster
avsm Jul 5, 2016
f7a8a31
vendor docker/distribution 4e17ab5d319ac5b70b2769442947567a83386fbc
runcom Jul 6, 2016
3bf2347
integration-cli: ensure digest is the same after cross-repo push
runcom Jul 6, 2016
85aefec
Implement service integration tests
cpuguy83 Jun 29, 2016
6b30370
Remove unmatched bracket from _docker for zsh
floatingLomas Jul 6, 2016
ee1fa5b
Change NAME to HOSTNAME in docs for `docker node ls`
yongtang Jul 7, 2016
0a21d2b
make `docker service --help` text for `--endpoint-mode` more consistent
avsm Jul 5, 2016
f331f05
re-vendor engine-api
Jul 5, 2016
272e75f
re-vendor swarmkit
Jul 5, 2016
843b4a9
Use newer default values for mounts CLI
Jul 5, 2016
61dc82f
Detect non-plugin content during install and error out.
anusha-ragunathan Jul 6, 2016
3b8f724
Vendor engine-api 1d247454d4307fb1ddf10d09fd2996394b085904
vdemeester Jul 7, 2016
23be238
Use "on-failure" for both containers and services
vdemeester Jul 7, 2016
a00d12a
Generate a swarm joining secret if none is specified
aaronlehmann Jul 5, 2016
f831be8
Updates on cli reference documentation
vdemeester Jul 7, 2016
0a86114
Windows: Ensure VolumePath is not set for Hyper-V containers
Jun 29, 2016
d28a867
Make the docker proxy a standalone binary not a re-exec
justincormack Jun 3, 2016
bf2efa3
Update libnetwork vendoring
justincormack Jul 7, 2016
3c338c7
Update swarmkit vendoring
justincormack Jul 7, 2016
a654ab1
Fix test case for docker_api_swarm_test.go
justincormack Jul 7, 2016
7a09cd2
add iptables=false to docs for multiple daemons
thaJeztah Jul 7, 2016
e90025a
add constraint to service create ref
sfsmithcha Jul 7, 2016
2348617
Update binary install docs with new contents of tgz
justincormack Jul 8, 2016
52ca6cb
daemon: ensure we set default options to stock runtime
runcom Jul 8, 2016
b1819cb
Add missing docker-proxy into managed files in rpm spec
justincormack Jul 8, 2016
65a256f
Revert "Fixed a few network UI issues in swarm-mode"
mavenugo Jul 7, 2016
b74b71e
fixes #23983
mavenugo Jul 7, 2016
2bb603a
Fix daemon not cleaned up w/ live restore enabled
cpuguy83 Jul 8, 2016
1a45978
Validate arguments for `ps` in `docker top`
AkihiroSuda Jul 6, 2016
89bb424
bash completion for `docker {service,node}` filters
albers Jun 29, 2016
00a988c
bash completion can be configured to show node and service IDs
albers Jun 29, 2016
d8d1573
bash completion for default port on `docker swarm {init,join}`
albers Jun 29, 2016
92b4422
Add ltdl dependencies for aarch64
justincormack Jul 7, 2016
9b5d507
Add release tag reference links in deprecated.md
yongtang Jun 19, 2016
0450069
vendor: update swarmkit to 6478bc19
tonistiigi Jul 8, 2016
df6581a
Update executor volumes from swarmkit
tonistiigi Jul 8, 2016
82603c3
Add logdrivers to executor from swarmkit
tonistiigi Jul 8, 2016
b008283
Add more complicated demotion testcases
tonistiigi Jul 8, 2016
adbb169
Fix seccomp output in `docker info`
yongtang Jul 8, 2016
e76138c
integration-cli: fix --net=none tests
runcom Jul 10, 2016
2e37061
add health check in docker cluster
runshenzhu Jun 28, 2016
f17d02c
Fix grammar in docker volumes tutorial
lchi Jul 10, 2016
e0960bd
Add blanks lines in docs for clarity
ardnaxelarak Jun 30, 2016
e07a1af
Fixes broken link in docs.
Jul 8, 2016
25b235a
return err when stack name does not exist
allencloud Jun 28, 2016
e7dd82f
swarmkit expects network-id for as target
mavenugo Jul 9, 2016
c164011
Change content-trust doc to not point to images that don't exist #22730
mansi-nahar Jun 13, 2016
88d82ee
Remove execution driver
hqhq Jul 11, 2016
db94be5
Shutdown plugins during daemon shutdown.
anusha-ragunathan Jul 1, 2016
56ab840
Use waitAndAssert to test node state changes
tonistiigi Jul 8, 2016
5dafcf2
Clarify warning against using build-time variables for secrets
hairyhenderson Jul 12, 2016
d16f049
Add missing API docs for HostConfig.PidMode
thaJeztah Jul 11, 2016
209f6e2
Fix a minor typo in swarm tutorial docs
yongtang Jul 12, 2016
c0a787d
Add support for comma-separated --auto-accept syntax.
johnharris85 Jun 29, 2016
72274de
Don't retry push on an unknown repository
aaronlehmann Jul 12, 2016
adfeccf
Allow option to override kernel check in overlay2
dmcgowan Jul 11, 2016
18f1fc8
Return an empty services list if no services are running
rsippl Jul 12, 2016
909e7a2
Add API test for empty services list
rsippl Jul 12, 2016
85bb54b
add caveat for network plugins in swarm mode
sfsmithcha Jul 12, 2016
eaa8821
integration-cli: add test for restarting entire swarm cluster
LK4D4 Jul 8, 2016
156495f
Add "auto-accept=none" to documentation
thaJeztah Jul 12, 2016
bc5eb28
Fix some broken sourceforge.net links
thaJeztah Jul 12, 2016
6ce4e9b
Vendoring libnetwork
mavenugo Jul 12, 2016
9a0e0cc
Fixing a stale endpoint issue that blocks ingress network cleanup
mavenugo Jul 12, 2016
98b1553
Fix panic when meminfo couldn't be read
cpuguy83 Jul 12, 2016
31d24fa
Fix panic while merging log configs to nil map
cpuguy83 Jul 12, 2016
e3ed7f8
Organize run flags into categories
Jun 6, 2016
c61fa33
Rename `--net` to `--network`
Jun 6, 2016
f00c098
Uncomment the TasksMax val later in the deb build
clnperez Jun 30, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ by another client (#15489)
#### Security
- Fix tar breakout vulnerability
* Extractions are now sandboxed chroot
- Security options are no longer committed to images
- Security options are no longer comitted to images

#### Runtime
- Fix deadlock in `docker ps -f exited=1`
Expand Down Expand Up @@ -1444,7 +1444,7 @@ by another client (#15489)
* Update issue filing instructions
* Warn against the use of symlinks for Docker's storage folder
* Replace the Firefox example with an IceWeasel example
* Rewrite the PostgresSQL example using a Dockerfile and add more details to it
* Rewrite the PostgreSQL example using a Dockerfile and add more details to it
* Improve the OS X documentation

#### Remote API
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RUN apt-get update && apt-get install -y \
libapparmor-dev \
libc6-dev \
libcap-dev \
libltdl-dev \
libsqlite3-dev \
libsystemd-dev \
mercurial \
Expand Down
1 change: 1 addition & 0 deletions api/client/container/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func NewCopyCommand(dockerCli *client.DockerCli) *cobra.Command {
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH`,
Short: "Copy files/folders between a container and the local filesystem",
Long: strings.Join([]string{
"Copy files/folders between a container and the local filesystem\n",
"\nUse '-' as the source to read a tar archive from stdin\n",
"and extract it to a directory destination in a container.\n",
"Use '-' as the destination to stream a tar archive of a\n",
Expand Down
2 changes: 1 addition & 1 deletion api/client/container/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewPsCommand(dockerCli *client.DockerCli) *cobra.Command {
flags.BoolVarP(&opts.all, "all", "a", false, "Show all containers (default shows just running)")
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Don't truncate output")
flags.BoolVarP(&opts.nLatest, "latest", "l", false, "Show the latest created container (includes all states)")
flags.IntVarP(&opts.last, "", "n", -1, "Show n last created containers (includes all states)")
flags.IntVarP(&opts.last, "last", "n", -1, "Show n last created containers (includes all states)")
flags.StringVarP(&opts.format, "format", "", "", "Pretty-print containers using a Go template")
flags.StringSliceVarP(&opts.filter, "filter", "f", []string{}, "Filter output based on conditions provided")

Expand Down
2 changes: 1 addition & 1 deletion api/client/image/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewTagCommand(dockerCli *client.DockerCli) *cobra.Command {
var opts tagOptions

cmd := &cobra.Command{
Use: "tag IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]",
Use: "tag IMAGE[:TAG] IMAGE[:TAG]",
Short: "Tag an image into a repository",
Args: cli.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
1 change: 0 additions & 1 deletion api/client/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
fmt.Fprintf(cli.out, "%s: %s\n", pair[0], pair[1])
}
}
ioutils.FprintfIfNotEmpty(cli.out, "Execution Driver: %s\n", info.ExecutionDriver)
ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
ioutils.FprintfIfNotEmpty(cli.out, "Cgroup Driver: %s\n", info.CgroupDriver)

Expand Down
2 changes: 1 addition & 1 deletion api/client/network/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func runRemove(dockerCli *client.DockerCli, networks []string) error {
status = 1
continue
}
fmt.Fprintf(dockerCli.Err(), "%s\n", name)
fmt.Fprintf(dockerCli.Out(), "%s\n", name)
}

if status != 0 {
Expand Down
7 changes: 4 additions & 3 deletions api/client/node/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ func NewNodeCommand(dockerCli *client.DockerCli) *cobra.Command {
return cmd
}

func nodeReference(client apiclient.APIClient, ctx context.Context, ref string) (string, error) {
// The special value "self" for a node reference is mapped to the current
// node, hence the node ID is retrieved using the `/info` endpoint.
// Reference returns the reference of a node. The special value "self" for a node
// reference is mapped to the current node, hence the node ID is retrieved using
// the `/info` endpoint.
func Reference(client apiclient.APIClient, ctx context.Context, ref string) (string, error) {
if ref == "self" {
info, err := client.Info(ctx)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/client/node/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func runInspect(dockerCli *client.DockerCli, opts inspectOptions) error {
client := dockerCli.Client()
ctx := context.Background()
getRef := func(ref string) (interface{}, []byte, error) {
nodeRef, err := nodeReference(client, ctx, ref)
nodeRef, err := Reference(client, ctx, ref)
if err != nil {
return nil, nil, err
}
Expand Down
9 changes: 4 additions & 5 deletions api/client/node/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {
client := dockerCli.Client()
ctx := context.Background()

nodeRef, err := nodeReference(client, ctx, opts.nodeID)
nodeRef, err := Reference(client, ctx, opts.nodeID)
if err != nil {
return nil
}
Expand All @@ -55,10 +55,9 @@ func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {

filter := opts.filter.Value()
filter.Add("node", node.ID)
if !opts.all && !filter.Include("desired_state") {
filter.Add("desired_state", string(swarm.TaskStateRunning))
filter.Add("desired_state", string(swarm.TaskStateAccepted))

if !opts.all && !filter.Include("desired-state") {
filter.Add("desired-state", string(swarm.TaskStateRunning))
filter.Add("desired-state", string(swarm.TaskStateAccepted))
}

tasks, err := client.TaskList(
Expand Down
2 changes: 1 addition & 1 deletion api/client/registry/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func runLogout(dockerCli *client.DockerCli, serverAddress string) error {

fmt.Fprintf(dockerCli.Out(), "Remove login credentials for %s\n", serverAddress)
if err := client.EraseCredentials(dockerCli.ConfigFile(), serverAddress); err != nil {
fmt.Fprintf(dockerCli.Out(), "WARNING: could not erase credentials: %v\n", err)
fmt.Fprintf(dockerCli.Err(), "WARNING: could not erase credentials: %v\n", err)
}

return nil
Expand Down
7 changes: 4 additions & 3 deletions api/client/service/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
Expand Down Expand Up @@ -33,7 +34,7 @@ func newCreateCommand(dockerCli *client.DockerCli) *cobra.Command {

func runCreate(dockerCli *client.DockerCli, opts *serviceOptions) error {
apiClient := dockerCli.Client()
headers := map[string][]string{}
createOpts := types.ServiceCreateOptions{}

service, err := opts.ToService()
if err != nil {
Expand All @@ -49,10 +50,10 @@ func runCreate(dockerCli *client.DockerCli, opts *serviceOptions) error {
if err != nil {
return err
}
headers["X-Registry-Auth"] = []string{encodedAuth}
createOpts.EncodedRegistryAuth = encodedAuth
}

response, err := apiClient.ServiceCreate(ctx, service, headers)
response, err := apiClient.ServiceCreate(ctx, service, createOpts)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion api/client/service/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func printContainerSpec(out io.Writer, containerSpec swarm.ContainerSpec) {
for _, v := range containerSpec.Mounts {
fmt.Fprintf(out, " Target = %s\n", v.Target)
fmt.Fprintf(out, " Source = %s\n", v.Source)
fmt.Fprintf(out, " Writable = %v\n", v.Writable)
fmt.Fprintf(out, " ReadOnly = %v\n", v.ReadOnly)
fmt.Fprintf(out, " Type = %v\n", v.Type)
}
}
Expand Down
36 changes: 27 additions & 9 deletions api/client/service/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,16 @@ func (m *MountOpt) Set(value string) error {
}
}

// Set writable as the default
for _, field := range fields {
parts := strings.SplitN(field, "=", 2)
if len(parts) == 1 && strings.ToLower(parts[0]) == "writable" {
mount.Writable = true
if len(parts) == 1 && strings.ToLower(parts[0]) == "readonly" {
mount.ReadOnly = true
continue
}

if len(parts) == 1 && strings.ToLower(parts[0]) == "volume-nocopy" {
volumeOptions().NoCopy = true
continue
}

Expand All @@ -195,15 +201,16 @@ func (m *MountOpt) Set(value string) error {
mount.Source = value
case "target":
mount.Target = value
case "writable":
mount.Writable, err = strconv.ParseBool(value)
case "readonly":
ro, err := strconv.ParseBool(value)
if err != nil {
return fmt.Errorf("invalid value for writable: %s", value)
return fmt.Errorf("invalid value for readonly: %s", value)
}
mount.ReadOnly = ro
case "bind-propagation":
bindOptions().Propagation = swarm.MountPropagation(strings.ToUpper(value))
case "volume-populate":
volumeOptions().Populate, err = strconv.ParseBool(value)
case "volume-nocopy":
volumeOptions().NoCopy, err = strconv.ParseBool(value)
if err != nil {
return fmt.Errorf("invalid value for populate: %s", value)
}
Expand All @@ -229,6 +236,17 @@ func (m *MountOpt) Set(value string) error {
return fmt.Errorf("target is required")
}

if mount.VolumeOptions != nil && mount.Source == "" {
return fmt.Errorf("source is required when specifying volume-* options")
}

if mount.Type == swarm.MountType("BIND") && mount.VolumeOptions != nil {
return fmt.Errorf("cannot mix 'volume-*' options with mount type '%s'", swarm.MountTypeBind)
}
if mount.Type == swarm.MountType("VOLUME") && mount.BindOptions != nil {
return fmt.Errorf("cannot mix 'bind-*' options with mount type '%s'", swarm.MountTypeVolume)
}

m.values = append(m.values, mount)
return nil
}
Expand Down Expand Up @@ -458,7 +476,7 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {

flags.Var(&opts.replicas, flagReplicas, "Number of tasks")

flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", "Restart when condition is met (none, on_failure, or any)")
flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", "Restart when condition is met (none, on-failure, or any)")
flags.Var(&opts.restartPolicy.delay, flagRestartDelay, "Delay between restart attempts")
flags.Var(&opts.restartPolicy.maxAttempts, flagRestartMaxAttempts, "Maximum number of restarts before giving up")
flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evaluate the restart policy")
Expand All @@ -469,7 +487,7 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
flags.DurationVar(&opts.update.delay, flagUpdateDelay, time.Duration(0), "Delay between updates")

flags.StringSliceVar(&opts.networks, flagNetwork, []string{}, "Network attachments")
flags.StringVar(&opts.endpoint.mode, flagEndpointMode, "", "Endpoint mode(Valid values: vip, dnsrr)")
flags.StringVar(&opts.endpoint.mode, flagEndpointMode, "", "Endpoint mode (vip or dnsrr)")
flags.VarP(&opts.endpoint.ports, flagPublish, "p", "Publish a port as a node port")

flags.BoolVar(&opts.registryAuth, flagRegistryAuth, false, "Send registry authentication details to Swarm agents")
Expand Down
50 changes: 49 additions & 1 deletion api/client/service/opts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,53 @@ func TestMountOptSetErrorInvalidField(t *testing.T) {

func TestMountOptSetErrorInvalidWritable(t *testing.T) {
var mount MountOpt
assert.Error(t, mount.Set("type=VOLUME,writable=yes"), "invalid value for writable: yes")
assert.Error(t, mount.Set("type=VOLUME,readonly=no"), "invalid value for readonly: no")
}

func TestMountOptDefaultEnableWritable(t *testing.T) {
var m MountOpt
assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo"))
assert.Equal(t, m.values[0].ReadOnly, false)

m = MountOpt{}
assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo,readonly"))
assert.Equal(t, m.values[0].ReadOnly, true)

m = MountOpt{}
assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo,readonly=1"))
assert.Equal(t, m.values[0].ReadOnly, true)

m = MountOpt{}
assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo,readonly=0"))
assert.Equal(t, m.values[0].ReadOnly, false)
}

func TestMountOptVolumeNoCopy(t *testing.T) {
var m MountOpt
assert.Error(t, m.Set("type=volume,target=/foo,volume-nocopy"), "source is required")

m = MountOpt{}
assert.NilError(t, m.Set("type=volume,target=/foo,source=foo"))
assert.Equal(t, m.values[0].VolumeOptions == nil, true)

m = MountOpt{}
assert.NilError(t, m.Set("type=volume,target=/foo,source=foo,volume-nocopy=true"))
assert.Equal(t, m.values[0].VolumeOptions != nil, true)
assert.Equal(t, m.values[0].VolumeOptions.NoCopy, true)

m = MountOpt{}
assert.NilError(t, m.Set("type=volume,target=/foo,source=foo,volume-nocopy"))
assert.Equal(t, m.values[0].VolumeOptions != nil, true)
assert.Equal(t, m.values[0].VolumeOptions.NoCopy, true)

m = MountOpt{}
assert.NilError(t, m.Set("type=volume,target=/foo,source=foo,volume-nocopy=1"))
assert.Equal(t, m.values[0].VolumeOptions != nil, true)
assert.Equal(t, m.values[0].VolumeOptions.NoCopy, true)
}

func TestMountOptTypeConflict(t *testing.T) {
var m MountOpt
assert.Error(t, m.Set("type=bind,target=/foo,source=/foo,volume-nocopy=true"), "cannot mix")
assert.Error(t, m.Set("type=volume,target=/foo,source=/foo,bind-propagation=rprivate"), "cannot mix")
}
3 changes: 2 additions & 1 deletion api/client/service/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
"github.com/docker/engine-api/types"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -77,7 +78,7 @@ func runServiceScale(dockerCli *client.DockerCli, serviceID string, scale string
}
serviceMode.Replicated.Replicas = &uintScale

err = client.ServiceUpdate(ctx, service.ID, service.Version, service.Spec, nil)
err = client.ServiceUpdate(ctx, service.ID, service.Version, service.Spec, types.ServiceUpdateOptions{})
if err != nil {
return err
}
Expand Down
19 changes: 16 additions & 3 deletions api/client/service/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/docker/docker/api/client"
"github.com/docker/docker/api/client/idresolver"
"github.com/docker/docker/api/client/node"
"github.com/docker/docker/api/client/task"
"github.com/docker/docker/cli"
"github.com/docker/docker/opts"
Expand Down Expand Up @@ -51,9 +52,21 @@ func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {

filter := opts.filter.Value()
filter.Add("service", service.ID)
if !opts.all && !filter.Include("desired_state") {
filter.Add("desired_state", string(swarm.TaskStateRunning))
filter.Add("desired_state", string(swarm.TaskStateAccepted))
if !opts.all && !filter.Include("desired-state") {
filter.Add("desired-state", string(swarm.TaskStateRunning))
filter.Add("desired-state", string(swarm.TaskStateAccepted))
}

if filter.Include("node") {
nodeFilters := filter.Get("node")
for _, nodeFilter := range nodeFilters {
nodeReference, err := node.Reference(client, ctx, nodeFilter)
if err != nil {
return err
}
filter.Del("node", nodeFilter)
filter.Add("node", nodeReference)
}
}

tasks, err := client.TaskList(ctx, types.TaskListOptions{Filter: filter})
Expand Down
7 changes: 4 additions & 3 deletions api/client/service/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/opts"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/swarm"
"github.com/docker/go-connections/nat"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -39,7 +40,7 @@ func newUpdateCommand(dockerCli *client.DockerCli) *cobra.Command {
func runUpdate(dockerCli *client.DockerCli, flags *pflag.FlagSet, serviceID string) error {
apiClient := dockerCli.Client()
ctx := context.Background()
headers := map[string][]string{}
updateOpts := types.ServiceUpdateOptions{}

service, _, err := apiClient.ServiceInspectWithRaw(ctx, serviceID)
if err != nil {
Expand All @@ -64,10 +65,10 @@ func runUpdate(dockerCli *client.DockerCli, flags *pflag.FlagSet, serviceID stri
if err != nil {
return err
}
headers["X-Registry-Auth"] = []string{encodedAuth}
updateOpts.EncodedRegistryAuth = encodedAuth
}

err = apiClient.ServiceUpdate(ctx, service.ID, service.Version, service.Spec, headers)
err = apiClient.ServiceUpdate(ctx, service.ID, service.Version, service.Spec, updateOpts)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion api/client/stack/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewStackCommand(dockerCli *client.DockerCli) *cobra.Command {
return cmd
}

// NewTopLevelDeployCommand return a command for `docker deploy`
// NewTopLevelDeployCommand returns a command for `docker deploy`
func NewTopLevelDeployCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := newDeployCommand(dockerCli)
// Remove the aliases at the top level
Expand Down