Commit graph

2296 commits

Author SHA1 Message Date
John Howard (VM)
f577131d3b Fix stringer in Result (pkg\testutil\cmd)
Signed-off-by: John Howard (VM) <jhoward@ntdev.microsoft.com>
2017-03-13 08:40:31 -07:00
James Nugent
4683f588ce pkg/system: Set appropriate CFLAGS on Solaris
The cgo in `meminfo_solaris.go` initializes variables in for loops, and
therefore requires a `-std=c99` `CFLAG` in order to compile (at least on
modern SmartOS).

Signed-off-by: James Nugent <james@jen20.com>
2017-03-09 13:40:05 -05:00
Kenfe-Mickaël Laventure
9369acc776 Merge pull request #30733 from yongtang/02022017-formatter-header
Allow `--format` to use different delim in `table` format
2017-03-03 11:25:19 -08:00
Kenfe-Mickaël Laventure
d8b0d2b9e9 Merge pull request #30729 from dmcgowan/update-go-connections
Update go-connections package
2017-03-01 18:24:32 -08:00
Sebastiaan van Stijn
392ece2239
Improve coverage of pkg/ioutils/buffer
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-02-28 14:11:15 +01:00
phineas
da8cf590eb
Update copyright dates
Signed-off-by: phineas <phin@phineas.io>
2017-02-24 19:41:59 +00:00
Alexander Morozov
d52350d662 Merge pull request #30416 from stevenh/linux-mount-fixes
Fix linux mount calls not applying propagation type changes
2017-02-15 14:10:54 -08:00
Steven Hartland
b3b14b97b1 Fix linux mount calls not applying propagation type changes
Propagation type changes must be done as a separate call, in the
same way as read only bind mounts.

To fix this:
1. Ensure propagation type change flags aren't included in other calls.
2. Apply propagation type change in a separate call.

Also:
* Make it clear which parameters are ignored by passing them as empty.
* Add tests to ensure Mount options are applied correctly.

Fixes #30415

Signed-off-by: Steven Hartland <steven.hartland@multiplay.co.uk>
2017-02-15 14:15:09 +00:00
Drew Erny
f19b0d72d1 fix docker logs error handling
Previously, `docker logs` (and by extension, `docker service logs`) had
an error in the way they returned errors that occurred after a stream
had already been started. Specifically, the errors were added verbatim
to the HTTP response, which caused StdCopy to fail with an esoteric
error. This change updates StdCopy to accept errors from the source
stream and then return those errors when copying to the destination
stream.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2017-02-14 14:38:42 -08:00
Yong Tang
8b165cad1a Ignore some functions in the Go template when header is rendered
This fix ignore some functions in the Go template when header is
redendered, so that `--format "{{truncate .ID 1}}"` will still
be able to redener the header correctly.

Additional test cases have been added to the unit test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-10 19:34:50 -08:00
Brian Goff
bdf4cad1d1 Do group lookup in listeners package
This used to be handled by go-connections, but now it only takes a group
ID (int).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-09 16:38:52 -05:00
Derek McGowan
e5d77c64a2 Convert socket group to int
Sockets interface has been updated to take in a the group
id as an integer rather than a string.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2017-02-09 16:10:38 -05:00
Vincent Demeester
cb89d658dc
Bump go-units
To include  https://github.com/docker/go-units/pull/23
Fixes a unit test that fails because of it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-07 21:58:56 +01:00
Brian Goff
f907205f5d Merge pull request #30430 from Thynix/30374-remove-kickass
Replace "kickass" in name generator with "vigorous"
2017-02-01 10:33:07 -05:00
Steve Dougherty
2b30a79d9e
Replace "kickass" in name generator with "vigorous"
Having curse words in container names can get awkward.

Closes #30374.

Signed-off-by: Steve Dougherty <steve@asksteved.com>
2017-01-31 21:33:23 -05:00
Yong Tang
7fa8d5e064 Add truncate function for Go templates
This fix is part of the discussion in 28199 about using
`truncate` to replace `--no-trunc`.

As part of the fix, a new function `truncate` has been
added for Go templates so that it is possible to use
```
docker stack services --format "{{truncate .ID 5}}: {{.Mode}} {{.Replicas}}"
```
to show truncated ID.

A unit test has been added.

This fix is related to 28199.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-30 13:33:16 -08:00
Alexander Morozov
40c51569e2 Merge pull request #27713 from resouer/return-err
return when error happens on listener close
2017-01-27 12:29:08 -08:00
Alexander Morozov
023f7f5100 Merge pull request #30006 from mueller-ma/add-names-to-generator
Add names to namesgenerator
2017-01-27 11:19:19 -08:00
Alexander Morozov
2c948ac3e6 Merge pull request #28304 from ijc25/jsonmessage-use-terminfo
use terminfo in pkg/jsonmessage
2017-01-27 09:29:18 -08:00
Sebastiaan van Stijn
9b2dabbf18 Merge pull request #30227 from thaJeztah/fix-ineffectual-assignments
fix some ineffectual assignments (and minor fixes)
2017-01-25 02:49:57 +01:00
Brian Goff
f2d384fca6 Fix deadlock on v1 plugin with activate error
When a plugin has an activation error, it was not being checked in the
`waitActive` loop. This means it will just wait forever for a manifest
to be populated even though it may never come.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-01-24 11:08:13 -05:00
Sebastiaan van Stijn
ba0afd70e8 fix some ineffectual assignments
to make goreportcard a bit happier
https://goreportcard.com/report/github.com/docker/docker

also found that `TestCpToErrDstParentNotExists()` was
partially broken, because a `runDockerCp()` was inadvertently
removed in f26a31e80c

`TestDaemonRestartSaveContainerExitCode()` didn't verify
the actual _Error_ message, so added that to the test,
and updated the test to take into account that the
"experimental" CI enables `--init` on containers.

`TestVolumeCLICreateOptionConflict()` only checked
for an error to occur, but didn't validate if the
error was due to conflicting options.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-24 11:16:19 +01:00
Aaron Lehmann
062f2a3eae Merge pull request #30139 from Microsoft/jjh/sequential
Windows: Use sequential file access
2017-01-23 12:46:06 -08:00
John Howard
c98e77c77c Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-01-23 10:25:36 -08:00
Sebastiaan van Stijn
de0328560b Merge pull request #30165 from xulike666/fix-typo-6/36
[combined] fix typo
2017-01-19 17:21:22 +01:00
Aaron.L.Xu
40af569164 fix typo
fix typo I found AMAP in integration-cli/*

fix typo mentioned by Allencloud

Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
2017-01-19 15:52:28 +08:00
Brian Goff
0e8c7d7277 Merge pull request #30208 from justincormack/no-sqlite
Remove sqlite dependency
2017-01-18 13:15:38 -05:00
Sebastiaan van Stijn
5eda0c5947 Merge pull request #28925 from daehyeok/ineffassign
Refactoring ineffectual assignments
2017-01-18 15:01:57 +01:00
Akihiro Suda
30ca9e3b0c Merge pull request #30230 from stupendous-man/fix-typos
Fixed a typo within pkg/authorization/api.go
2017-01-18 14:23:03 +09:00
Diego Romero
48b8f54876 Fixed a typo within pkg/authorization/api.go
Signed-off-by: Diego Romero <idiegoromero@gmail.com>
2017-01-17 21:51:16 -05:00
Zhang Wei
3551893f46 Fix escaped go vet error
Find one escaped go vet error:

```
$ cd pkg/httputils/
$ go vet .
httputils_test.go:28: arg response for printf verb %q of wrong type:
*net/http.Response
```

You can also find it with

```
$ go vet github.com/docker/docker/pkg/httputils/
```

or

```
$ go vet ./...
```

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2017-01-18 00:13:09 +08:00
Alexander Morozov
b0f9958d93 daemon: remove graphdb usage
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2017-01-17 13:52:48 +00:00
mueller-ma
b05c70d297 Added four names to namesgenerator
Signed-off-by: Ma Müller <mueller-ma@users.noreply.github.com>
2017-01-14 22:31:32 +01:00
Anusha Ragunathan
0ef21eb0e3 Fix pluginv1 Windows volumes
c54b717 caused a regression for pluginv1 on Windows, where extraneous
backslashes were added to BasePath of the plugin. For pluginv1 on windows,
BasePath() should return an empty string, since the plugin is fully aware
of the mount path. Also, unlike Linux where all paths are relative to "/",
Windows paths are dependent on system drives and mapped drives.

Fixes #30148

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-01-13 17:01:48 -08:00
Daehyeok Mun
6306019d0b Refactoring ineffectual assignments
This patch fixed below 4 types of code line
1. Remove unnecessary variable assignment
2. Use variables declaration instead of explicit initial zero value
3. Change variable name to underbar when variable not used
4. Add erro check and return for ignored error

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2017-01-13 00:27:01 -07:00
Vincent Demeester
24e9ac1575 Merge pull request #29206 from ripcurld0/doc_api_update
Specify content type in the build request
2017-01-11 08:41:39 +01:00
Sebastiaan van Stijn
e5058ff15c Merge pull request #29947 from vdemeester/integration-some-runCommandWithOutput-clean
[test-integration] clean some runCommandWithOutput
2017-01-10 15:56:42 +01:00
Vincent Demeester
9c96768eae Merge pull request #29564 from aaronlehmann/getter-types
plugingetter: Avoid all caps for constant declarations
2017-01-10 09:35:19 +01:00
Boaz Shuster
b1996728aa Update docs and code to use application/x-tar in the build API
At the "Build image from Dockerfile" section in the API docs
the Content-Type header is missing.
In addition, some parts in the code are still setting the
Content-Type header to application/tar while it was changed
to application/x-tar since 16th September 2015.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-01-10 06:40:06 +02:00
Sebastiaan van Stijn
38f766ae0e Merge pull request #29143 from vdemeester/node-cli-unit-tests
Add some unit tests to the node and swarm cli code
2017-01-09 20:52:23 +01:00
Vincent Demeester
fe9f5610c4 Merge pull request #29953 from williammartin/truncindex-iterate-lock
Fix non thread-safe Iteration around go-patricia
2017-01-09 20:23:35 +01:00
Vincent Demeester
f151c297eb
Add some unit tests to the node and swarm cli code
Start work on adding unit tests to our cli code in order to have to
write less costly integration test.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-09 18:30:15 +01:00
William Martin
57dada5338 Fix non thread-safe Iteration around go-patricia
* Unlike other methods in truncindex, Iterate was not locking before
using the Trie, making it potentially race e.g. Delete could result in
setting a child to nil, while Iterate dereferenced that node
while walking the Trie.

Signed-off-by: Petar Petrov <pppepito86@gmail.com>
2017-01-09 17:06:50 +00:00
Vincent Demeester
303b1d200a
Update trustedCmd to be compatible with testutil/cmd
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-09 11:07:05 +01:00
Brian Goff
21fcbb39b7 Fix race accessing plugin storage map
`plugins.GetAll()` was not locking the plugin map when checking if a
plugin exists, this can cause a race and potentially a panic if another
goroutine is trying to load a plugin into the map at the same time.

Also fixes a race during activation where a plugin inserts itself into
the plugin map but does not check if something else is already there.
This is already checked before trying to activate the plugin, however
the map lock is not held for this entire period, so other plugins may be
loaded during this time.
To fix, before inserting the plugin into the map, check if one with the
same name already exists and use that instead.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-01-05 22:40:45 -05:00
lixiaobing10051267
6305817184 optimize Fatalf with the expectedError
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2017-01-05 14:47:36 +08:00
Aaron Lehmann
428600108c plugingetter: Avoid all caps for constant declarations
Go style calls for mixed caps instead of all caps:
https://golang.org/doc/effective_go.html#mixed-caps

Change LOOKUP, ACQUIRE, and RELEASE to Lookup, Acquire, and Release.

This vendors a fork of libnetwork for now, to deal with a cyclic
dependency issue. The change will be upstream to libnetwork once this is
merged.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-01-04 10:19:04 -08:00
Vincent Demeester
6129e6ce3e Merge pull request #29697 from yuexiao-wang/fix-docker-daemon
Update docker daemon to dockerd
2017-01-04 11:55:38 +01:00
Tibor Vass
48ed4f0639 Merge pull request #29733 from cpuguy83/fix_v1plugin_deadlock
Fix race/deadlock in v1 plugin handlers
2017-01-03 17:02:15 -08:00
Vincent Demeester
33968e6c7d
Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-30 18:26:34 +01:00