Compare commits

...
Author SHA1 Message Date
Andrew HsuandGitHub 33f00ce111 Merge pull request #76 from andrewhsu/v5
[18.05] bump version to 18.05.0-ce-rc1
2018-04-25 17:51:07 -07:00
Andrew HsuandGitHub e18e113d76 Merge pull request #72 from jose-bigio/18.05_changelog
[18.05] Update changelog
2018-04-25 17:50:39 -07:00
Andrew HsuandGitHub 1b9a860800 Merge pull request #73 from andrewhsu/c05
[18.05] vndr hcsshim to 79062a5
2018-04-25 17:48:54 -07:00
Andrew Hsu 138fd7c915 bump version to 18.05.0-ce-rc1
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-04-26 00:17:40 +00:00
jose-bigio 48cb74ae95 Delete traige section, and the delete section
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2018-04-25 14:49:08 -07:00
jose-bigio dc77be3599 Update changelog
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2018-04-25 14:31:47 -07:00
Andrew Hsu 5ffd319cce vndr hcsshim to 79062a5
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-04-25 21:30:40 +00:00
GordonTheTurtle ef7cd19696 Bump version to 18.05.0-ce-beta1
Signed-off-by: GordonTheTurtle <engine-team@docker.com>
2018-04-25 20:10:27 +00:00
GordonTheTurtle 2771210b85 Merge component 'engine' from git@github.com:moby/moby master 2018-04-25 17:06:30 +00:00
Sebastiaan van StijnandGitHub c1ef5d203f Merge pull request #36935 from cpuguy83/volume_tests_no_root
Fix issues with running volume tests as non-root.
Upstream-commit: 1a57535aa277e0f2a3c1922c736551148c5b4351
Component: engine
2018-04-25 00:45:14 +02:00
Anusha RagunathanandGitHub 153889840e Merge pull request #36599 from Microsoft/jjh/dockersave
LCOW: Implement `docker save`
Upstream-commit: 65c575f592a247b3dd0d10dd707f1bbf3d459ae1
Component: engine
2018-04-24 11:14:32 -07:00
GordonTheTurtle 605ac64b66 Merge component 'engine' from git@github.com:moby/moby master 2018-04-24 17:05:23 +00:00
GordonTheTurtle 137f840bfb Merge component 'cli' from git@github.com:docker/cli master 2018-04-24 16:41:18 +00:00
Sebastiaan van StijnandGitHub b6d97e109a Merge pull request #1022 from silvin-lubecki/clean-manifest-documentation
Cleaning some manifest documentation typos
Upstream-commit: 4970824bea
Component: cli
2018-04-24 17:07:14 +02:00
Brian Goff 9edbbd0436 Fix issues with running volume tests as non-root.
- Volume store created dir with wrong permissions
- Local volume driver hardcoded uid/gid 0

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d15734ec3c10eda667b716f67e18d5d86e708e3e
Component: engine
2018-04-24 10:26:10 -04:00
Silvin Lubecki e92b784d10 Cleaning some manifest documentation typos
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 55c5e7aa88
Component: cli
2018-04-24 15:00:39 +02:00
Sebastiaan van StijnandGitHub ca53f02db1 Merge pull request #36904 from kolyshkin/context
Switch from x/net/context -> context
Upstream-commit: 53683bd8326b988977650337ee43b281d2830076
Component: engine
2018-04-24 08:49:12 +02:00
Kir Kolyshkin e3af8e0774 Switch from x/net/context -> context
Since Go 1.7, context is a standard package. Since Go 1.9, everything
that is provided by "x/net/context" is a couple of type aliases to
types in "context".

Many vendored packages still use x/net/context, so vendor entry remains
for now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 7d62e40f7e4f3c17d229a7687d6fcca5448de813
Component: engine
2018-04-23 13:52:44 -07:00
Yong TangandGitHub 5a3297f67b Merge pull request #36913 from vdemeester/test-skip-non-root
Skip some tests requires root uid when run as user…
Upstream-commit: 5c233cf4315747785b27d4b0f0631d220556205f
Component: engine
2018-04-23 11:42:42 -07:00
Sebastiaan van StijnandGitHub 4521f88522 Merge pull request #36920 from kolyshkin/cancel-func
context.WithTimeout: do call the cancel func
Upstream-commit: 20b524bf2e91466e00cd5fadd87e9d49f8cb8cb3
Component: engine
2018-04-23 20:14:25 +02:00
Sebastiaan van StijnandGitHub fa72c71f39 Merge pull request #36927 from wdhif/patch-1
Fix version mismatch in API the documentation
Upstream-commit: 3dd4be9d8975557f84d0afe5edd90183fc092717
Component: engine
2018-04-23 19:40:57 +02:00
Wassim Dhif 3e4ba6ca0d Fix version mismatch in API documentation
Fix a version mismatch in the API documentation.

Signed-off-by: Wassim DHIF <wassimdhif@gmail.com>
Upstream-commit: 2058928edc284653b1fb8e719d713ac7edecd091
Component: engine
2018-04-23 18:57:35 +02:00
GordonTheTurtle 8b92797789 Merge component 'cli' from git@github.com:docker/cli master 2018-04-23 16:41:30 +00:00
Brian GoffandGitHub ecd0192857 Merge pull request #1020 from vdemeester/todo-tada
Handle some TODOs in tests 
Upstream-commit: c889ea1bca
Component: cli
2018-04-23 09:33:41 -04:00
Vincent Demeester 637cb9eba9 Remove more TODOs
- Some of them don't make sense anymore
- Some are deprecated and removed from the engine since a few versions
  already.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 740d260cd2
Component: cli
2018-04-23 14:57:29 +02:00
Vincent Demeester 4485bdeb14 Remote FIXME(s) in vendor.conf
It's coming from dependencies, doesn't make sense here

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 58173b3c69
Component: cli
2018-04-23 14:14:45 +02:00
Vincent Demeester afba3f7a60 Handle some TODOs in tests
Use more gotestyourself for `env.Patch`, and `icmd.RunCommand`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ae03dd7f46
Component: cli
2018-04-23 14:13:52 +02:00
SilvinandGitHub 32854cab39 Merge pull request #1011 from vdemeester/mark-test-helpers
Make testing helpers as such…
Upstream-commit: c790f387e1
Component: cli
2018-04-23 11:20:12 +02:00
Vincent Demeester 7f23cb8c8b Skip some tests requires root uid when run as user
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a7999aaa536818085ec8a23901ef64637587b7e4
Component: engine
2018-04-23 10:14:39 +02:00
Vincent Demeester 4a3d7068f3 Fix typo in idtools tests
It should check `os.Geteuid` with `uid` instead of `os.Getegid`.
On the container (where the tests run), the uid and gid seems to be
the same, thus this doesn't fail.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5d8b88b114da7c40f04a95909a35287ae1dac37f
Component: engine
2018-04-23 10:14:07 +02:00
GordonTheTurtle cc37c2e09b Merge component 'engine' from git@github.com:moby/moby master 2018-04-22 17:06:07 +00:00
Yong TangandGitHub 0be67a18e5 Merge pull request #36922 from yongtang/04212018-restart_test.go
Some improvement in restart_test.go
Upstream-commit: 57142e89befe90977da6dce7762f9fcc70f28da1
Component: engine
2018-04-22 09:34:14 -07:00
Yong Tang e52c8b0018 Some improvement in restart_test.go
This fix consists of some improvement in restart_test.go
by replacing Fatal with assert, so that they are consistent
with other tests in integration/container.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 67535921b32f68863f7a882d2300b59e0bbeffa4
Component: engine
2018-04-21 19:42:20 +00:00
GordonTheTurtle 9c80391a08 Merge component 'engine' from git@github.com:moby/moby master 2018-04-21 17:13:27 +00:00
Vincent DemeesterandGitHub 554b5427fa Merge pull request #36091 from kolyshkin/mount
pkg/mount improvements
Upstream-commit: 53982e3fc1642f2605189cea48bc6de7b9318611
Component: engine
2018-04-21 11:03:54 +02:00
Sebastiaan van StijnandGitHub 73e14f67f8 Merge pull request #36879 from cpuguy83/extra_unmount_check
Extra check before unmounting on shutdown
Upstream-commit: cf9c48bb3ecf47ed56a4b7b466eda577913f838e
Component: engine
2018-04-20 17:08:11 -07:00
Brian GoffandGitHub 97f152d2c1 Merge pull request #36912 from vdemeester/api-no-daemon-dep
Remove daemon dependency on api packages
Upstream-commit: c028b6d089ec21ae3c5e90e0a50740d71d18c739
Component: engine
2018-04-20 16:04:26 -04:00
Kir Kolyshkin d80d707e96 context.WithTimeout: do call the cancel func
govet complains (when using standard "context" package):

> the cancel function returned by context.WithTimeout should be called,
> not discarded, to avoid a context leak (vet)

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 05e2f7e2fafd0fbc818c9f4cda7ac513c785d49c
Component: engine
2018-04-20 12:27:13 -07:00
GordonTheTurtle 53bcb78f51 Merge component 'engine' from git@github.com:moby/moby master 2018-04-20 17:07:42 +00:00
GordonTheTurtle e812a9de38 Merge component 'cli' from git@github.com:docker/cli master 2018-04-20 16:41:35 +00:00
Vincent DemeesterandGitHub 07428d75bd Merge pull request #36888 from vdemeester/mark-test-helpers
Make testing helpers as such…
Upstream-commit: ba02880786b9924f251ea0785de168f45996e325
Component: engine
2018-04-20 17:00:17 +02:00
Vincent DemeesterandGitHub 5b320bf640 Merge pull request #36744 from kolyshkin/t-enospc
TestDaemonNoSpaceLeftOnDeviceError: simplify
Upstream-commit: 7d9cbfa96f7d43764eb44422ac0a848f96d0484d
Component: engine
2018-04-20 15:40:39 +02:00
Vincent DemeesterandGitHub 57e3475a77 Merge pull request #36492 from alejgh/36478-log-standardization
36478 storage-drivers log format standardization
Upstream-commit: c4ba5be6af4aa960d2f6d2071b2218cf0b62bb20
Component: engine
2018-04-20 12:11:14 +02:00
Vincent Demeester 3da083e7f4 Remove daemon dependency on api packages
We are using interface in the api routers to not explicitely depend on
the daemon struct (`daemon.Daemon`), but somehow, we do depend on the
`daemon` package for the cluster functionalities.

This removes this dependency by defining the correct interfaces.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f4106b46db47524b4f38abeee48137d42e3fe4eb
Component: engine
2018-04-20 11:06:40 +02:00
Vincent Demeester 695bc0d42c Make testing helpers as such…
That way, those lines won't be reported in the failure.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: cb8db44395df70fa3044d2a9683d6d24438cfa74
Component: engine
2018-04-20 10:38:43 +02:00
Sebastiaan van StijnandGitHub c27dd5c4ac Merge pull request #36887 from alexjomin/master
pkg/term add build tag for netbsd
Upstream-commit: d6706dddd5c40f47ecb529422446152039934a84
Component: engine
2018-04-19 19:41:36 -07:00
Brian GoffandGitHub 7b9de88fa5 Merge pull request #36896 from cpuguy83/move_mount_parsing
Move mount parsing to separate package.
Upstream-commit: a9bd60d674f85c2161bb702404b23501d6b746c3
Component: engine
2018-04-19 20:31:53 -04:00
Brian GoffandGitHub 625b8ccfec Merge pull request #36875 from vdemeester/integration-cli-some-fixme
[test/integration-cli] small cleanups of FIXME(s)
Upstream-commit: 4da83efdfbbbb8a69ae155fc1998cfbc7b070b1c
Component: engine
2018-04-19 20:31:27 -04:00
Kir Kolyshkin a1f451a285 volume/local/TestCreateWithOpts(): use mount filter
This is not for the sake of test to run faster of course;
this is to simplify the code as well as have some more
testing for mount.SingleEntryFilter().

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: ce468f0ad0d075c5d0c44c78bd61c489e6d7d70c
Component: engine
2018-04-19 14:50:03 -07:00
Kir Kolyshkin c2010a1d29 volume/local: call umount unconditionally
There is no need to parse mount table and iterate through the list of
mounts, and then call Unmount() which again parses the mount table and
iterates through the list of mounts.

It is totally OK to call Unmount() unconditionally.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: ac39a95ea618601f78662972c35838d928858904
Component: engine
2018-04-19 14:49:54 -07:00
Kir Kolyshkin f00e9a9036 mount.Unmount(): don't look into /proc/self/mountinfo
Now, every Unmount() call takes a burden to parse the whole nine yards
of /proc/self/mountinfo to figure out whether the given mount point is
mounted or not (and returns an error in case parsing fails somehow).

Instead, let's just call umount() and ignore EINVAL, which results
in the same behavior, but much better performance.

Note that EINVAL is returned from umount(2) not only in the case when
`target` is not mounted, but also for invalid flags. As the flags are
hardcoded here, it can't be the case.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: a1d095199ddb9b4811e1417b6adcdfadad7d73f4
Component: engine
2018-04-19 14:49:50 -07:00
Kir Kolyshkin 96e23c4152 pkg/mount/mountinfo_linux: parser speed up
The mountinfo parser implemented via `fmt.Sscanf()` is slower than the one
using `strings.Split()` and `strconv.Atoi()`. This rewrite helps to speed it
up to a factor of 8x, here is a result from go bench:

> BenchmarkParsingScanf-4      	     300	  22294112 ns/op
> BenchmarkParsingSplit-4      	    3000	   2780703 ns/op

I tried other approaches, such as using `fmt.Sscanf()` for the first
three (integer) fields and `strings.Split()` for the rest, but it slows
things down considerably:

> BenchmarkParsingMixed-4      	    1000	   8827058 ns/op

Note the old code uses `fmt.Sscanf`, when a linear search for '-' field,
when a split for the last 3 fields. The new code relies on a single
split.

I have also added more comments to aid in future development.

Finally, the test data is fixed to now have white space before the first field.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: c611f18a7f16d8aa878a5a5c7537d23a0937c40a
Component: engine
2018-04-19 14:49:42 -07:00
Kir Kolyshkin cd146e5f0d getSourceMount(): simplify
The flow of getSourceMount was:
 1 get all entries from /proc/self/mountinfo
 2 do a linear search for the `source` directory
 3 if found, return its data
 4 get the parent directory of `source`, goto 2

The repeated linear search through the whole mountinfo (which can have
thousands of records) is inefficient. Instead, let's just

 1 collect all the relevant records (only those mount points
   that can be a parent of `source`)
 2 find the record with the longest mountpath, return its data

This was tested manually with something like

```go
func TestGetSourceMount(t *testing.T) {
	mnt, flags, err := getSourceMount("/sys/devices/msr/")
	assert.NoError(t, err)
	t.Logf("mnt: %v, flags: %v", mnt, flags)
}
```

...but it relies on having a specific mount points on the system
being used for testing.

[v2: add unit tests for ParentsFilter]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 871c957242df9f8c74faf751a2f14eb5178d4140
Component: engine
2018-04-19 14:49:17 -07:00
Kir Kolyshkin 7e50bdbeb9 daemon.cleanupMounts(): use mount.SingleEntryFilter
Use mount.SingleEntryFilter as we're only interested in a single entry.

Test case data of TestShouldUnmountRoot is modified accordingly, as
from now on:

1. `info` can't be nil;

2. the mountpoint check is not performed (as SingleEntryFilter
   guarantees it to be equal to daemon.root).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: d3ebcde82aae79be8cbecab365367b17adac4b3e
Component: engine
2018-04-19 14:48:25 -07:00
Kir Kolyshkin a97e7a41c8 pkg/mount: implement/use filter for mountinfo parsing
Functions `GetMounts()` and `parseMountTable()` return all the entries
as read and parsed from /proc/self/mountinfo. In many cases the caller
is only interested only one or a few entries, not all of them.

One good example is `Mounted()` function, which looks for a specific
entry only. Another example is `RecursiveUnmount()` which is only
interested in mount under a specific path.

This commit adds `filter` argument to `GetMounts()` to implement
two things:
 1. filter out entries a caller is not interested in
 2. stop processing if a caller is found what it wanted

`nil` can be passed to get a backward-compatible behavior, i.e. return
all the entries.

A few filters are implemented:
 - `PrefixFilter`: filters out all entries not under `prefix`
 - `SingleEntryFilter`: looks for a specific entry

Finally, `Mounted()` is modified to use `SingleEntryFilter()`, and
`RecursiveUnmount()` is using `PrefixFilter()`.

Unit tests are added to check filters are working.

[v2: ditch NoFilter, use nil]
[v3: ditch GetMountsFiltered()]
[v4: add unit test for filters]
[v5: switch to gotestyourself]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: bb934c6aca3e77541dd4fd51b9ab2706294dadda
Component: engine
2018-04-19 14:48:09 -07:00
Brian GoffandGitHub 6099e61dfc Merge pull request #36886 from vdemeester/experimental-plugins-migration
Migrate test-integration-cli experimental plugin tests to integration
Upstream-commit: e396b27b7f207f4f0da9ed66d70a69b219bbafaf
Component: engine
2018-04-19 16:13:05 -04:00
Brian Goff 3f0393a442 Move mount parsing to separate package.
This moves the platform specific stuff in a separate package and keeps
the `volume` package and the defined interfaces light to import.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 6a70fd222b95643a8a6b88e2634d5f085ae4122a
Component: engine
2018-04-19 06:35:54 -04:00
Vincent Demeester 8348a70a7d Migrate test-integration-cli experimental plugin tests to integration
All `plugins` tests that require an `ExperimentalDaemon` are migrated
to `integration/plugin/*` and start an experimental daemon to test on
it.

The end goal being to remove the `experimental` build.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 69bab3832ce1d72dd1d3ed2f2b53143ec9ff102c
Component: engine
2018-04-19 11:57:28 +02:00
Vincent DemeesterandGitHub f766069f3c Merge pull request #36684 from cpuguy83/bump_containerd_client
Bump containerd client
Upstream-commit: 8bb5a28eed5eba5651c6e48eb401c03be938b4c1
Component: engine
2018-04-19 10:38:43 +02:00
Sebastiaan van StijnandGitHub 1a74ffcae2 Merge pull request #36865 from vdemeester/integration-move-swarm-plugin-test
Migrate TestAPISwarmServicesPlugin to integration
Upstream-commit: f1783da7361ab3dc985df12446357e6c4c9ef388
Component: engine
2018-04-18 21:15:59 -07:00
Sebastiaan van StijnandGitHub 21ab0afd1a Merge pull request #36894 from cpuguy83/bump_x_net
Bump golang.org/x/net to go1.10 release commit
Upstream-commit: f0b2f9362fbd6be58404b9d6bc3de53c6bc884e9
Component: engine
2018-04-18 18:04:51 -07:00
Brian Goff 068e200711 Extra check before unmounting on shutdown
This makes sure that if the daemon root was already a self-binded mount
(thus meaning the daemonc only performed a remount) that the daemon does
not try to unmount.

Example:

```
$ sudo mount --bind /var/lib/docker /var/lib/docker
$ sudo dockerd &
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c403f0036b9945bd58a84e2c93f794ed9861fe99
Component: engine
2018-04-18 20:43:42 -04:00
Sebastiaan van StijnandGitHub 5eb096d4f8 Merge pull request #36848 from cpuguy83/libcontainerd_client_locking
Relax some libcontainerd client locking
Upstream-commit: 69a5611dde5b46785c8f071a744f5b4b7547d5b9
Component: engine
2018-04-18 16:47:23 -07:00
Sebastiaan van StijnandGitHub 4e1a92ff17 Merge pull request #1013 from thaJeztah/update-authors
Update AUTHORS and mailmap
Upstream-commit: 6c9232a568
Component: cli
2018-04-18 13:46:30 -07:00
Brian GoffandGitHub 4d4ddfe510 Merge pull request #1012 from thaJeztah/add-silvin-maintainer
Add Silvin as maintainer
Upstream-commit: 01778ee9d5
Component: cli
2018-04-18 16:35:40 -04:00
Brian GoffandGitHub 320288f128 Merge pull request #36637 from cpuguy83/no_global_driver_store
No global volume driver store
Upstream-commit: 6cd806aa53de41e6f04346150d08e19ec63311e0
Component: engine
2018-04-18 16:32:23 -04:00
Sebastiaan van Stijn 05bd043eba Update AUTHORS and mailmap
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a761eff8c5
Component: cli
2018-04-18 13:31:07 -07:00
Sebastiaan van Stijn a013bf96ca Add Silvin as maintainer
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 60b371506c
Component: cli
2018-04-18 13:21:33 -07:00
Brian Goff c5fc4e9f5a Bump golang.org/x/net to go1.10 release commit
The primary need for this is x/net/context now is just a type alias to
the stdlib context package.
This makes issues with conflicts between "golang.org/x/net/context" and
the stdib "context" go away (primarily a concern in interface
definitions/implementations).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 848ef1da8b0d1c01a84fbe215f24f00fa741690d
Component: engine
2018-04-18 15:57:24 -04:00
GordonTheTurtle 4d42b1eabb Merge component 'engine' from git@github.com:moby/moby master 2018-04-18 17:05:51 +00:00
Vincent DemeesterandGitHub de82b21350 Merge pull request #1004 from albers/completion--template-driver
Add bash completion for `secret|config create --template-driver`
Upstream-commit: 0685bb29db
Component: cli
2018-04-18 19:04:29 +02:00
GordonTheTurtle c3b2dee6b3 Merge component 'cli' from git@github.com:docker/cli master 2018-04-18 16:41:26 +00:00
Vincent Demeester 9bd536589d Make testing helpers as such…
That way, those lines won't be reported in the failure.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: b29844f8ca
Component: cli
2018-04-18 17:02:21 +02:00
Vincent Demeester f40401e83b Remove daemon.BuildImageWithOut and use cli helpers function
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5d2afe4f51edc4c8393c4cbee7b478f7dc1e88ab
Component: engine
2018-04-18 16:45:55 +02:00
Vincent Demeester a6beebd548 Migrate TestAPISwarmServicesPlugin to integration
Also starts to create more "poll/check" function to `internal/test/daemon`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: aa0db6f9e1d0fd0420271f419d0d225089a95bbd
Component: engine
2018-04-18 16:18:53 +02:00
Vincent Demeester 917c353f43 Add a Cleanup function that cleans exec root and swarm files
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3b01e92c9a34036b891853402888dcf461836ef8
Component: engine
2018-04-18 16:14:50 +02:00
Vincent DemeesterandGitHub a90ad7bf98 Merge pull request #36832 from vdemeester/integration-daemon-api-helpers
More integration-cli/integration refactoring + request package
Upstream-commit: 25ff68a80f315a5e0a4526cc15a1ece83843ae2b
Component: engine
2018-04-18 16:12:14 +02:00
Alexandre Jomin f6b5cf688c pkg/term add build tag for netbsd
Signed-off-by: Alexandre Jomin <alexandrejomin@gmail.com>
Upstream-commit: 0d82bc142c2448c09b567773867344aa8fc172fb
Component: engine
2018-04-18 15:16:06 +02:00
Brian GoffandGitHub a1bdeeb8dc Merge pull request #36858 from j-haj/36414-standardize_build_paths
Standardize artefact path for all build stages
Upstream-commit: 4923f8cc639e1ab01a251429495920e516ef779f
Component: engine
2018-04-18 06:58:38 -04:00
Akihiro SudaandGitHub 6f9cc3826f Merge pull request #36880 from thaJeztah/bump-swarmkit
Bump SwarmKit to 9c2aa152c3054371b833483a7ddad8d15052ec4f
Upstream-commit: 5dae4828f3248d7f442c53165aa0628020c6b74e
Component: engine
2018-04-18 19:10:55 +09:00
Sebastiaan van StijnandGitHub 10b6953e20 Merge pull request #1008 from n4ss/revert-unencrypted-prompt
Revert unencryted storage warning prompt
Upstream-commit: 8618838bdb
Component: cli
2018-04-18 00:01:13 -07:00
Sebastiaan van Stijn c48e2f3808 Bump SwarmKit to 9c2aa152c3054371b833483a7ddad8d15052ec4f
Relevant changes:

- docker/swarmkit#2551 RoleManager will remove deleted nodes from the cluster membership
- docker/swarmkit#2574 Scheduler/TaskReaper: handle unassigned tasks marked for shutdown
- docker/swarmkit#2561 Avoid predefined error log
- docker/swarmkit#2557 Task reaper should delete tasks with removed slots that were not yet assigned
- docker/swarmkit#2587 [fips] Agent reports FIPS status
- docker/swarmkit#2603 Fix manager/state/store.timedMutex

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 333b2f28fef4ba857905e7263e7b9bbbf7c522fc
Component: engine
2018-04-17 13:44:49 -07:00
Brian Goff 856b3acadf Remove use of global volume driver store
Instead of using a global store for volume drivers, scope the driver
store to the caller (e.g. the volume store). This makes testing much
simpler.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 977109d808ae94eb3931ae920338b1aa669f627e
Component: engine
2018-04-17 14:07:08 -04:00
Brian Goff e2550466e7 Rename volumedrivers package to drivers
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b047f675ea958fa730f4bf56f909faceb9636506
Component: engine
2018-04-17 14:06:53 -04:00
Brian Goff 8f56510165 Remove old/uneeded volume migration from vers 1.7
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 0023abbad34282762d5bd17302776d2a8521fffc
Component: engine
2018-04-17 14:06:53 -04:00
Brian Goff 27a6dfb147 Move direct volume driver interaction to store
Since the volume store already provides this functionality, we should
just use it rather than duplicating it.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 63826e291ba3b88443b64802084bbb3931857b56
Component: engine
2018-04-17 14:06:53 -04:00
Sebastiaan van StijnandGitHub f1112e0539 Merge pull request #999 from perlun/patch-1
build.md: Document --build-arg without value
Upstream-commit: 771ccaf4ed
Component: cli
2018-04-17 10:39:20 -07:00
Brian Goff c9ce394894 Relax global client lock on containerd restore.
This unblocks the client to take other restore requests and makes sure
that a long/stuck request can't block the client forever.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 806700e410a1b30aa1033d71d825e57880c75298
Component: engine
2018-04-17 12:07:06 -04:00
Vincent Demeester a05c5e914a Move integration-cli/request to internal/test/request…
… and change a bit the method signature

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 42f6fdf059807ecbe66cce90676021363a541154
Component: engine
2018-04-17 16:25:59 +02:00
Vincent Demeester 3d6d872b1c Add api helpers to internal/test/daemon.Daemon
Porting helpers from `integration-cli/daemon.Daemon` to this struct
and use the API instead of the cli.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 9722214c8add2a83f6c4974848139cadc79d9f0e
Component: engine
2018-04-17 16:24:31 +02:00
Vincent DemeesterandGitHub e20647387e Merge pull request #36868 from vdemeester/integration-move-fake-internal
Move fakecontext, fakegit and fakestorage to internal/test
Upstream-commit: 648ae4979e5a44fd046c292b48a02725a16f9304
Component: engine
2018-04-17 16:23:22 +02:00
Jeff Hajewski f4e6667402 Standardize artefact path for all build stages
Update all build stages to output artefacts to /build

Signed-off-by: Jeff Hajewski <jeff.hajewski@gmail.com>
Upstream-commit: 00555f7b261111084b966920da607a504b068953
Component: engine
2018-04-17 09:08:25 -05:00
Vincent DemeesterandGitHub 1805ce9e0e Merge pull request #1007 from HenryNe/patch-1
docs: Typofix in example "docker image ls"
Upstream-commit: f3bf6928da
Component: cli
2018-04-17 10:10:19 +02:00
Vincent Demeester a425bbca33 Move fakecontext, fakegit and fakestorage to internal/test
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 062564084a22f71cf5807ae5dfad7d29afb12e04
Component: engine
2018-04-17 09:53:09 +02:00
Sebastiaan van StijnandGitHub b77fed9a5f Merge pull request #36866 from fntlnz/poule-assign-pr-fntlnz
Add myself to poule to get 2w/old PRs
Upstream-commit: 13771fede318028d67e5d521bb97bcb54a4aaec5
Component: engine
2018-04-16 18:32:32 -07:00
Anusha RagunathanandGitHub f4b8a312a4 Merge pull request #36841 from yongtang/02222018-tag-test
Migrate image tag tests from integration-cli to api tests
Upstream-commit: abb1661907fa5e831872a7f99f1af2dcc88724bf
Component: engine
2018-04-16 17:53:48 -07:00
Anusha RagunathanandGitHub 84f41cfc7e Merge pull request #36838 from vdemeester/integration-fixtures-refactoring
Clean some integration-cli/fixtures package/files
Upstream-commit: f9c4e630269be438cddfe843c727c21c3343f1c2
Component: engine
2018-04-16 17:49:29 -07:00
Anusha RagunathanandGitHub 9c85effe88 Merge pull request #36854 from vdemeester/integration-swarm-more-in-internal
[test/integration] Small daemon refactoring and add swarm init/join helpers
Upstream-commit: c65d365eb3f98df7b10ac07b919ebaa1e4b75212
Component: engine
2018-04-16 12:49:49 -07:00
Nassim 'Nass' Eddequiouaq 46a62eba1d Revert unencryted storage warning prompt
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
Upstream-commit: 3acf5d2e47
Component: cli
2018-04-16 12:48:03 -07:00
GordonTheTurtle d87b0c1878 Merge component 'engine' from git@github.com:moby/moby master 2018-04-16 17:06:40 +00:00
Lorenzo Fontana e26e074b4e Add myself to poule to get 2w/old PRs
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Upstream-commit: 691e0c06cef55a455d72a4d1ec9dc4d072cf5e3b
Component: engine
2018-04-16 18:33:21 +02:00
Henry N 8037d00abb docker load: Typofix in examples
Remove the double "docker docker" from example

Signed-off-by: Henry Ne <henrynmail-github@yahoo.de>
Upstream-commit: 79c489d812
Component: cli
2018-04-16 16:39:54 +02:00
Vincent Demeester c2c6cea1b0 Clean some integration-cli/fixtures package/files
- Move go package used by both `integration-cli` and `integration` to
  `internal/test/fixtures`.
- Remove fixtures that are not used anymore (moved to `docker/cli` a
  while ago) : deploy, notary, secrets.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5f56503f583f21d655394f755f71849381bd58c7
Component: engine
2018-04-16 10:48:58 +02:00
Vincent Demeester bd6e299583 Small daemon refactoring and add swarm init/join helpers
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 239a8a518904dfb51fe62087d8702519c20ce808
Component: engine
2018-04-16 10:20:10 +02:00
Per Lundberg e4e0816835 build.md: Document --build-arg without value
This use case is currently _working correctly_, which is nice, but there is no documentation to be found about it. This PR fixes that.

Signed-off-by: Per Lundberg <perlun@gmail.com>
Upstream-commit: 82c23208ee
Component: cli
2018-04-16 07:52:13 +03:00
Yong TangandGitHub 1b1d5ffe90 Merge pull request #36862 from yongtang/04152018-container.Create
Some enhancement in integration tests
Upstream-commit: ea579a6194525ce3b98eba04f74de19a106bf918
Component: engine
2018-04-15 09:12:52 -07:00
GordonTheTurtle adaf9083e8 Merge component 'engine' from git@github.com:moby/moby master 2018-04-14 17:06:13 +00:00
Yong TangandGitHub fe0deb4aa6 Merge pull request #36738 from Microsoft/jjh/getlayerpath
Windows: Add GetLayerPath implementation in graphdriver
Upstream-commit: 5c2e6064a1c5cb816081958e5a7079bc6b474940
Component: engine
2018-04-14 09:59:38 -07:00
Yong Tang 691aeed45e Some enhancement in integration tests
This fix converts some `client.ContainerCreate` to `container.Create`,
and removes some unneeded `name` fields when test containers are created.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ab9bb47b05b1dde445a5e4ba78ae97303208dc8b
Component: engine
2018-04-14 16:52:02 +00:00
GordonTheTurtle c4b7e9df27 Merge component 'cli' from git@github.com:docker/cli master 2018-04-14 16:41:31 +00:00
Harald Albers cf1baa9f3c Add bash completion for secret|config create --template-driver
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 43024e2d57
Component: cli
2018-04-14 14:46:19 +02:00
Sebastiaan van StijnandGitHub a95dfe42a3 Merge pull request #970 from cowlinator/temp2
Clarify --build-arg documentation
Upstream-commit: e5980c541a
Component: cli
2018-04-13 18:54:16 -07:00
Tibor VassandGitHub 566b2857cf Merge pull request #35739 from thaJeztah/bump-go-1.10
Bump Golang to 1.10.1
Upstream-commit: 61138fb5fc0f5fc1799cabfa86d28fb88a0f472c
Component: engine
2018-04-13 13:56:38 -10:00
Tibor VassandGitHub 944c468f43 Merge pull request #963 from thaJeztah/fix-stack-deploy-after-force
Fix stack deploy re-deploying service after --force
Upstream-commit: 6b31ea0f0d
Component: cli
2018-04-13 13:06:40 -10:00
Sebastiaan van StijnandGitHub fce8015aac Merge pull request #36845 from medakk/refactor-daemon
Refactor code in cmd/dockerd/daemon.go
Upstream-commit: 3881f1a5219ba5d0a1ed54121ba20cd1700fec52
Component: engine
2018-04-13 15:26:48 -07:00
Sebastiaan van StijnandGitHub 6f1e5f20ef Merge pull request #36839 from vdemeester/integration-registry-refactoring
Move and refactor integration-cli/registry to internal/test
Upstream-commit: a9f502d04b5a493904a24c173fa3d6d6b17ad740
Component: engine
2018-04-13 15:02:53 -07:00
GordonTheTurtle f66a44c5e1 Merge component 'engine' from git@github.com:moby/moby master 2018-04-13 17:06:24 +00:00
Yong Tang 10abb9454f Migrate image tag tests from integration-cli to api tests
This fix migrates image tag tests from integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9bcb960508a6066811cffcca1e35ca44d7f1cf94
Component: engine
2018-04-13 14:46:40 +00:00
Vincent Demeester af04bf6300 Move and refactor integration-cli/registry to internal/test
- Move the code from `integration-cli` to `internal/test`.
- Use `testingT` and `assert` when creating the registry.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 66de2e6e3b6d927a3396743cd7c363aa9f7b776e
Component: engine
2018-04-13 10:45:34 +02:00
Akihiro SudaandGitHub 1fe7cf068a Merge pull request #36840 from cpuguy83/bump_libnetwork
Bump libnetwork commit
Upstream-commit: 544ec0994f3979314b0c3a892a4e352145d0cc0b
Component: engine
2018-04-13 13:54:52 +09:00
Anusha RagunathanandGitHub 21cd6af613 Merge pull request #36778 from odg0318/master
Using authorization plugin, I changed Content-Type check routine.
Upstream-commit: ff6a103067dec1eec6de023ec813355c419246f6
Component: engine
2018-04-12 17:39:38 -07:00
Anusha RagunathanandGitHub 32a14263cf Merge pull request #35831 from anusha-ragunathan/splunk_partial
Improve partial message support in logger
Upstream-commit: 9689059b5636f23d77cc3ac29ee41c6fabff81ec
Component: engine
2018-04-12 17:38:27 -07:00
Sebastiaan van StijnandGitHub 97ccb57a9f Merge pull request #36727 from tiborvass/fix-master-ci-gitcommit
ci: quote bash variable
Upstream-commit: f238bfda902d8193dd2d33bb334cd2419ffa5578
Component: engine
2018-04-12 14:06:22 -07:00
John StephensandSebastiaan van Stijn 3d3a3ad156 hack/make.ps1: fix Validate-PkgImports
In Go 1.10.1, the Deps for pkg\tarsum\tarsum_test.go are empty ([]) and
the PowerShell script ends up setting its import list to a string value
of False instead of an empty array. This can be remedied by forcing the
result to be an array, by concatenating to an empty array (@() + ...)

Signed-off-by: John Stephens <johnstep@docker.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit ec3f9230d70506c536a24e844da0f0b3af9b43f6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ee508d47c3917b423b6caae0ad2867c4f6ffe696
Component: engine
2018-04-12 13:37:10 -07:00
Kir KolyshkinandSebastiaan van Stijn ea19201d03 archive/tar: vendor again
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 7b30fd0e1d8bc77f0556181c82f85d046b058f27)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 66720189e04d50ef06c12d1ffbbfebf41caa2ae3
Component: engine
2018-04-12 13:36:58 -07:00
Derek McGowanandSebastiaan van Stijn c7b8d02f5e Update logger adapter test to avoid race
Add synchronization around adding logs to a plugin
and reading those logs. Without the follow configuration,
a race occurs between go routines to add the logs into
the plugin and read the logs out of the plugin. This
adds a function to synchronize the action to avoid the
race.
Removes use of file for buffering, instead buffering whole
messages so log count can be checked discretely.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c208f1c8a8d57f9a7f48f63345e77146774aa7a6
Component: engine
2018-04-12 13:35:15 -07:00
Derek McGowanandSebastiaan van Stijn 869a49d9be Set format in archiver
Prevent changing the tar output by setting the format to
PAX and keeping the times truncated.
Without this change the archiver will produce different tar
archives with different hashes with go 1.10.
The addition of the access and changetime timestamps would
also cause diff comparisons to fail.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fb170206ba12752214630b269a40ac7be6115ed4
Component: engine
2018-04-12 13:34:33 -07:00
Derek McGowanandSebastiaan van Stijn 49ee24ad6b Fix tarsum for go 1.10
Remove invalid flush commands, flush should only occur when file
has been completely written. This is already handle, remove these calls.
Ensure data gets written after EOF in correct order and before close.
Remove gname and uname from sum for hash compatibility.
Update tarsum tests for gname/uname removal.
Return valid length after eof.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a422774e593b33bd287d9890544ad9e09b380d8c
Component: engine
2018-04-12 13:34:14 -07:00
Sebastiaan van Stijn f2f6aa148e Remove patched "archive/tar" package
This fix is now upstream in Go 1.10

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 950a1aa3170cedabd904cdcfcfa70c7d551a5e16
Component: engine
2018-04-12 13:33:33 -07:00
Sebastiaan van Stijn 91c1ef0fbf Bump Golang to 1.10.1, alpine 3.7
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: be8885525c4d1ef4a13bbd6396f60e8657bc5573
Component: engine
2018-04-12 13:30:01 -07:00
Karthik Karanth ee6e3cbd82 Refactor code in cmd/dockerd/daemon.go
Signed-off-by: Karthik Karanth <karanth.karthik@gmail.com>
Upstream-commit: 05346355dbd4300a21bfd64cda93ea6c5aef0cf0
Component: engine
2018-04-13 00:14:20 +05:30
Brian GoffandGitHub a9398df305 Merge pull request #36595 from runcom/oom-docker-cp-authz
copy: avoid using all system memory with authz plugins
Upstream-commit: 76e47a08c5bb52b4a6ac95d2f90888c0e50bb85b
Component: engine
2018-04-12 13:42:56 -04:00
GordonTheTurtle 7f57a9f17c Merge component 'engine' from git@github.com:moby/moby master 2018-04-12 17:06:18 +00:00
GordonTheTurtle 21c1019add Merge component 'cli' from git@github.com:docker/cli master 2018-04-12 16:41:30 +00:00
Brian Goff 2047b759b0 Bump libnetwork commit
Full diff
https://github.com/docker/libnetwork/compare/5c1218c956c99f3365711974e300087810c31379...c15b372ef22125880d378167dde44f4b134e1a77

Fixes a panic on concurrent read/write to a map.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 248aed5766ba330ab8cb2b10b03b6ce57dc64283
Component: engine
2018-04-12 12:07:53 -04:00
Justin CormackandGitHub 21bd6f1766 Merge pull request #997 from justincormack/notaryup
Update Notary vendor to 0.6.1
Upstream-commit: 2ce3dc13da
Component: cli
2018-04-12 10:54:50 +01:00
Sebastiaan van StijnandGitHub 0166969766 Merge pull request #988 from anusha-ragunathan/plugin_doc
Update examples to reflect docker-runc's runtime root for plugins.
Upstream-commit: 3d0fc8d309
Component: cli
2018-04-11 21:32:02 -07:00
Sebastiaan van StijnandGitHub 0a52018901 Merge pull request #36722 from vdemeester/network-ipvlan-test-migration
Migrate test-integration-cli experimental ipvlan test to integration 
Upstream-commit: 6f4bf5629cf030ee9c941534847effdcbdae9790
Component: engine
2018-04-11 14:51:25 -07:00
Anusha Ragunathan e844cef5f8 Improve partial message support in logger
Docker daemon has a 16K buffer for log messages. If a message length
exceeds 16K, it should be split by the logger and merged at the
endpoint.

This change adds `PartialLogMetaData` struct for enhanced partial support
- LastPartial (bool) : indicates if this is the last of all partials.
- ID (string)        : unique 32 bit ID. ID is same across all partials.
- Ordinal (int starts at 1) : indicates the position of msg in the series of partials.
Also, the timestamps across partials in the same.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
Upstream-commit: 0b4b0a7b5d5de8cb575b666312fceaa2cd58e658
Component: engine
2018-04-11 13:26:28 -07:00
Brian Goff ad813c4199 Limit authz response buffer
When the authz response buffer limit is hit, perform a flush.
This prevents excessive buffer sizes, especially on large responses
(e.g. `/containers/<id>/archive` or `/containers/<id>/export`).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 74f8e47352e71aad4015d8d9dea8f16e7a055863
Component: engine
2018-04-11 15:36:36 -04:00
GordonTheTurtle 82e4a36355 Merge component 'engine' from git@github.com:moby/moby master 2018-04-11 17:06:31 +00:00
GordonTheTurtle 62463a5bcb Merge component 'cli' from git@github.com:docker/cli master 2018-04-11 16:41:31 +00:00
Sebastiaan van StijnandGitHub 975c16f6d2 Merge pull request #36826 from vdemeester/integration-daemon-swarm-refactoring
Make internal/test/daemon.Daemon swarm aware
Upstream-commit: ce3c2e23315a8745dca792a39aa496d9b33689ea
Component: engine
2018-04-11 09:33:58 -07:00
Justin Cormack 6ed9fc6e5c Remove testify dependency as not used any more
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 322adc8a54
Component: cli
2018-04-11 14:14:57 +01:00
Justin Cormack ac4eb0950b Update Notary vendor to 0.6.1
Minor update.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 8812c54a4d
Component: cli
2018-04-11 14:10:52 +01:00
Yong TangandGitHub 48d909a965 Merge pull request #36827 from AntaresS/remove-retry
remove the retries for service update
Upstream-commit: 5680ccd4abcc38abe4c4bbaf72656fdf0f236ddd
Component: engine
2018-04-11 06:06:05 -07:00
Vincent DemeesterandGitHub dc8e81cea5 Merge pull request #35518 from cyphar/libdm-dlsym-deferred_remove
pkg: devmapper: dynamically load dm_task_deferred_remove
Upstream-commit: 5219725890816a62185b6c7c0f022351e7aaee84
Component: engine
2018-04-11 14:11:16 +02:00
Vincent Demeester 4059b74760 Make internal/test/daemon.Daemon swarm aware
This remove the daemon.Swarm construction by make the new test Daemon
struct aware of swarm.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 83d18cf4e3e84055f7034816eed2a10c04e777ca
Component: engine
2018-04-11 12:10:17 +02:00
Vincent Demeester bb59f6dc6e Move ipvlan and macvlan tests on their own folder…
… making each folder/suites quicker to run

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a3323d2e4349b7e8d449c6e571ca3d4aa3e53d63
Component: engine
2018-04-11 11:14:58 +02:00
Vincent Demeester c2ef763ca9 Refactor macvlan tests a bit
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0ab6116ce868a0fc671a49a89696e3a1ce35e26d
Component: engine
2018-04-11 11:14:54 +02:00
Vincent Demeester 2c7fcaadfb Migrate test-integration-cli experimental ipvlan test to integration
All `Ipvlan` related test on `DockerSuite` and `DockerNetworkSuite`
are migrated to `ipvlan_test.go`.

The end goal being to remove the `experimental` builds.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 24f934751120ea420b7ba4d2e314df805f3eff06
Component: engine
2018-04-11 11:14:47 +02:00
Vincent DemeesterandGitHub 1a3ab779c5 Merge pull request #36768 from crosbymichael/booo
Don't make container mount unbindable
Upstream-commit: 59d56084347bae27c72752e31f910a266638fe23
Component: engine
2018-04-11 09:54:44 +02:00
Sebastiaan van StijnandGitHub 6aec02bb4f Merge pull request #994 from silvin-lubecki/fix-gometalinter
Fixed gometalinter errors on test files
Upstream-commit: 8e1cd515ba
Component: cli
2018-04-10 18:49:42 -07:00
Anda Xu 59714fb174 remove the retries for service update
Signed-off-by: Anda Xu <anda.xu@docker.com>
Upstream-commit: 7380935331f0c35315003578258f6c1f47c1a586
Component: engine
2018-04-10 17:17:02 -07:00
Michael Crosby c4fdce16ba Don't make container mount unbindable
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 4c000662feb3c8e3d63cbcb044a47f627cd9bb45
Component: engine
2018-04-10 15:14:34 -04:00
GordonTheTurtle e58320e94a Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-04-10 17:06:52 +00:00
Sebastiaan van StijnandGitHub 1f461d4e5c Merge pull request #36824 from vdemeester/integration-daemon-refactoring
Move integration-cli daemon package to internal/test…
Upstream-commit: 68dd184c7c7201030f52c39e55bee170df365d60
Component: engine
2018-04-10 10:06:09 -07:00
GordonTheTurtle d1f6615693 Merge component 'cli' from git@github.com:docker/cli master 2018-04-10 16:41:33 +00:00
Eli UriegasandGitHub f71c487025 Merge pull request #96 from utzb/master
use seccomp for xenial
Upstream-commit: c216602d16cfefdb175cdb902038789b00dd2cef
Component: packaging
2018-04-10 09:31:15 -07:00
Vincent Demeester baa55da752 Move integration-cli daemon package to internal/test…
… and do not use the `docker` cli in it. One of the reason of this
move is to not make `integration` package using legacy
`integration-cli` package.

Next move will be to support swarm within this package *and* provide
some helper function using the api (compared to the one using cli in
`integration-cli/daemon` package).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f0d277fe84a72b29c0d2d541c20d5a9c4d7e4884
Component: engine
2018-04-10 16:29:48 +02:00
Silvin Lubecki 37bdc4a0ae Fixed gometalinter errors on test files
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 54f8ca6660
Component: cli
2018-04-10 16:03:56 +02:00
Vincent DemeesterandGitHub 4a24bb90a9 Merge pull request #992 from thaJeztah/bump-version-18.05
Bump version to 18.05.0-dev
Upstream-commit: 16eee1dcdc
Component: cli
2018-04-10 11:49:01 +02:00
Andrew HsuandGitHub 0657b91bfc Merge pull request #103 from thaJeztah/bump-golang-1.9.5
Bump Golang to 1.9.5
Upstream-commit: f169b1e43aa26020a6a2a2e09ca3d35371b6c50c
Component: packaging
2018-04-09 15:20:59 -07:00
Eli UriegasandGitHub 70744081df Merge pull request #102 from seemethere/arm64_buster
Add aarch64 builder for debian-buster
Upstream-commit: 54456bf1ef88a6698744e035d3655c8bcfd8e410
Component: packaging
2018-04-09 15:11:10 -07:00
Sebastiaan van Stijn 87af25ac9e Bump version to 18.05.0-dev
Docker 18.04.0 branch was cut from e6e47d95b5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 341486299a
Component: cli
2018-04-09 13:37:45 -07:00
Vincent DemeesterandGitHub fe0d099c16 Merge pull request #984 from eiais/trustfish
add fish completions for docker trust subcommand
Upstream-commit: ec412bdbb4
Component: cli
2018-04-09 22:29:09 +02:00
Sebastiaan van StijnandGitHub a5ee15c5ef Merge pull request #978 from bogdananton/fix-manifest-docs-typo
[docs] Fix typo in manifest command docs: updated `MANFEST` to `MANIFEST`.
Upstream-commit: 066fd62e37
Component: cli
2018-04-09 13:25:37 -07:00
GordonTheTurtle 080b13b520 Merge component 'engine' from git@github.com:moby/moby master 2018-04-09 17:06:20 +00:00
Vincent DemeesterandGitHub 6d9f00fbde Merge pull request #36746 from vdemeester/experimental-build-tests
Migrate test-integration-cli experimental build tests to integration
Upstream-commit: cbde00b44273a584bed2ee3513db68924b4a6dba
Component: engine
2018-04-09 10:21:03 +02:00
GordonTheTurtle 6657091b64 Merge component 'engine' from git@github.com:moby/moby master 2018-04-07 17:06:24 +00:00
Akihiro SudaandGitHub e45b2e29df Merge pull request #36808 from justincormack/sys-rw-priv-always
Always make sysfs read-write with privileged
Upstream-commit: fb08a5c6c3e68a66f2096d97fdec9455fa007dde
Component: engine
2018-04-07 09:29:23 +09:00
Akihiro SudaandGitHub 0b3d7f605d Merge pull request #36806 from adshmh/integration-config-tests-use-unique-names
config integration tests use unique resource names
Upstream-commit: 390fd38bcbf6c5ea1456211c31eaee412b0f3f72
Component: engine
2018-04-07 09:28:14 +09:00
GordonTheTurtle 728f075089 Merge component 'cli' from git@github.com:docker/cli master 2018-04-06 16:41:33 +00:00
Justin Cormack 2cf9f7eb88 Always make sysfs read-write with privileged
It does not make any sense to vary this based on whether the
rootfs is read only. We removed all the other mount dependencies
on read-only eg see #35344.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: a729853bc712910574a7417f67764ec8c523928b
Component: engine
2018-04-06 16:17:18 +01:00
Arash Deshmeh b7d779bc5e integration tests under integration/config use unique names when creating resources
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 69481edc0770208f7af96c0eb48c0ab90e4889fb
Component: engine
2018-04-06 06:06:02 -04:00
Anusha Ragunathan 5d0f671bd1 Update examples to reflect docker-runc's runtime root for plugins.
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
Upstream-commit: 5fd9eab3d0
Component: cli
2018-04-05 12:14:59 -07:00
Vincent DemeesterandGitHub 74bf31d3e3 Merge pull request #986 from thaJeztah/bump-golang-1.9.5
Bump Golang to 1.9.5
Upstream-commit: fe83feeb72
Component: cli
2018-04-05 19:10:23 +02:00
GordonTheTurtle 0814aa2ae5 Merge component 'engine' from git@github.com:moby/moby master 2018-04-05 17:05:49 +00:00
Sebastiaan van Stijn 33403f2a86 Bump Golang to 1.9.5
go1.9.5 (released 2018/03/28) includes fixes to the compiler, go command, and
net/http/pprof package. See the Go 1.9.5 milestone on the issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.9.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d3b8ceb52c
Component: cli
2018-04-05 10:02:23 -07:00
GordonTheTurtle c18ca5abde Merge component 'cli' from git@github.com:docker/cli master 2018-04-05 16:41:29 +00:00
Sebastiaan van StijnandGitHub 89747f2a26 Merge pull request #981 from vdemeester/docs-fix-stack-deploy-reference
Fix `docker stack deploy` reference flag
Upstream-commit: 62104e2497
Component: cli
2018-04-05 09:32:41 -07:00
Sebastiaan van StijnandGitHub cb04b581ce Merge pull request #983 from vdemeester/972-fix-merge-network
Fix error with merge composefile with networks…
Upstream-commit: 3eb215c128
Component: cli
2018-04-05 09:31:26 -07:00
Vincent Demeester 96e7de35a2 Fix error with merge composefile with networks…
… and other cases too. Updating mergo fixes the bugs (but introduced a
slight behaviour change that had to be fixed too)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0122730faf
Component: cli
2018-04-05 10:37:35 +02:00
odg0318 12207142e4 If Content-Type is application/json;charset=UTF-8, RequestBody is empty.
Signed-off-by: odg0318 <odg0318@gmail.com>
Upstream-commit: 6ac73d34e4d8f2b6303f0ed49b58d0a92c19c6f1
Component: engine
2018-04-05 04:03:45 -04:00
Vincent DemeesterandGitHub d97a287d94 Merge pull request #36769 from stevvooe/defensive-attachment-processing
daemon/cluster: handle partial attachment entries during configure
Upstream-commit: 8a9e1808cfdef414e60307b4ccd96719731be304
Component: engine
2018-04-05 09:35:11 +02:00
Anusha RagunathanandGitHub 7e2f77eef8 Merge pull request #36728 from darrenstahlmsft/LayerLeak
Fix Windows layer leak when write fails
Upstream-commit: a8260058e39f7014f811394f86ae2c0bc899e11e
Component: engine
2018-04-04 19:05:59 -07:00
Sebastiaan van Stijn a72a47a3d9 Bump Golang to 1.9.5
go1.9.5 (released 2018/03/28) includes fixes to the compiler, go command, and
net/http/pprof package. See the Go 1.9.5 milestone on the issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.9.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c62336593118020462d65d4e9784143e07de2da7
Component: packaging
2018-04-04 18:01:28 -07:00
Stephen J Day 95a3a5cb78 daemon/cluster: handle partial attachment entries during configure
We have seen a panic when re-joining a node to a swarm cluster. The
cause of the issue is unknown, so we just need to add a test for nil
objects and log when we get the condition. Hopefully this can prevent
the crash and we can recover the config at a later time.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 454128c6e82cded211c1412e3eb350b1f7533ee2
Component: engine
2018-04-04 15:53:14 -07:00
Sebastiaan van StijnandGitHub 0dacb7da76 Merge pull request #36779 from thaJeztah/bump-golang-1.9.5
Update Golang to 1.9.5
Upstream-commit: a15cbcb3cfc320430c3af027c3e384466cd4c1cf
Component: engine
2018-04-04 13:28:58 -07:00
Darren Stahl 28820945d1 Fix Windows layer leak when write fails
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 1f28844d7869609f371ab2a7881e4488a79a7e27
Component: engine
2018-04-04 12:31:23 -07:00
GordonTheTurtle 3ccf86f831 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-04-04 18:09:40 +00:00
GordonTheTurtle 15dcf3ac74 Merge component 'engine' from git@github.com:moby/moby master 2018-04-04 18:09:33 +00:00
Eli Uriegas 91ed2df48d Add aarch64 builder for debian-buster
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: a42fb6433445b05c1318c9db2b1325bfb50f24af
Component: packaging
2018-04-04 16:59:31 +00:00
Eli UriegasandGitHub bf1e88e279 Merge pull request #98 from seemethere/f28
Add packaging code for Fedora 28
Upstream-commit: 9efc79dd124c6c2a07488e68ddbad1558b8e5e30
Component: packaging
2018-04-04 09:44:21 -07:00
Sebastiaan van Stijn 7681719a24 Update Golang to 1.9.5
go1.9.5 (released 2018/03/28) includes fixes to the compiler, go
command, and net/http/pprof package. See the Go 1.9.5 milestone on
the issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.9.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0b6f8a7eff325a683b10d64db363da2145aa1c36
Component: engine
2018-04-04 06:59:53 -07:00
Anusha RagunathanandGitHub e416848066 Merge pull request #36701 from thaJeztah/bump-swarmkit
Bump SwarmKit to 831df679a0b8a21b4dccd5791667d030642de7ff
Upstream-commit: 094aa1a5527df23922e1de85919da7ab67455067
Component: engine
2018-04-03 21:22:52 -07:00
Kyle Spiers 119115ef8d add fish completions for docker trust subcommand
Signed-off-by: Kyle Spiers <kyle@spiers.me>
Upstream-commit: 4439f6446e
Component: cli
2018-04-03 18:04:04 -07:00
Eli Uriegas 06bbeec2bc Add packaging code for Fedora 28
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 00148a3c994c753a3e171b1aa2b422342e00fd16
Component: packaging
2018-04-03 23:50:57 +00:00
GordonTheTurtle 1e976c5ef2 Merge component 'engine' from git@github.com:moby/moby master 2018-04-03 23:35:47 +00:00
Yong TangandGitHub bf5c5d2816 Merge pull request #36749 from stevvooe/update-containerd-1.0.3
containerd: update to 1.0.3 release
Upstream-commit: 10ca8d9771fd0d4051cb8291d7980ae909d437f7
Component: engine
2018-04-03 12:07:26 -07:00
GordonTheTurtle b7c2550378 Merge component 'engine' from git@github.com:moby/moby master 2018-04-03 17:06:38 +00:00
GordonTheTurtle dcc0cb0975 Merge component 'cli' from git@github.com:docker/cli master 2018-04-03 16:41:31 +00:00
Sebastiaan van StijnandGitHub ebe9fb4969 Merge pull request #36774 from AkihiroSuda/libnetwork-20180403
update libnetwork to improve scalabiltiy of bridge network isolation rules
Upstream-commit: eb3f0252d0187d61f591f88be1ac583c910df0e3
Component: engine
2018-04-03 09:21:10 -07:00
Vincent DemeesterandGitHub 2da3a78249 Merge pull request #36762 from zorrorffm/moby_dev
Add quotation marks for $CURDIR
Upstream-commit: 6c0d6236117effb139dd3d3edf984877f81e0a94
Component: engine
2018-04-03 10:28:11 +02:00
Vincent Demeester 77bb3ea6e7 Fix docker stack deploy reference flag
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2ee9635b1e
Component: cli
2018-04-03 10:11:52 +02:00
Akihiro Suda 0b341811fc update libnetwork to improve scalabiltiy of bridge network isolation rules
* libnetwork#2121: Retry other external DNS servers on ServFail
* libnetwork#2125: Fix README flag and expose orphan network peers
* libnetwork#2126: Adding goreport card
* libnetwork#2130: Modify awk to use cut in check_ip_overlap
* libnetwork#2117: [Carry 1534] Improve scalabiltiy of bridge network isolation rules

Full changes: https://github.com/docker/libnetwork/compare/2bf63300c52f5ea61989f85c732f00097d746530...5c1218c956c99f3365711974e300087810c31379

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: b159da19734269c4a162763ebfa28dff07b703f3
Component: engine
2018-04-03 16:50:00 +09:00
Vincent DemeesterandGitHub 6a9a060b45 Merge pull request #979 from joaofnfernandes/docs-secrets-6294
Use printf, not echo when creating secrets
Upstream-commit: 17aaad6f06
Component: cli
2018-04-03 09:45:11 +02:00
Sebastiaan van StijnandGitHub f323a813e1 Merge pull request #36724 from dnephin/api-docs-add-build-target
Add target field to build API docs
Upstream-commit: 045206a45c15625249d7956a6e18d2accaab6383
Component: engine
2018-04-02 22:35:00 -07:00
Akihiro SudaandGitHub 54e71e814c Merge pull request #36770 from mrueg/36754-follow-up-test
Fix tests for pkg/archive
Upstream-commit: a2db190088a6c11af05023469733f3293c741084
Component: engine
2018-04-03 13:49:48 +09:00
Sebastiaan van StijnandGitHub d94b697fa2 Merge pull request #980 from thaJeztah/fix-history-format-placeholder
Fix --format example for docker history
Upstream-commit: 4faf9a1736
Component: cli
2018-04-02 20:14:51 -07:00
Manuel Rüger 7b60a70f28 Fix tests for pkg/archive
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
Upstream-commit: 108bbd96cb6f9aaa2a761e1a33250f36d58882f9
Component: engine
2018-04-03 01:17:52 +02:00
Sebastiaan van Stijn 74a9225ea5 Fix --format example for docker history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2f7bf40e73
Component: cli
2018-04-02 16:07:40 -07:00
Sebastiaan van Stijn 314f0caa92 Bump SwarmKit to 831df679a0b8a21b4dccd5791667d030642de7ff
Changes included:

- Ingress network should not be attachable
- [manager/state] Add fernet as an option for raft encryption
- Log GRPC server errors
- Log leadership changes at manager level
- [state/raft] Increase raft ElectionTick to 10xHeartbeatTick
- Remove the containerd executor
- agent: backoff session when no remotes are available
- [ca/manager] Remove root CA key encryption support entirely
- Fix agent logging race (fixes https://github.com/docker/swarmkit/issues/2576)
- Adding logic to restore networks in order

Also adds github.com/fernet/fernet-go as a new dependency

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 27749659d5a30999691e401a351221780a483099
Component: engine
2018-04-02 15:17:38 -07:00
Joao Fernandes 15ef970018 Use printf, not echo when creating secrets
Update the docs so that users don't use `echo` when creating
secrets from STDIN. `echo` adds a trailing new line, so users
will probably be confused when their passwords don't work.

Signed-off-by: Joao Fernandes <joao.fernandes@docker.com>
Upstream-commit: 5238f3e93e
Component: cli
2018-04-02 15:15:19 -07:00
Stephen J Day 35efc4d5f1 containerd: update to 1.0.3 release
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 554d657c1f7a0f4dce51f0d26407fb05a0580fa1
Component: engine
2018-04-02 13:42:49 -07:00
Anusha RagunathanandGitHub 1841491e85 Merge pull request #36745 from arm64b/fix-misused-nwname
Fix a misused network object name
Upstream-commit: 785b3e32876e10d638d9b1bae00e3f340a2f47ec
Component: engine
2018-04-02 10:35:20 -07:00
Fangming.Fang 766917be06 Add quotation marks for $CURDIR
This change fixes bug when $CURDIR contains special character e.g. '&&'.

Change-Id: I658eb60d97c2229cf8b4e0a61dbbecf3edc9d573
Signed-off-by: Fangming.Fang <fangming.fang@arm.com>
Upstream-commit: 83062593d7ce759bb96e271e30460afa4a695dba
Component: engine
2018-04-02 05:48:35 +00:00
Tõnis TiigiandGitHub 84fd46c694 Merge pull request #36756 from redbaron/userns-copy-fifo-fix
Fix FIFO, sockets and device files when run in user NS
Upstream-commit: 7410b046491a027fa49cc69475c09fa929b9f810
Component: engine
2018-04-01 20:02:11 -07:00
Bogdan AntonandBogdan Anton 5392f72ea0 [docs] Fix typo in manifest command docs: updated MANFEST to MANIFEST.
Signed-off-by: Bogdan Anton <contact@bogdananton.ro>
Upstream-commit: 9fa6bd4174
Component: cli
2018-04-01 17:40:31 +03:00
Maxim Ivanov 94036de956 Fix FIFO, sockets and device files when run in user NS
commit 617c352e9225 "Don't create devices if in a user namespace"

introduced check, which meant to skip mknod operation when run
in user namespace, but instread skipped FIFO and socket files
copy.

Signed-off-by: Maxim Ivanov <ivanov.maxim@gmail.com>
Upstream-commit: 6f084f292932c464a30b56edb9edbe238bdcf0aa
Component: engine
2018-04-01 12:33:59 +01:00
GordonTheTurtle b0b28797bc Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-03-31 17:06:47 +00:00
GordonTheTurtle fafe3fe50a Merge component 'engine' from git@github.com:moby/moby master 2018-03-31 17:06:40 +00:00
Eli UriegasandGitHub 861c35095f Merge pull request #100 from seemethere/update_readme
Add Bionic to README
Upstream-commit: 9e33949813b2589271f7a4535008b209d95200ab
Component: packaging
2018-03-30 15:13:50 -07:00
Eli Uriegas 96b3d4192f Add Bionic to README
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 205c26fc9d83bfcb04b39d7b3fb5ae9c1fcbbcc3
Component: packaging
2018-03-30 22:12:42 +00:00
Vincent DemeesterandGitHub 8e1baea5f9 Merge pull request #36706 from arm64b/add-defult-timeout-config-func
Add default pollSettings config functions
Upstream-commit: 635f359f8b61887faa9427d9c673be96faf992b5
Component: engine
2018-03-30 19:31:06 +02:00
GordonTheTurtle fb9c6b4cbb Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-03-30 17:06:07 +00:00
GordonTheTurtle 09c16ca1db Merge component 'engine' from git@github.com:moby/moby master 2018-03-30 17:06:00 +00:00
Kir Kolyshkin fe76970085 TestDaemonNoSpaceLeftOnDeviceError: simplify
There is no need to perform a separate losetup step; mount (even
the one in busybox!) is smart enough to set up a loopback device
all by itself (even without -o loop present!). More to say, while
doing this, it sets LO_FLAGS_AUTOCLEAR flag for the kernel to
delete the loopback device as soon as its fs is unmounted (this
is supposed to work since kernel 2.6.25).

Also, remove mount options (-t ext4, -o loop,rw) as they are
either defaults (rw) or mount is smart enough to figure out.
Leave -n so it won't do unnecessary write to container's /etc/mtab.

While at it, touch up some comments.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: a978fd22daefcc68d37c46177a545f7e1dfc6d9e
Component: engine
2018-03-30 09:14:49 -07:00
Vincent DemeesterandGitHub 57682a5381 Merge pull request #36715 from cpuguy83/plugin_exec_fixes
Make sure plugin container is removed on failure
Upstream-commit: 859e43e64c4358c9aa48e045c0e5b048361a4c9b
Component: engine
2018-03-30 13:17:31 +02:00
Vincent Demeester 61213d110b Migrate test-integration-cli experimental build tests to integration
All `docker build` tests that require an `ExperimentalDaemon` are
migrated to `integration/build` package and start an experimental
daemon to test on it.

The end goal being to remove the `experimental` builds.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 183076e89df64928bd2e94ad0da9725b482367cd
Component: engine
2018-03-30 13:10:02 +02:00
Dennis Chen d785136a3a Fix a misused network object name
A minor nit. `test01` never been created and used in
`TestDockerNetworkInspectCustomSpecified()` function, so correct it.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: f041953d04bffa2be05466173f02dd016c68286d
Component: engine
2018-03-30 09:47:41 +00:00
Sebastiaan van StijnandGitHub 9113717a6d Merge pull request #36741 from tonistiigi/yamllint
dockerfile: restore yamllint
Upstream-commit: 1d59c66b704ad94f9f7b40b82b9df16cc6082a0a
Component: engine
2018-03-30 10:22:44 +01:00
Vincent DemeesterandGitHub 187be19082 Merge pull request #36736 from tonistiigi/remove-test-kernel-version
copy: remove kernel version test
Upstream-commit: 6c948b562d826fd95da5f972305d22c47a479494
Component: engine
2018-03-30 10:53:40 +02:00
Vincent DemeesterandGitHub fa2b7ebcd9 Merge pull request #36734 from cpuguy83/context_directory_size
Support cancellation in `directory.Size()`
Upstream-commit: f0b9eb8627b0bbf3cbd95edd78cc552cb3626520
Component: engine
2018-03-30 10:38:33 +02:00
Tibor Vass 2028cd9738 ci: quote bash variable
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: dc597777665c080490dd7540b7ac88fd91e746e1
Component: engine
2018-03-29 18:06:45 -07:00
Tõnis TiigiandGitHub 85555b0bc6 Merge pull request #36726 from chungers/raft-params
Expose swarmkit's Raft tuning parameters in engine config
Upstream-commit: 8b6a8271a62eec40827bf77f32b794f650556c24
Component: engine
2018-03-29 17:19:04 -07:00
Tonis Tiigi bdbb1213a7 dockerfile: restore yamllint
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 708b068d3095c6a6be939eb2da78c921d2e945e2
Component: engine
2018-03-29 16:43:31 -07:00
Brian Goff 9b41292c7f Support cancellation in directory.Size()
Makes sure that if the user cancels a request that the daemon stops
trying to traverse a directory.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 9d46c4c138d7b3f7778c13fe84857712bd6c97a9
Component: engine
2018-03-29 15:49:15 -04:00
John Howard (VM) 60950b5248 Windows: GetLayerPath in graphdriver
Signed-off-by: John Howard (VM) <jhoward@ntdev.microsoft.com>
Upstream-commit: 3aab84803dec4a28484b319531685276435263cd
Component: engine
2018-03-29 11:45:45 -07:00
Eli UriegasandGitHub 1e72ac567b Merge pull request #99 from seemethere/arm64_bionic
Add Ubuntu 18.04 arm64 builds
Upstream-commit: bad901ee77ac8aebb7cf7207bd4eb153e7a0f05d
Component: packaging
2018-03-29 11:37:51 -07:00
Eli Uriegas 9a9ab34587 Add Ubuntu 18.04 arm64 builds
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: aac8310bbee3c7480487a624756d25d22d53c7dd
Component: packaging
2018-03-29 18:09:08 +00:00
Tonis Tiigi c26d6b4944 copy: remove kernel version test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 4d6b8f73a89abf715fa33b3f553884c575a3b136
Component: engine
2018-03-29 10:45:43 -07:00
GordonTheTurtle 72c010f740 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging master 2018-03-29 17:06:47 +00:00
GordonTheTurtle 68ce936581 Merge component 'engine' from git@github.com:moby/moby master 2018-03-29 17:06:40 +00:00
Vincent DemeesterandGitHub b95f740ca4 Merge pull request #36631 from vdemeester/e2e-integration-cli-run
e2e integration cli run
Upstream-commit: deed26f7f0f9a9d279b8ac99389f204d9063d1a4
Component: engine
2018-03-29 12:06:29 +02:00
Vincent Demeester 28e52cd76e Skip some tests in certain condition to run with e2e image
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: e55d6fc8573580f6eea009cd7f1034aa912128ef
Component: engine
2018-03-29 09:10:39 +02:00
Dennis Chen 002f9525b1 Using the default PollSettings function
Using the default PollSettings functions to adjust the timeout
value instead of changing the value each time when needed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: b8912feeffcdfd489c9fc1212277840adac2719c
Component: engine
2018-03-29 05:00:14 +00:00
Dennis Chen 2751013fe1 Add default pollSettings adjustment routines
Add the default function per resource to override the `pollSettings`
which will be re-used where it's needed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: ee6959addc5664a5c55765f2c721f84414ea4779
Component: engine
2018-03-29 04:47:14 +00:00
Anusha RagunathanandGitHub 39837033f0 Merge pull request #36638 from ctelfer/rolling-update-libnetwork-import
Import libnetwork fix for rolling updates
Upstream-commit: f12574891cb2ea69809f2425a0d5658a320293fe
Component: engine
2018-03-28 21:27:14 -07:00
David Chung 9a7c928884 Expose swarm raft tuning parameters in engine config
Signed-off-by: David Chung <david.chung@docker.com>
Upstream-commit: 275a1ca7c8ec1d556c37bb50ac574beffbb16e5a
Component: engine
2018-03-28 16:54:43 -07:00
Eli UriegasandGitHub 2d5676eecc Merge pull request #97 from seemethere/bionic
Add building code for Ubuntu Bionic (18.04) LTS
Upstream-commit: f2312f5028c946ddeaa89405334ca91a4e5fcb1c
Component: packaging
2018-03-28 16:36:04 -07:00
Eli Uriegas 65120ca559 Add building code for Ubuntu Bionic (18.04) LTS
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 460f0b5becbbc5ec2bd341df409af8f06c0a70f7
Component: packaging
2018-03-28 21:53:58 +00:00
Andrew HsuandGitHub fa48e15468 Merge pull request #484 from seemethere/change
[master] Change to docker fork of moby-components
2018-03-28 13:28:24 -07:00
Eli Uriegas efdc8dee9a Change to docker fork of moby-components
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-03-28 20:26:30 +00:00
Anusha RagunathanandGitHub 8cca58175d Merge pull request #36711 from cpuguy83/plugin_mounts_sorting
Don't sort plugin mounts slice
Upstream-commit: 18d16885308c35cf38db03b39a779198704a8f42
Component: engine
2018-03-28 11:57:38 -07:00
Daniel Nephin 59210a575a Add target field to build API docs
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 95ccb55fe281fdccb996b0b82befcb3998beac25
Component: engine
2018-03-28 14:34:58 -04:00
Chris Telfer e260e8f94d Remove (now) extra call to sb.DisableService()
This call was added as part of commit a042e5a20 and at the time was
useful.  sandbox.DisableService() basically calls
endpoint.deleteServiceInfoFromCluster() for every endpoint in the
sandbox.  However, with the libnetwork change, endpoint.sbLeave()
invokes endpoint.deleteServiceInfoFromCluster(). The releaseNetwork()
call invokes sandbox.Delete() immediately after
sandbox.DisableService().  The sandbox.Delete() in turn ultimately
invokes endpoint.sbLeave() for every endpoint in the sandbox which thus
removes the endpoint's load balancing entry via
endpoint.deleteServiceInfoFromCluster().  So the call to
sandbox.DisableService() is now redundant.

It is noteworthy that, while redundant, the presence of the call would
not cause errors.  It would just be sub-optimal.  The DisableService()
call would cause libnetwork to down-weight the load balancing entries
while the call to sandbox.Delete() would cause it to remove the entries
immediately afterwards.  Aside from the wasted computation, the extra
call would also propagate an extra state change in the networkDB gossip
messages.  So, overall, it is much better to just avoid the extra
overhead.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
Upstream-commit: c27417aa7de46daa415600b39fc8a9c411c8c493
Component: engine
2018-03-28 14:16:31 -04:00
Chris Telfer aebec1d07b Import libnetwork fix for rolling updates
This patch allows endpoints to complete servicing connections while
being removed from a service.  The fix is entirely within libnetwork
and requires no changes to the moby codebase proper.  It operates
by initially down-weighting a container endpoint in the load balancer
to 0 while keeping the endpoint present in the load balancer.  This
allows traffic to continue to flow to the endpoint while preventing new
connections from going to the endpoint.  This allows the container
to complete requests during the "stop_grace_period" and then exit when
finished without interruption of service.

This change requires propagating the status of disabled service
endpoints via the networkDB.  Accordingly, the patch includes both code
to generate and handle service update messages.  It also augments the
service structure with a ServiceDisabled boolean to convey whether an
endpoint should ultimately be removed or just disabled.  This,
naturally, required a rebuild of the protocol buffer code.

The protocol buffer encoding is designed to support additions of fields
to messages in a backwards-compatible manner.  Protocol buffer
unmarshalling code automatically skips past any fields that it isn't
aware of.  As a result, an older moby daemon without this fix can
receive and will process correctly networkDB messages from newer moby
daemons with this patch.

As it turns out, the additional field is simply a bool that is otherwise
irrelevent on networkDB create and delete events.  So its absence in
older moby daemon processing has no impact.  However, the fix leverages
the "update" networkDB message which was previously unused in
libnetwork.  Although older libnetwork implementations parse the message
cleanly, they will see the message as unexpected and as such issue a log
at error level indicating the receipt of such.

Other than this there should be no other negative impact for use of this
patch in mixed environments. (Although older mobys won't be able to
gracefully downgrade connections on their nodes of course.)

Signed-off-by: Chris Telfer <ctelfer@docker.com>
Upstream-commit: 50dbdeff9fd186bb0e9926996436e1f56529a831
Component: engine
2018-03-28 14:16:31 -04:00
GordonTheTurtle af66ab6f08 Merge component 'engine' from git@github.com:moby/moby master 2018-03-28 17:07:19 +00:00
GordonTheTurtle 6489f0428a Merge component 'cli' from git@github.com:docker/cli master 2018-03-28 16:41:29 +00:00
Sebastiaan van StijnandGitHub 10857ac7fc Merge pull request #36697 from vdemeester/network-macvlan-test-migration
Migrate test-integration-cli experimental macvlan test to integration
Upstream-commit: 38588656727d19f4a36d14c3620ecaff73160315
Component: engine
2018-03-28 17:56:42 +02:00
Brian Goff 92debf8e45 Use containerd client Reconnect() API.
This fixes an issue where the containerd client is cached in a container
object in libcontainerd and becomes stale after containerd is restarted.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 2c682d5209d1d1cdd232ce3909fa25b6023f9a5b
Component: engine
2018-03-28 09:43:08 -04:00
Brian Goff 59748a4be4 Bump containerd client vendor commit
This does not bump the containerd binary.
Picks last commit before go1.10 switch, which is not currently supported
in moby.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 30cb23360e21c7914f41e69496abde4780bd7bc1
Component: engine
2018-03-28 09:25:38 -04:00
Brian Goff fb7d4261c9 Don't sort plugin mounts slice
This was added as part of a53930a04fa81b082aa78e66b342ff19cc63cc5f with
the intent to sort the mounts in the plugin config, but this was sorting
*all* the mounts from the default OCI spec which is problematic.

In reality we don't need to sort this because we are only adding a
self-binded mount to flag it as rshared.

We may want to look at sorting the plugin mounts before they are added
to the OCI spec in the future, but for now I think the existing behavior
is fine since the plugin author has control of the order (except for the
propagated mount).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: ec90839ca302ca53a7d55e4c7f79e7b4779f5e15
Component: engine
2018-03-28 09:10:43 -04:00
Brian Goff a2df8e9502 Make sure plugin container is removed on failure
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f81172b9031160218e51fb2a7dbeee19962a60a9
Component: engine
2018-03-28 09:07:24 -04:00
Vincent Demeester e5e13f7dec Migrate test-integration-cli experimental macvlan test to integration
All `Macvlan` related test on `DockerSuite` and `DockerNetworkSuite`
are migrated to `macvlan_test.go`.

Also, as `macvlan` seems to be out of experimental, this removes
the *skip* when the run is not experimental (and doesn't start a
daemon with experimental either).

The end goal being to remove the `experimental` builds.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ef5bc603266b9fa5df525319d67329ebc14a8ee7
Component: engine
2018-03-28 10:47:11 +02:00
Vincent DemeesterandGitHub f7430e1bae Merge pull request #36651 from keloyang/judgment-daemonWaitCh
Add if judgment before receiving operations on daemonWaitCh
Upstream-commit: b6a7d027e99d4416489b829307f2ad57ba52ada7
Component: engine
2018-03-28 10:07:57 +02:00
Vincent DemeesterandGitHub 5f335fa91f Merge pull request #965 from thaJeztah/fix-version-output
Fix docker version output alignment
Upstream-commit: eb4a4fe9b9
Component: cli
2018-03-28 09:53:34 +02:00
Victor VieuxandGitHub a2853ba98e Merge pull request #975 from tonistiigi/vendor-moby
vendor: update moby to ed7b6428
Upstream-commit: 442f56faf6
Component: cli
2018-03-27 14:54:42 -07:00
Tonis Tiigi 0ff4beab6e vendor: update moby to ed7b6428
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: a1cbaa827b
Component: cli
2018-03-27 14:11:29 -07:00
Daniel NephinandGitHub e578155b97 Merge pull request #968 from dnephin/remove-myself-as-code-owner
Remove myself from CODEOWNERS
Upstream-commit: 26b834a698
Component: cli
2018-03-27 16:46:54 -04:00
GordonTheTurtle baaac6847b Bump version to 18.05.0-ce-dev
Signed-off-by: GordonTheTurtle <engine-team@docker.com>
2018-03-27 17:52:22 +00:00
Alejandro González Hevia 252f993dde Standardized log messages accross the different storage drivers.
Now all of the storage drivers use the field "storage-driver" in their log
messages, which is set to name of the respective driver.
Storage drivers changed:
- Aufs
- Btrfs
- Devicemapper
- Overlay
- Overlay 2
- Zfs

Signed-off-by: Alejandro GonzÃlez Hevia <alejandrgh11@gmail.com>
Upstream-commit: 9392838150f5495a63f33fed6570ae41f5a6d62e
Component: engine
2018-03-27 14:37:30 +02:00
Preston Cowley 6493e53acd Update build.md
Explicitly stated that you must add --build-arg for each build argument.
Added multiple arguments to example of `--build-arg` usage.
Fix for https://github.com/docker/docker.github.io/issues/6248

Signed-off-by: Preston Cowley <cowlinator@gmail.com>
Upstream-commit: ad44e2d45e
Component: cli
2018-03-26 14:28:49 -07:00
Daniel Nephin 953c988bf8 Remove myself from CODEOWNERS
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3a633aa271
Component: cli
2018-03-26 13:39:03 -04:00
Sebastiaan van Stijn 35825c3260 Fix docker version output alignment
Use tabwriter to print the version output

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 48eb7a082d
Component: cli
2018-03-26 17:59:20 +02:00
Sebastiaan van Stijn 9166a5d3e5 Fix stack deploy re-deploying service after --force
When updating a service with the `--force` option, the `ForceUpdate`
property of the taskspec is incremented.

Stack deploy did not take this into account, and reset this
field to its default value (0), causing the service to be
re-deployed.

This patch copies the existing value before updating the service.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 76439457d2
Component: cli
2018-03-26 15:24:28 +02:00
Utz Bacher d8e4be59e9 use seccomp for xenial
Upstream-commit: 4c02fd87dda048d5d5d7fa6c8bdb8fba04c257c1
Component: packaging
2018-03-23 23:47:58 +01:00
Shukui Yang 287db00d6b Add if judgment before receiving operations on daemonWaitCh
receive operations on a nil channel will always block, this lead containerd not started.

Signed-off-by: Shukui Yang <yangshukui@huawei.com>
Upstream-commit: a50d9c0765d9861d226b323ffe190c0c99c3ac17
Component: engine
2018-03-21 05:53:55 -04:00
John Howard a2e4c2ffca LCOW: Write saved manifest.json in Unix paths
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 0a49de4eb551510cf4aafa7d212ec2bb8041f642
Component: engine
2018-03-14 11:56:00 -07:00
John Howard c113de75ae LCOW: Graphdriver DiffGetter implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6b4f989bc2c19be58e10731b9b0504b5f94607bf
Component: engine
2018-03-14 11:55:06 -07:00
John Howard d2852cf7ac LCOW: Make sure OS is copied for docker save
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d5c781323d5534a01e42cf8fd8cf773c6f1cdff2
Component: engine
2018-03-14 11:46:46 -07:00
John Howard 47c7cacdf3 LCOW: Check OS in takeLayerReference
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d8dbba14fd6a1be91e88082d4d4ba9aafd8c880a
Component: engine
2018-03-14 11:46:35 -07:00
Aleksa Sarai a2b8d3a9e8 pkg: devmapper: dynamically load dm_task_deferred_remove
dm_task_deferred_remove is not supported by all distributions, due to
out-dated versions of devicemapper. However, in the case where the
devicemapper library was updated without rebuilding Docker (which can
happen in some distributions) then we should attempt to dynamically load
the relevant object rather than try to link to it.

This can only be done if Docker was built dynamically, for obvious
reasons.

In order to avoid having issues arise when dlsym(3) was unnecessary,
gate the whole dlsym(3) logic behind a buildflag that we disable by
default (libdm_dlsym_deferred_remove).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 98fe4bd8f1e35f8e498e268f653a43cbfa31e751
Component: engine
2018-02-16 17:23:23 +11:00
1072 changed files with 19469 additions and 11108 deletions
+73
View File
@@ -1 +1,74 @@
# Changelog
For more information on the list of deprecated flags and APIs, have a look at
https://docs.docker.com/engine/deprecated/ where you can find the target removal dates
## 18.05.0-ce (2018-05-DD)
### Builder
* Adding `netbsd` compatibility to the package `pkg/term`. [moby/moby#36887](https://github.com/moby/moby/pull/36887)
* Standardizes output path for artifacts of intermediate builds to `/build/`. [moby/moby#36858](https://github.com/moby/moby/pull/36858)
### Client
- Fix `docker stack deploy` reference flag. [docker/cli#981](https://github.com/docker/cli/pull/981)
- Fix docker stack deploy re-deploying services after the service was updated with `--force`. [docker/cli#963](https://github.com/docker/cli/pull/963)
+ Add bash completion for `secret|config create --template-driver`. [docker/cli#1004](https://github.com/docker/cli/pull/1004)
+ Add fish completions for docker trust subcommand. [docker/cli#984](https://github.com/docker/cli/pull/984)
- Fix --format example for docker history. [docker/cli#980](https://github.com/docker/cli/pull/980)
- Fix error with merge composefile with networks. [docker/cli#983](https://github.com/docker/cli/pull/983)
### Logging
* Standardized the properties of storage-driver log messages. [moby/moby#36492](https://github.com/moby/moby/pull/36492)
* Improve partial message support in logger. [moby/moby#35831](https://github.com/moby/moby/pull/35831)
### Networking
- Allow for larger preset property values, do not override. [docker/libnetwork#2124](https://github.com/docker/libnetwork/pull/2124)
- networkdb: User write lock in handleNodeEvent. [docker/libnetwork#2136](https://github.com/docker/libnetwork/pull/2136)
* Import libnetwork fix for rolling updates. [moby/moby#36638](https://github.com/moby/moby/pull/36638)
* Update libnetwork to improve scalabiltiy of bridge network isolation rules. [moby/moby#36774](https://github.com/moby/moby/pull/36774)
- Fix a misused network object name. [moby/moby#36745](https://github.com/moby/moby/pull/36745)
### Runtime
* LCOW: Implement `docker save`. [moby/moby#36599](https://github.com/moby/moby/pull/36599)
* Pkg: devmapper: dynamically load dm_task_deferred_remove. [moby/moby#35518](https://github.com/moby/moby/pull/35518)
* Windows: Add GetLayerPath implementation in graphdriver. [moby/moby#36738](https://github.com/moby/moby/pull/36738)
- Fix Windows layer leak when write fails. [moby/moby#36728](https://github.com/moby/moby/pull/36728)
- Fix FIFO, sockets and device files when run in user NS. [moby/moby#36756](https://github.com/moby/moby/pull/36756)
- Fix docker version output alignment. [docker/cli#965](https://github.com/docker/cli/pull/965)
* Always make sysfs read-write with privileged. [moby/moby#36808](https://github.com/moby/moby/pull/36808)
* Bump Golang to 1.10.1. [moby/moby#35739](https://github.com/moby/moby/pull/35739)
* Bump containerd client. [moby/moby#36684](https://github.com/moby/moby/pull/36684)
* Bump golang.org/x/net to go1.10 release commit. [moby/moby#36894](https://github.com/moby/moby/pull/36894)
* Context.WithTimeout: do call the cancel func. [moby/moby#36920](https://github.com/moby/moby/pull/36920)
* Copy: avoid using all system memory with authz plugins. [moby/moby#36595](https://github.com/moby/moby/pull/36595)
* Daemon/cluster: handle partial attachment entries during configure. [moby/moby#36769](https://github.com/moby/moby/pull/36769)
* Don't make container mount unbindable. [moby/moby#36768](https://github.com/moby/moby/pull/36768)
* Extra check before unmounting on shutdown. [moby/moby#36879](https://github.com/moby/moby/pull/36879)
* Move mount parsing to separate package. [moby/moby#36896](https://github.com/moby/moby/pull/36896)
* No global volume driver store. [moby/moby#36637](https://github.com/moby/moby/pull/36637)
* Pkg/mount improvements. [moby/moby#36091](https://github.com/moby/moby/pull/36091)
* Relax some libcontainerd client locking. [moby/moby#36848](https://github.com/moby/moby/pull/36848)
* Remove daemon dependency on api packages. [moby/moby#36912](https://github.com/moby/moby/pull/36912)
* Remove the retries for service update. [moby/moby#36827](https://github.com/moby/moby/pull/36827)
* Revert unencryted storage warning prompt. [docker/cli#1008](https://github.com/docker/cli/pull/1008)
* Support cancellation in `directory.Size()`. [moby/moby#36734](https://github.com/moby/moby/pull/36734)
* Switch from x/net/context -> context. [moby/moby#36904](https://github.com/moby/moby/pull/36904)
* Fixed a function to check Content-type is `application/json` or not. [moby/moby#36778](https://github.com/moby/moby/pull/36778)
+ Add default pollSettings config functions. [moby/moby#36706](https://github.com/moby/moby/pull/36706)
+ Add if judgment before receiving operations on daemonWaitCh. [moby/moby#36651](https://github.com/moby/moby/pull/36651)
- Fix issues with running volume tests as non-root.. [moby/moby#36935](https://github.com/moby/moby/pull/36935)
### Swarm Mode
* RoleManager will remove detected nodes from the cluster membership [docker/swarmkit#2548](https://github.com/docker/swarmkit/pull/2548)
* Scheduler/TaskReaper: handle unassigned tasks marked for shutdown [docker/swarmkit#2574](https://github.com/docker/swarmkit/pull/2574)
* Avoid predefined error log. [docker/swarmkit#2561](https://github.com/docker/swarmkit/pull/2561)
* Task reaper should delete tasks with removed slots that were not yet assigned. [docker/swarmkit#2557](https://github.com/docker/swarmkit/pull/2557)
* Agent reports FIPS status. [docker/swarmkit#2587](https://github.com/docker/swarmkit/pull/2587)
- Fix: timeMutex critical operation outside of critical section. [docker/swarmkit#2603](https://github.com/docker/swarmkit/pull/2603)
* Expose swarmkit's Raft tuning parameters in engine config. [moby/moby#36726](https://github.com/moby/moby/pull/36726)
* Make internal/test/daemon.Daemon swarm aware. [moby/moby#36826](https://github.com/moby/moby/pull/36826)
+1 -1
View File
@@ -2,7 +2,7 @@ CLI_DIR:=$(CURDIR)/components/cli
ENGINE_DIR:=$(CURDIR)/components/engine
PACKAGING_DIR:=$(CURDIR)/components/packaging
MOBY_COMPONENTS_SHA=ab7c118272b02d8672dc0255561d0c4015979780
MOBY_COMPONENTS_URL=https://raw.githubusercontent.com/shykes/moby-extras/$(MOBY_COMPONENTS_SHA)/cmd/moby-components
MOBY_COMPONENTS_URL=https://raw.githubusercontent.com/docker/moby-extras/$(MOBY_COMPONENTS_SHA)/cmd/moby-components
MOBY_COMPONENTS=.helpers/moby-components-$(MOBY_COMPONENTS_SHA)
VERSION=$(shell cat VERSION)
+1 -1
View File
@@ -1 +1 @@
18.04.0-ce-dev
18.05.0-ce-rc1
+2 -3
View File
@@ -1,9 +1,8 @@
# GitHub code owners
# See https://github.com/blog/2392-introducing-code-owners
cli/command/stack/** @dnephin @vdemeester
cli/compose/** @dnephin @vdemeester
cli/command/stack/** @vdemeester
cli/compose/** @vdemeester
contrib/completion/bash/** @albers
contrib/completion/zsh/** @sdurrheimer
docs/** @mistyhacks @vdemeester @thaJeztah
scripts/** @dnephin
+3 -1
View File
@@ -330,6 +330,7 @@ Pavel Tikhomirov <ptikhomirov@virtuozzo.com> <ptikhomirov@parallels.com>
Pawel Konczalski <mail@konczalski.de>
Peter Choi <phkchoi89@gmail.com> <reikani@Peters-MacBook-Pro.local>
Peter Dave Hello <hsu@peterdavehello.org> <PeterDaveHello@users.noreply.github.com>
Peter Hsu <shhsu@microsoft.com>
Peter Jaffe <pjaffe@nevo.com>
Peter Nagy <xificurC@gmail.com> <pnagy@gratex.com>
Peter Waller <p@pwaller.net> <peter@scraperwiki.com>
@@ -378,8 +379,9 @@ Stefan Berger <stefanb@linux.vnet.ibm.com>
Stefan Berger <stefanb@linux.vnet.ibm.com> <stefanb@us.ibm.com>
Stefan J. Wernli <swernli@microsoft.com> <swernli@ntdev.microsoft.com>
Stefan S. <tronicum@user.github.com>
Stephen Day <stephen.day@docker.com>
Stephen Day <stevvooe@gmail.com>
Stephen Day <stephen.day@docker.com> <stevvooe@users.noreply.github.com>
Stephen Day <stevvooe@gmail.com> <stephen.day@docker.com>
Steve Desmond <steve@vtsv.ca> <stevedesmond-ca@users.noreply.github.com>
Sun Gengze <690388648@qq.com>
Sun Jianbo <wonderflow.sun@gmail.com>
+11 -1
View File
@@ -26,6 +26,7 @@ Alex Mavrogiannis <alex.mavrogiannis@docker.com>
Alexander Boyd <alex@opengroove.org>
Alexander Larsson <alexl@redhat.com>
Alexander Morozov <lk4d4@docker.com>
Alexander Ryabov <i@sepa.spb.ru>
Alexandre González <agonzalezro@gmail.com>
Alfred Landrum <alfred.landrum@docker.com>
Alicia Lauerman <alicia@eta.im>
@@ -69,6 +70,7 @@ Bill Wang <ozbillwang@gmail.com>
Bin Liu <liubin0329@gmail.com>
Bingshen Wang <bingshen.wbs@alibaba-inc.com>
Boaz Shuster <ripcurld.github@gmail.com>
Bogdan Anton <contact@bogdananton.ro>
Boris Pruessmann <boris@pruessmann.org>
Bradley Cicenas <bradley.cicenas@gmail.com>
Brandon Philips <brandon.philips@coreos.com>
@@ -139,6 +141,7 @@ Dattatraya Kumbhar <dattatraya.kumbhar@gslab.com>
Dave Goodchild <buddhamagnet@gmail.com>
Dave Henderson <dhenderson@gmail.com>
Dave Tucker <dt@docker.com>
David Beitey <david@davidjb.com>
David Calavera <david.calavera@gmail.com>
David Cramer <davcrame@cisco.com>
David Dooling <dooling@gmail.com>
@@ -222,6 +225,7 @@ Harry Zhang <harryz@hyper.sh>
He Simei <hesimei@zju.edu.cn>
Helen Xie <chenjg@harmonycloud.cn>
Henning Sprang <henning.sprang@gmail.com>
Henry N <henrynmail-github@yahoo.de>
Hernan Garcia <hernandanielg@gmail.com>
Hongbin Lu <hongbin034@gmail.com>
Hu Keping <hukeping@huawei.com>
@@ -329,6 +333,7 @@ Kenfe-Mickaël Laventure <mickael.laventure@gmail.com>
Kevin Burke <kev@inburke.com>
Kevin Feyrer <kevin.feyrer@btinternet.com>
Kevin Kern <kaiwentan@harmonycloud.cn>
Kevin Kirsche <Kev.Kirsche+GitHub@gmail.com>
Kevin Meredith <kevin.m.meredith@gmail.com>
Kevin Richardson <kevin@kevinrichardson.co>
khaled souf <khaled.souf@gmail.com>
@@ -367,6 +372,7 @@ Luca Marturana <lucamarturana@gmail.com>
Lucas Chan <lucas-github@lucaschan.com>
Luka Hartwig <mail@lukahartwig.de>
Lukasz Zajaczkowski <Lukasz.Zajaczkowski@ts.fujitsu.com>
Lydell Manganti <LydellManganti@users.noreply.github.com>
Lénaïc Huard <lhuard@amadeus.com>
Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Mabin <bin.ma@huawei.com>
@@ -432,6 +438,7 @@ Máximo Cuadros <mcuadros@gmail.com>
Nace Oroz <orkica@gmail.com>
Nahum Shalman <nshalman@omniti.com>
Nalin Dahyabhai <nalin@redhat.com>
Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
Natalie Parker <nparker@omnifone.com>
Nate Brennand <nate.brennand@clever.com>
Nathan Hsieh <hsieh.nathan@gmail.com>
@@ -463,7 +470,9 @@ Paul Weaver <pauweave@cisco.com>
Pavel Pospisil <pospispa@gmail.com>
Paweł Szczekutowicz <pszczekutowicz@gmail.com>
Peeyush Gupta <gpeeyush@linux.vnet.ibm.com>
Per Lundberg <per.lundberg@ecraft.com>
Peter Edge <peter.edge@gmail.com>
Peter Hsu <shhsu@microsoft.com>
Peter Jaffe <pjaffe@nevo.com>
Peter Nagy <xificurC@gmail.com>
Peter Salvatore <peter@psftw.com>
@@ -475,6 +484,7 @@ pidster <pid@pidster.com>
pixelistik <pixelistik@users.noreply.github.com>
Pratik Karki <prertik@outlook.com>
Prayag Verma <prayag.verma@gmail.com>
Preston Cowley <preston.cowley@sony.com>
Pure White <daniel48@126.com>
Qiang Huang <h.huangqiang@huawei.com>
Qinglan Peng <qinglanpeng@zju.edu.cn>
@@ -540,7 +550,7 @@ Srini Brahmaroutu <srbrahma@us.ibm.com>
Stefan S. <tronicum@user.github.com>
Stefan Scherer <scherer_stefan@icloud.com>
Stefan Weil <sw@weilnetz.de>
Stephen Day <stephen.day@docker.com>
Stephen Day <stevvooe@gmail.com>
Stephen Rust <srust@blockbridge.com>
Steve Durrheimer <s.durrheimer@gmail.com>
Steven Burgess <steven.a.burgess@hotmail.com>
+7 -1
View File
@@ -27,6 +27,7 @@
"cpuguy83",
"dnephin",
"justincormack",
"silvin-lubecki",
"stevvooe",
"tibor",
"tonistiigi",
@@ -103,9 +104,14 @@
Email = "jeff@docker.com"
GitHub = "programmerq"
[people.silvin-lubecki]
Name = "Silvin Lubecki"
Email = "silvin.lubecki@docker.com"
GitHub = "silvin-lubecki"
[people.stevvooe]
Name = "Stephen Day"
Email = "stephen.day@docker.com"
Email = "stevvooe@gmail.com"
GitHub = "stevvooe"
[people.thajeztah]
+1 -1
View File
@@ -1 +1 @@
18.04.0-dev
18.05.0-ce-rc1
+3 -15
View File
@@ -14,6 +14,7 @@ import (
"github.com/docker/docker/client"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/env"
"github.com/gotestyourself/gotestyourself/fs"
"github.com/pkg/errors"
"golang.org/x/net/context"
@@ -44,7 +45,7 @@ func TestNewAPIClientFromFlags(t *testing.T) {
func TestNewAPIClientFromFlagsWithAPIVersionFromEnv(t *testing.T) {
customVersion := "v3.3.3"
defer patchEnvVariable(t, "DOCKER_API_VERSION", customVersion)()
defer env.Patch(t, "DOCKER_API_VERSION", customVersion)()
opts := &flags.CommonOptions{}
configFile := &configfile.ConfigFile{}
@@ -53,19 +54,6 @@ func TestNewAPIClientFromFlagsWithAPIVersionFromEnv(t *testing.T) {
assert.Check(t, is.Equal(customVersion, apiclient.ClientVersion()))
}
// TODO: use gotestyourself/env.Patch
func patchEnvVariable(t *testing.T, key, value string) func() {
oldValue, ok := os.LookupEnv(key)
assert.NilError(t, os.Setenv(key, value))
return func() {
if !ok {
assert.NilError(t, os.Unsetenv(key))
return
}
assert.NilError(t, os.Setenv(key, oldValue))
}
}
type fakeClient struct {
client.Client
pingFunc func() (types.Ping, error)
@@ -260,7 +248,7 @@ func TestOrchestratorSwitch(t *testing.T) {
version: defaultVersion,
}
if testcase.envOrchestrator != "" {
defer patchEnvVariable(t, "DOCKER_ORCHESTRATOR", testcase.envOrchestrator)()
defer env.Patch(t, "DOCKER_ORCHESTRATOR", testcase.envOrchestrator)()
}
cli := &DockerCli{client: apiclient, err: os.Stderr}
@@ -100,7 +100,7 @@ func TestGetExitStatus(t *testing.T) {
},
{
result: &container.ContainerWaitOKBody{
Error: &container.ContainerWaitOKBodyError{expectedErr.Error()},
Error: &container.ContainerWaitOKBodyError{Message: expectedErr.Error()},
},
expectedError: expectedErr,
},
+2 -5
View File
@@ -124,9 +124,6 @@ func runContainer(dockerCli command.Cli, opts *runOptions, copts *containerOptio
stdout, stderr := dockerCli.Out(), dockerCli.Err()
client := dockerCli.Client()
// TODO: pass this as an argument
cmdPath := "run"
warnOnOomKillDisable(*hostConfig, stderr)
warnOnLocalhostDNS(*hostConfig, stderr)
@@ -163,7 +160,7 @@ func runContainer(dockerCli command.Cli, opts *runOptions, copts *containerOptio
createResponse, err := createContainer(ctx, dockerCli, containerConfig, &opts.createOptions)
if err != nil {
reportError(stderr, cmdPath, err.Error(), true)
reportError(stderr, "run", err.Error(), true)
return runStartContainerErr(err)
}
if opts.sigProxy {
@@ -209,7 +206,7 @@ func runContainer(dockerCli command.Cli, opts *runOptions, copts *containerOptio
<-errCh
}
reportError(stderr, cmdPath, err.Error(), false)
reportError(stderr, "run", err.Error(), false)
if copts.autoRemove {
// wait container to be removed
<-statusChan
@@ -38,9 +38,9 @@ checkpoint-3:
}
checkpoints := []types.Checkpoint{
{"checkpoint-1"},
{"checkpoint-2"},
{"checkpoint-3"},
{Name: "checkpoint-1"},
{Name: "checkpoint-2"},
{Name: "checkpoint-3"},
}
for _, testcase := range cases {
out := bytes.NewBufferString("")
@@ -42,9 +42,9 @@ D: /usr/app/old_app.js
}
diffs := []container.ContainerChangeResponseItem{
{archive.ChangeModify, "/var/log/app.log"},
{archive.ChangeAdd, "/usr/app/app.js"},
{archive.ChangeDelete, "/usr/app/old_app.js"},
{Kind: archive.ChangeModify, Path: "/var/log/app.log"},
{Kind: archive.ChangeAdd, Path: "/usr/app/app.js"},
{Kind: archive.ChangeDelete, Path: "/usr/app/old_app.js"},
}
for _, testcase := range cases {
@@ -7,7 +7,6 @@ import (
"github.com/docker/cli/cli/trust"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/docker/docker/registry"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/theupdateframework/notary/client"
"github.com/theupdateframework/notary/passphrase"
@@ -47,8 +46,8 @@ func TestHTTPENVTrustServer(t *testing.T) {
func TestOfficialTrustServer(t *testing.T) {
indexInfo := &registrytypes.IndexInfo{Name: "testserver", Official: true}
output, err := trust.Server(indexInfo)
if err != nil || output != registry.NotaryServer {
t.Fatalf("Expected server to be %s, got %s", registry.NotaryServer, output)
if err != nil || output != trust.NotaryServer {
t.Fatalf("Expected server to be %s, got %s", trust.NotaryServer, output)
}
}
@@ -21,7 +21,7 @@ func newCreateListCommand(dockerCli command.Cli) *cobra.Command {
opts := createOpts{}
cmd := &cobra.Command{
Use: "create MANFEST_LIST MANIFEST [MANIFEST...]",
Use: "create MANIFEST_LIST MANIFEST [MANIFEST...]",
Short: "Create a local manifest list for annotating and pushing to a registry",
Args: cli.RequiresMinArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
@@ -30,7 +30,7 @@ func newCreateListCommand(dockerCli command.Cli) *cobra.Command {
}
flags := cmd.Flags()
flags.BoolVar(&opts.insecure, "insecure", false, "allow communication with an insecure registry")
flags.BoolVar(&opts.insecure, "insecure", false, "Allow communication with an insecure registry")
flags.BoolVarP(&opts.amend, "amend", "a", false, "Amend an existing manifest list")
return cmd
}
@@ -43,7 +43,7 @@ func newInspectCommand(dockerCli command.Cli) *cobra.Command {
}
flags := cmd.Flags()
flags.BoolVar(&opts.insecure, "insecure", false, "allow communication with an insecure registry")
flags.BoolVar(&opts.insecure, "insecure", false, "Allow communication with an insecure registry")
flags.BoolVarP(&opts.verbose, "verbose", "v", false, "Output additional info including layers and platform")
return cmd
}
@@ -46,10 +46,10 @@ func TestNetworkConnectErrors(t *testing.T) {
func TestNetworkConnectWithFlags(t *testing.T) {
expectedOpts := []network.IPAMConfig{
{
"192.168.4.0/24",
"192.168.4.0/24",
"192.168.4.1/24",
map[string]string{},
Subnet: "192.168.4.0/24",
IPRange: "192.168.4.0/24",
Gateway: "192.168.4.1/24",
AuxAddress: map[string]string{},
},
}
cli := test.NewFakeCli(&fakeClient{
@@ -146,10 +146,10 @@ func TestNetworkCreateWithFlags(t *testing.T) {
expectedDriver := "foo"
expectedOpts := []network.IPAMConfig{
{
"192.168.4.0/24",
"192.168.4.0/24",
"192.168.4.1/24",
map[string]string{},
Subnet: "192.168.4.0/24",
IPRange: "192.168.4.0/24",
Gateway: "192.168.4.1/24",
AuxAddress: map[string]string{},
},
}
cli := test.NewFakeCli(&fakeClient{
+2 -3
View File
@@ -124,9 +124,8 @@ func buildPullConfig(ctx context.Context, dockerCli command.Cli, opts pluginOpti
Disabled: opts.disable,
AcceptAllPermissions: opts.grantPerms,
AcceptPermissionsFunc: acceptPrivileges(dockerCli, opts.remote),
// TODO: Rename PrivilegeFunc, it has nothing to do with privileges
PrivilegeFunc: registryAuthFunc,
Args: opts.args,
PrivilegeFunc: registryAuthFunc,
Args: opts.args,
}
return options, nil
}
@@ -40,7 +40,6 @@ func runRemove(dockerCli command.Cli, opts *rmOptions) error {
var errs cli.Errors
for _, name := range opts.plugins {
// TODO: pass names to api instead of making multiple api calls
if err := dockerCli.Client().PluginRemove(ctx, name, types.PluginRemoveOptions{Force: opts.force}); err != nil {
errs = append(errs, err)
continue
+9 -16
View File
@@ -55,22 +55,15 @@ func NewLoginCommand(dockerCli command.Cli) *cobra.Command {
return cmd
}
// unencryptedPrompt prompts the user to find out whether they want to continue
// with insecure credential storage. If stdin is not a terminal, we assume they
// want it (sadly), because people may have been scripting insecure logins and
// we don't want to break them. Maybe they'll see the warning in their logs and
// fix things.
func unencryptedPrompt(dockerCli command.Streams, filename string) error {
fmt.Fprintln(dockerCli.Err(), fmt.Sprintf(unencryptedWarning, filename))
// displayUnencryptedWarning warns the user when using an insecure credential storage.
// After a deprecation period, user will get prompted if stdin and stderr are a terminal.
// Otherwise, we'll assume they want it (sadly), because people may have been scripting
// insecure logins and we don't want to break them. Maybe they'll see the warning in their
// logs and fix things.
func displayUnencryptedWarning(dockerCli command.Streams, filename string) error {
_, err := fmt.Fprintln(dockerCli.Err(), fmt.Sprintf(unencryptedWarning, filename))
if dockerCli.In().IsTerminal() {
if command.PromptForConfirmation(dockerCli.In(), dockerCli.Out(), "") {
return nil
}
return errors.Errorf("User refused unencrypted credentials storage.")
}
return nil
return err
}
type isFileStore interface {
@@ -146,7 +139,7 @@ func runLogin(dockerCli command.Cli, opts loginOptions) error { //nolint: gocycl
store, isDefault := creds.(isFileStore)
if isDefault {
err = unencryptedPrompt(dockerCli, store.GetFilename())
err = displayUnencryptedWarning(dockerCli, store.GetFilename())
if err != nil {
return err
}
@@ -55,9 +55,9 @@ func TestHealthCheckOptionsToHealthConfig(t *testing.T) {
dur := time.Second
opt := healthCheckOptions{
cmd: "curl",
interval: opts.PositiveDurationOpt{*opts.NewDurationOpt(&dur)},
timeout: opts.PositiveDurationOpt{*opts.NewDurationOpt(&dur)},
startPeriod: opts.PositiveDurationOpt{*opts.NewDurationOpt(&dur)},
interval: opts.PositiveDurationOpt{DurationOpt: *opts.NewDurationOpt(&dur)},
timeout: opts.PositiveDurationOpt{DurationOpt: *opts.NewDurationOpt(&dur)},
startPeriod: opts.PositiveDurationOpt{DurationOpt: *opts.NewDurationOpt(&dur)},
retries: 10,
}
config, err := opt.toHealthConfig()
@@ -50,8 +50,8 @@ func TestKubernetesServiceToSwarmServiceConversion(t *testing.T) {
makeSwarmService("stack_service2", "uid2", nil),
},
map[string]formatter.ServiceListInfo{
"uid1": {"replicated", "2/5"},
"uid2": {"replicated", "3/3"},
"uid1": {Mode: "replicated", Replicas: "2/5"},
"uid2": {Mode: "replicated", Replicas: "3/3"},
},
},
// Headless service and LoadBalancer Service are tied to the same Swarm service
@@ -84,7 +84,7 @@ func TestKubernetesServiceToSwarmServiceConversion(t *testing.T) {
}),
},
map[string]formatter.ServiceListInfo{
"uid1": {"replicated", "1/1"},
"uid1": {Mode: "replicated", Replicas: "1/1"},
},
},
// Headless service and NodePort Service are tied to the same Swarm service
@@ -118,7 +118,7 @@ func TestKubernetesServiceToSwarmServiceConversion(t *testing.T) {
}),
},
map[string]formatter.ServiceListInfo{
"uid1": {"replicated", "1/1"},
"uid1": {Mode: "replicated", Replicas: "1/1"},
},
},
}
@@ -248,6 +248,12 @@ func deployServices(
// service update.
serviceSpec.TaskTemplate.ContainerSpec.Image = service.Spec.TaskTemplate.ContainerSpec.Image
}
// Stack deploy does not have a `--force` option. Preserve existing ForceUpdate
// value so that tasks are not re-deployed if not updated.
// TODO move this to API client?
serviceSpec.TaskTemplate.ForceUpdate = service.Spec.TaskTemplate.ForceUpdate
response, err := apiClient.ServiceUpdate(
ctx,
service.ID,
@@ -27,7 +27,8 @@ func TestPruneServices(t *testing.T) {
}
// TestServiceUpdateResolveImageChanged tests that the service's
// image digest is preserved if the image did not change in the compose file
// image digest, and "ForceUpdate" is preserved if the image did not change in
// the compose file
func TestServiceUpdateResolveImageChanged(t *testing.T) {
namespace := convert.NewNamespace("mystack")
@@ -49,6 +50,7 @@ func TestServiceUpdateResolveImageChanged(t *testing.T) {
ContainerSpec: &swarm.ContainerSpec{
Image: "foobar:1.2.3@sha256:deadbeef",
},
ForceUpdate: 123,
},
},
},
@@ -65,18 +67,21 @@ func TestServiceUpdateResolveImageChanged(t *testing.T) {
image string
expectedQueryRegistry bool
expectedImage string
expectedForceUpdate uint64
}{
// Image not changed
{
image: "foobar:1.2.3",
expectedQueryRegistry: false,
expectedImage: "foobar:1.2.3@sha256:deadbeef",
expectedForceUpdate: 123,
},
// Image changed
{
image: "foobar:1.2.4",
expectedQueryRegistry: true,
expectedImage: "foobar:1.2.4",
expectedForceUpdate: 123,
},
}
@@ -95,8 +100,9 @@ func TestServiceUpdateResolveImageChanged(t *testing.T) {
}
err := deployServices(ctx, client, spec, namespace, false, ResolveImageChanged)
assert.NilError(t, err)
assert.Check(t, is.Equal(testcase.expectedQueryRegistry, receivedOptions.QueryRegistry))
assert.Check(t, is.Equal(testcase.expectedImage, receivedService.TaskTemplate.ContainerSpec.Image))
assert.Check(t, is.Equal(receivedOptions.QueryRegistry, testcase.expectedQueryRegistry))
assert.Check(t, is.Equal(receivedService.TaskTemplate.ContainerSpec.Image, testcase.expectedImage))
assert.Check(t, is.Equal(receivedService.TaskTemplate.ForceUpdate, testcase.expectedForceUpdate))
receivedService = swarm.ServiceSpec{}
receivedOptions = types.ServiceUpdateOptions{}
-15
View File
@@ -176,21 +176,6 @@ func prettyPrintInfo(dockerCli command.Cli, info types.Info) error {
for _, lbl := range info.Labels {
fmt.Fprintln(dockerCli.Out(), " "+lbl)
}
// TODO: Engine labels with duplicate keys has been deprecated in 1.13 and will be error out
// after 3 release cycles (17.12). For now, a WARNING will be generated. The following will
// be removed eventually.
labelMap := map[string]string{}
for _, label := range info.Labels {
stringSlice := strings.SplitN(label, "=", 2)
if len(stringSlice) > 1 {
// If there is a conflict we will throw out a warning
if v, ok := labelMap[stringSlice[0]]; ok && v != stringSlice[1] {
fmt.Fprintln(dockerCli.Err(), "WARNING: labels with duplicate keys and conflicting values have been deprecated")
break
}
labelMap[stringSlice[0]] = stringSlice[1]
}
}
}
fmt.Fprintln(dockerCli.Out(), "Experimental:", info.ExperimentalBuild)
+5 -3
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"runtime"
"sort"
"text/tabwriter"
"text/template"
"time"
@@ -200,11 +201,12 @@ func runVersion(dockerCli command.Cli, opts *versionOptions) error {
})
}
}
if err2 := tmpl.Execute(dockerCli.Out(), vd); err2 != nil && err == nil {
t := tabwriter.NewWriter(dockerCli.Out(), 15, 1, 1, ' ', 0)
if err2 := tmpl.Execute(t, vd); err2 != nil && err == nil {
err = err2
}
dockerCli.Out().Write([]byte{'\n'})
t.Write([]byte("\n"))
t.Flush()
return err
}
@@ -189,7 +189,7 @@ func mockDelegationRoleWithName(name string) data.DelegationRole {
data.RoleName(name),
notary.MinThreshold,
)
return data.DelegationRole{baseRole, []string{}}
return data.DelegationRole{BaseRole: baseRole, Paths: []string{}}
}
func TestMatchEmptySignatures(t *testing.T) {
+5 -5
View File
@@ -61,7 +61,7 @@ func mergeServices(base, override []types.ServiceConfig) ([]types.ServiceConfig,
}
for name, overrideService := range overrideServices {
if baseService, ok := baseServices[name]; ok {
if err := mergo.Merge(&baseService, &overrideService, mergo.WithOverride, mergo.WithTransformers(specials)); err != nil {
if err := mergo.Merge(&baseService, &overrideService, mergo.WithAppendSlice, mergo.WithOverride, mergo.WithTransformers(specials)); err != nil {
return base, errors.Wrapf(err, "cannot merge service %s", name)
}
baseServices[name] = baseService
@@ -213,21 +213,21 @@ func mapByName(services []types.ServiceConfig) map[string]types.ServiceConfig {
}
func mergeVolumes(base, override map[string]types.VolumeConfig) (map[string]types.VolumeConfig, error) {
err := mergo.Map(&base, &override)
err := mergo.Map(&base, &override, mergo.WithOverride)
return base, err
}
func mergeNetworks(base, override map[string]types.NetworkConfig) (map[string]types.NetworkConfig, error) {
err := mergo.Map(&base, &override)
err := mergo.Map(&base, &override, mergo.WithOverride)
return base, err
}
func mergeSecrets(base, override map[string]types.SecretConfig) (map[string]types.SecretConfig, error) {
err := mergo.Map(&base, &override)
err := mergo.Map(&base, &override, mergo.WithOverride)
return base, err
}
func mergeConfigs(base, override map[string]types.ConfigObjConfig) (map[string]types.ConfigObjConfig, error) {
err := mergo.Map(&base, &override)
err := mergo.Map(&base, &override, mergo.WithOverride)
return base, err
}
@@ -711,7 +711,7 @@ func TestLoadMultipleUlimits(t *testing.T) {
}
}
func TestLoadMultipleNetworks(t *testing.T) {
func TestLoadMultipleServiceNetworks(t *testing.T) {
networkCases := []struct {
name string
networkBase map[string]interface{}
@@ -943,3 +943,74 @@ func TestLoadMultipleConfigs(t *testing.T) {
Configs: map[string]types.ConfigObjConfig{},
}, config)
}
// Issue#972
func TestLoadMultipleNetworks(t *testing.T) {
base := map[string]interface{}{
"version": "3.4",
"services": map[string]interface{}{
"foo": map[string]interface{}{
"image": "baz",
},
},
"volumes": map[string]interface{}{},
"networks": map[string]interface{}{
"hostnet": map[string]interface{}{
"driver": "overlay",
"ipam": map[string]interface{}{
"driver": "default",
"config": []interface{}{
map[string]interface{}{
"subnet": "10.0.0.0/20",
},
},
},
},
},
"secrets": map[string]interface{}{},
"configs": map[string]interface{}{},
}
override := map[string]interface{}{
"version": "3.4",
"services": map[string]interface{}{},
"volumes": map[string]interface{}{},
"networks": map[string]interface{}{
"hostnet": map[string]interface{}{
"external": map[string]interface{}{
"name": "host",
},
},
},
"secrets": map[string]interface{}{},
"configs": map[string]interface{}{},
}
configDetails := types.ConfigDetails{
ConfigFiles: []types.ConfigFile{
{Filename: "base.yml", Config: base},
{Filename: "override.yml", Config: override},
},
}
config, err := Load(configDetails)
assert.NilError(t, err)
assert.DeepEqual(t, &types.Config{
Filename: "base.yml",
Version: "3.4",
Services: []types.ServiceConfig{
{
Name: "foo",
Image: "baz",
Environment: types.MappingWithEquals{},
}},
Networks: map[string]types.NetworkConfig{
"hostnet": {
Name: "host",
External: types.External{
External: true,
},
},
},
Volumes: map[string]types.VolumeConfig{},
Secrets: map[string]types.SecretConfig{},
Configs: map[string]types.ConfigObjConfig{},
}, config)
}
+3 -1
View File
@@ -41,6 +41,8 @@ var (
ActionsPullOnly = []string{"pull"}
// ActionsPushAndPull defines the actions for read-write interactions with a Notary Repository
ActionsPushAndPull = []string{"pull", "push"}
// NotaryServer is the endpoint serving the Notary trust server
NotaryServer = "https://notary.docker.io"
)
// GetTrustDirectory returns the base trust directory name
@@ -71,7 +73,7 @@ func Server(index *registrytypes.IndexInfo) (string, error) {
return s, nil
}
if index.Official {
return registry.NotaryServer, nil
return NotaryServer, nil
}
return "https://" + index.Name, nil
}
+12 -4
View File
@@ -1220,14 +1220,18 @@ _docker_config_create() {
--label|-l)
return
;;
--template-driver)
COMPREPLY=( $( compgen -W "golang" -- "$cur" ) )
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help --label -l" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--help --label -l --template-driver" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '--label|-l')
local counter=$(__docker_pos_first_nonflag '--label|-l|--template-driver')
if [ "$cword" -eq "$((counter + 1))" ]; then
_filedir
fi
@@ -4238,14 +4242,18 @@ _docker_secret_create() {
--driver|-d|--label|-l)
return
;;
--template-driver)
COMPREPLY=( $( compgen -W "golang" -- "$cur" ) )
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--driver -d --help --label -l" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--driver -d --help --label -l --template-driver" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '--driver|-d|--label|-l')
local counter=$(__docker_pos_first_nonflag '--driver|-d|--label|-l|--template-driver')
if [ "$cword" -eq "$((counter + 1))" ]; then
_filedir
fi
@@ -16,7 +16,7 @@
function __fish_docker_no_subcommand --description 'Test if docker has yet to be given the subcommand'
for i in (commandline -opc)
if contains -- $i attach build commit cp create diff events exec export history images import info inspect kill load login logout logs pause port ps pull push rename restart rm rmi run save search start stop tag top unpause version wait stats
if contains -- $i attach build commit cp create diff events exec export history images import info inspect kill load login logout logs pause port ps pull push rename restart rm rmi run save search start stop tag top trust unpause version wait stats
return 1
end
end
@@ -34,6 +34,40 @@ function __fish_print_docker_containers --description 'Print a list of docker co
end
end
function __fish_docker_no_subcommand_trust --description 'Test if docker has yet to be given the trust subcommand'
if __fish_seen_subcommand_from trust
for i in (commandline -opc)
if contains -- $i inspect key revoke sign signer
return 1
end
end
return 0
end
return 1
end
function __fish_docker_subcommand_path --description 'Test if command has all arguments in any order'
set -l cmd (commandline -poc)
set -e cmd[1]
for sub in $argv
if not contains -- $sub $cmd
return 1
end
end
return 0
end
function __fish_docker_subcommand_path_without --description 'Test if command has all arguments in any order'
set -l cmd (commandline -poc)
set -e cmd[1]
for sub in $argv
if contains -- $sub $cmd
return 1
end
end
return 0
end
function __fish_print_docker_images --description 'Print a list of docker images'
docker images --format "{{.Repository}}:{{.Tag}}" | command grep -v '<none>'
end
@@ -396,6 +430,34 @@ complete -c docker -f -n '__fish_docker_no_subcommand' -a top -d 'Lookup the run
complete -c docker -A -f -n '__fish_seen_subcommand_from top' -l help -d 'Print usage'
complete -c docker -A -f -n '__fish_seen_subcommand_from top' -a '(__fish_print_docker_containers running)' -d "Container"
#trust
complete -c docker -f -n '__fish_docker_no_subcommand' -a trust -d 'Manage trust on Docker images'
complete -c docker -A -f -n '__fish_seen_subcommand_from trust' -l help -d 'Print usage'
#trust inspect
complete -c docker -A -f -n '__fish_docker_no_subcommand_trust' -a inspect -d 'Return low-level information about keys and signatures'
complete -c docker -A -f -n '__fish_docker_subcommand_path trust inspect' -l pretty -d 'Print the information in a human friendly format'
#trust key
complete -c docker -A -f -n '__fish_docker_no_subcommand_trust' -a key -d 'Manage keys for signing Docker images'
complete -c docker -A -f -n '__fish_docker_subcommand_path trust key; and __fish_docker_subcommand_path_without generate load' -a generate -d 'Generate and load a signing key-pair'
complete -c docker -A -f -n '__fish_docker_subcommand_path trust key load' -l dir -d 'Directory to generate key in, defaults to current directory'
complete -c docker -A -f -n '__fish_docker_subcommand_path trust key; and __fish_docker_subcommand_path_without generate load' -a load -d 'Load a private key file for signing'
complete -c docker -A -f -n '__fish_docker_subcommand_path trust key load' -l name -d 'Name for the loaded key (default "signer")'
#trust revoke
complete -c docker -A -f -n '__fish_docker_no_subcommand_trust' -a revoke -d 'Remove trust for an image'
complete -c docker -A -f -n '__fish_docker_subcommand_path trust revoke' -s y -l yes -d 'Do not prompt for confirmation'
#trust sign
complete -c docker -A -f -n '__fish_docker_no_subcommand_trust' -a sign -d 'Sign an image'
complete -c docker -A -f -n '__fish_docker_subcommand_path trust sign' -l local -d 'Sign a locally tagged image'
#trust signer
complete -c docker -A -f -n '__fish_docker_no_subcommand_trust' -a signer -d 'Manage entities who can sign Docker images'
complete -c docker -A -f -n '__fish_docker_subcommand_path trust signer; and __fish_docker_subcommand_path_without add remove' -a add -d 'Add a signer'
complete -c docker -A -f -n '__fish_docker_subcommand_path trust signer; and __fish_docker_subcommand_path_without add remove' -a remove -d 'remove a signer'
# unpause
complete -c docker -f -n '__fish_docker_no_subcommand' -a unpause -d 'Unpause a paused container'
complete -c docker -A -f -n '__fish_seen_subcommand_from unpause' -a '(__fish_print_docker_containers running)' -d "Container"
@@ -1,4 +1,4 @@
FROM golang:1.9.4-alpine3.6
FROM golang:1.9.5-alpine3.6
RUN apk add -U git bash coreutils gcc musl-dev
+1 -1
View File
@@ -1,3 +1,3 @@
FROM dockercore/golang-cross:1.9.4@sha256:b8d43ef11ccaa15bec63a1f1fd0c28a0e729074aa62fcfa51f0a5888f3571315
FROM dockercore/golang-cross:1.9.5@sha256:4d090b8c2e6d369a48254c882a4e653ba90caaa0b758105da772d9110394d958
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
WORKDIR /go/src/github.com/docker/cli
+1 -1
View File
@@ -1,5 +1,5 @@
FROM golang:1.9.4-alpine3.6
FROM golang:1.9.5-alpine3.6
RUN apk add -U git make bash coreutils ca-certificates curl
+1 -1
View File
@@ -1,4 +1,4 @@
FROM golang:1.9.4-alpine3.6
FROM golang:1.9.5-alpine3.6
RUN apk add -U git
+8 -6
View File
@@ -218,20 +218,22 @@ plugins. This is specifically useful to collect plugin logs if they are
redirected to a file.
```bash
$ docker-runc list
ID PID STATUS BUNDLE CREATED
f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62 2679 running /run/docker/libcontainerd/f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62 2017-02-06T21:53:03.031537592Z
r
$ sudo docker-runc --root /var/run/docker/plugins/runtime-root/moby-plugins list
ID PID STATUS BUNDLE CREATED OWNER
93f1e7dbfe11c938782c2993628c895cf28e2274072c4a346a6002446c949b25 15806 running /run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby-plugins/93f1e7dbfe11c938782c2993628c895cf28e2274072c4a346a6002446c949b25 2018-02-08T21:40:08.621358213Z root
9b4606d84e06b56df84fadf054a21374b247941c94ce405b0a261499d689d9c9 14992 running /run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby-plugins/9b4606d84e06b56df84fadf054a21374b247941c94ce405b0a261499d689d9c9 2018-02-08T21:35:12.321325872Z root
c5bb4b90941efcaccca999439ed06d6a6affdde7081bb34dc84126b57b3e793d 14984 running /run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby-plugins/c5bb4b90941efcaccca999439ed06d6a6affdde7081bb34dc84126b57b3e793d 2018-02-08T21:35:12.321288966Z root
```
```bash
$ docker-runc exec f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62 cat /var/log/plugin.log
$ sudo docker-runc --root /var/run/docker/plugins/runtime-root/moby-plugins exec 93f1e7dbfe11c938782c2993628c895cf28e2274072c4a346a6002446c949b25 cat /var/log/plugin.log
```
If the plugin has a built-in shell, then exec into the plugin can be done as
follows:
```bash
$ docker-runc exec -t f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62 sh
$ sudo docker-runc --root /var/run/docker/plugins/runtime-root/moby-plugins exec -t 93f1e7dbfe11c938782c2993628c895cf28e2274072c4a346a6002446c949b25 sh
```
#### Using curl to debug plugin socket issues.
@@ -411,13 +411,13 @@ files. The `ARG` instruction lets Dockerfile authors define values that users
can set at build-time using the `--build-arg` flag:
```bash
$ docker build --build-arg HTTP_PROXY=http://10.20.30.2:1234 .
$ docker build --build-arg HTTP_PROXY=http://10.20.30.2:1234 --build-arg FTP_PROXY=http://40.50.60.5:4567 .
```
This flag allows you to pass the build-time variables that are
accessed like regular environment variables in the `RUN` instruction of the
Dockerfile. Also, these values don't persist in the intermediate or final images
like `ENV` values do.
like `ENV` values do. You must add `--build-arg` for each build argument.
Using this flag will not alter the output you see when the `ARG` lines from the
Dockerfile are echoed during the build process.
@@ -425,6 +425,18 @@ Dockerfile are echoed during the build process.
For detailed information on using `ARG` and `ENV` instructions, see the
[Dockerfile reference](../builder.md).
You may also use the `--build-arg` flag without a value, in which case the value
from the local environment will be propagated into the Docker container being
built:
```bash
$ export HTTP_PROXY=http://10.20.30.2:1234
$ docker build --build-arg HTTP_PROXY .
```
This is similar to how `docker run -e` works. Refer to the [`docker run` documentation](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file)
for more information.
### Optional security options (--security-opt)
This flag is only supported on a daemon running on Windows, and only supports
@@ -504,7 +516,7 @@ section in the userguide for more information.
The `--squash` option has a number of known limitations:
- When squashing layers, the resulting image cannot take advantage of layer
- When squashing layers, the resulting image cannot take advantage of layer
sharing with other images, and may use significantly more space. Sharing the
base image is still supported.
- When using this option you may see significantly more space used due to
@@ -581,7 +593,7 @@ $ docker build --squash -t test .
If everything is right, the history will look like this:
```bash
$ docker history test
$ docker history test
IMAGE CREATED CREATED BY SIZE COMMENT
4e10cb5b4cac 3 seconds ago 12 B merge sha256:88a7b0112a41826885df0e7072698006ee8f621c6ab99fca7fe9151d7b599702 to sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb
@@ -77,17 +77,11 @@ output the data exactly as the template declares or, when using the
`table` directive, will include column headers as well.
The following example uses a template without headers and outputs the
`ID` and `CreatedSince` entries separated by a colon for all images:
`ID` and `CreatedSince` entries separated by a colon for the `busybox` image:
```bash
$ docker images --format "{{.ID}}: {{.Created}} ago"
$ docker history --format "{{.ID}}: {{.CreatedAt}}" busybox
cc1b61406712: 2 weeks ago
<missing>: 2 weeks ago
<missing>: 2 weeks ago
<missing>: 2 weeks ago
<missing>: 2 weeks ago
<missing>: 3 weeks ago
<missing>: 3 weeks ago
<missing>: 3 weeks ago
f6e427c148a7: 4 weeks ago
<missing>: 4 weeks ago
```
@@ -35,7 +35,7 @@ bzip2, or xz) from a file or STDIN. It restores both images and tags.
## Examples
```bash
$ docker docker image ls
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
@@ -44,7 +44,7 @@ an image name in `docker pull` and `docker run` commands, for example.
Ideally a manifest list is created from images that are identical in function for
different os/arch combinations. For this reason, manifest lists are often referred to as
"multi-arch images." However, a user could create a manifest list that points
"multi-arch images". However, a user could create a manifest list that points
to two images -- one for windows on amd64, and one for darwin on amd64.
### manifest inspect
@@ -54,25 +54,25 @@ manifest inspect --help
Usage: docker manifest inspect [OPTIONS] [MANIFEST_LIST] MANIFEST
isplay an image manifest, or manifest list
Display an image manifest, or manifest list
Options:
--help Print usage
--insecure allow communication with an insecure registry
--insecure Allow communication with an insecure registry
-v, --verbose Output additional info including layers and platform
```
### manifest create
```bash
Usage: docker manifest create MANFEST_LIST MANIFEST [MANIFEST...]
Usage: docker manifest create MANIFEST_LIST MANIFEST [MANIFEST...]
Create a local manifest list for annotating and pushing to a registry
Options:
-a, --amend Amend an existing manifest list
--insecure allow communication with an insecure registry
--help Print usage
-a, --amend Amend an existing manifest list
--insecure Allow communication with an insecure registry
--help Print usage
```
### manifest annotate
@@ -97,9 +97,9 @@ Usage: docker manifest push [OPTIONS] MANIFEST_LIST
Push a manifest list to a repository
Options:
--help Print usage
--insecure allow push to an insecure registry
-p, --purge Remove the local manifest list after push
--help Print usage
--insecure Allow push to an insecure registry
-p, --purge Remove the local manifest list after push
```
### Working with insecure registries
@@ -108,7 +108,7 @@ The manifest command interacts solely with a Docker registry. Because of this, i
## Examples
### inspect an image's manifest object
### Inspect an image's manifest object
```bash
$ docker manifest inspect hello-world
@@ -141,7 +141,7 @@ without a tag, or by digest (e.g. hello-world@sha256:f3b3b28a45160805bb16542c953
Here is an example of inspecting an image's manifest with the `--verbose` flag:
```bash
$ docker manifest inspect -v hello-world
$ docker manifest inspect --verbose hello-world
{
"Ref": "docker.io/library/hello-world:latest",
"Digest": "sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f",
@@ -27,7 +27,7 @@ Options:
## Description
Creates a secret using standard input or from a file for the secret content. You must run this command on a manager node.
Creates a secret using standard input or from a file for the secret content. You must run this command on a manager node.
For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/).
@@ -36,7 +36,7 @@ For detailed information about using secrets, refer to [manage sensitive data wi
### Create a secret
```bash
$ echo <secret> | docker secret create my_secret -
$ printf <secret> | docker secret create my_secret -
onakdyv307se2tl7nl20anokv
@@ -81,7 +81,7 @@ configuration and environment-specific overrides, you can provide multiple
`--compose-file` flags.
```bash
$ docker stack deploy --compose-file docker-compose.yml -f docker-compose.prod.yml vossibility
$ docker stack deploy --compose-file docker-compose.yml -c docker-compose.prod.yml vossibility
Ignoring unsupported options: links
+3 -2
View File
@@ -1,6 +1,7 @@
package container
import (
"fmt"
"strings"
"testing"
@@ -19,8 +20,8 @@ func TestAttachExitCode(t *testing.T) {
}
func runBackgroundContainsWithExitCode(t *testing.T, exitcode int) string {
result := icmd.RunCmd(shell(t,
"docker run -d -i --rm %s sh -c 'read; exit %d'", fixtures.AlpineImage, exitcode))
result := icmd.RunCommand("docker", "run", "-d", "-i", "--rm", fixtures.AlpineImage,
"sh", "-c", fmt.Sprintf("read; exit %d", exitcode))
result.Assert(t, icmd.Success)
return strings.TrimSpace(result.Stdout())
}
+2 -5
View File
@@ -32,17 +32,14 @@ func TestKillContainer(t *testing.T) {
}
func runBackgroundTop(t *testing.T) string {
result := icmd.RunCmd(shell(t,
"docker run -d %s top", fixtures.AlpineImage))
result := icmd.RunCommand("docker", "run", "-d", fixtures.AlpineImage, "top")
result.Assert(t, icmd.Success)
return strings.TrimSpace(result.Stdout())
}
func containerStatus(t *testing.T, containerID, status string) func(poll.LogT) poll.Result {
return func(poll.LogT) poll.Result {
result := icmd.RunCmd(
shell(t, "docker inspect -f '{{ .State.Status }}' %s", containerID),
)
result := icmd.RunCommand("docker", "inspect", "-f", "{{ .State.Status }}", containerID)
result.Assert(t, icmd.Success)
actual := strings.TrimSpace(result.Stdout())
if actual == status {
+2 -10
View File
@@ -5,7 +5,6 @@ import (
"testing"
"github.com/docker/cli/e2e/internal/fixtures"
shlex "github.com/flynn-archive/go-shlex"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"github.com/gotestyourself/gotestyourself/golden"
@@ -17,8 +16,8 @@ const registryPrefix = "registry:5000"
func TestRunAttachedFromRemoteImageAndRemove(t *testing.T) {
image := createRemoteImage(t)
result := icmd.RunCmd(shell(t,
"docker run --rm %s echo this is output", image))
result := icmd.RunCommand("docker", "run", "--rm", image,
"echo", "this", "is", "output")
result.Assert(t, icmd.Success)
assert.Check(t, is.Equal("this is output\n", result.Stdout()))
@@ -54,10 +53,3 @@ func createRemoteImage(t *testing.T) string {
icmd.RunCommand("docker", "rmi", image).Assert(t, icmd.Success)
return image
}
// TODO: move to gotestyourself
func shell(t *testing.T, format string, args ...interface{}) icmd.Cmd {
cmd, err := shlex.Split(fmt.Sprintf(format, args...))
assert.NilError(t, err)
return icmd.Cmd{Command: cmd}
}
@@ -24,6 +24,7 @@ const (
//SetupConfigFile creates a config.json file for testing
func SetupConfigFile(t *testing.T) fs.Dir {
t.Helper()
dir := fs.NewDir(t, "trust_test", fs.WithMode(0700), fs.WithFile("config.json", `
{
"auths": {
@@ -97,12 +98,14 @@ func WithNotaryServer(notaryURL string) func(*icmd.Cmd) {
// CreateMaskedTrustedRemoteImage creates a remote image that is signed with
// content trust, then pushes a different untrusted image at the same tag.
func CreateMaskedTrustedRemoteImage(t *testing.T, registryPrefix, repo, tag string) string {
t.Helper()
image := createTrustedRemoteImage(t, registryPrefix, repo, tag)
createNamedUnsignedImageFromBusyBox(t, image)
return image
}
func createTrustedRemoteImage(t *testing.T, registryPrefix, repo, tag string) string {
t.Helper()
image := fmt.Sprintf("%s/%s:%s", registryPrefix, repo, tag)
icmd.RunCommand("docker", "image", "pull", AlpineImage).Assert(t, icmd.Success)
icmd.RunCommand("docker", "image", "tag", AlpineImage, image).Assert(t, icmd.Success)
@@ -115,6 +118,7 @@ func createTrustedRemoteImage(t *testing.T, registryPrefix, repo, tag string) st
}
func createNamedUnsignedImageFromBusyBox(t *testing.T, image string) {
t.Helper()
icmd.RunCommand("docker", "image", "pull", BusyboxImage).Assert(t, icmd.Success)
icmd.RunCommand("docker", "image", "tag", BusyboxImage, image).Assert(t, icmd.Success)
icmd.RunCommand("docker", "image", "push", image).Assert(t, icmd.Success)
+3 -13
View File
@@ -1,13 +1,10 @@
package stack
import (
"fmt"
"strings"
"testing"
"github.com/docker/cli/internal/test/environment"
shlex "github.com/flynn-archive/go-shlex"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/gotestyourself/gotestyourself/icmd"
"github.com/gotestyourself/gotestyourself/poll"
@@ -20,7 +17,7 @@ func TestRemove(t *testing.T) {
deployFullStack(t, stackname)
defer cleanupFullStack(t, stackname)
result := icmd.RunCmd(shell(t, "docker stack rm %s", stackname))
result := icmd.RunCommand("docker", "stack", "rm", stackname)
result.Assert(t, icmd.Expected{Err: icmd.None})
golden.Assert(t, result.Stdout(), "stack-remove-success.golden")
@@ -28,8 +25,8 @@ func TestRemove(t *testing.T) {
func deployFullStack(t *testing.T, stackname string) {
// TODO: this stack should have full options not minimal options
result := icmd.RunCmd(shell(t,
"docker stack deploy --compose-file=./testdata/full-stack.yml %s", stackname))
result := icmd.RunCommand("docker", "stack", "deploy",
"--compose-file=./testdata/full-stack.yml", stackname)
result.Assert(t, icmd.Success)
poll.WaitOn(t, taskCount(stackname, 2), pollSettings)
@@ -66,10 +63,3 @@ func taskCount(stackname string, expected int) func(t poll.LogT) poll.Result {
func lines(out string) int {
return len(strings.Split(strings.TrimSpace(out), "\n"))
}
// TODO: move to gotestyourself
func shell(t *testing.T, format string, args ...interface{}) icmd.Cmd {
cmd, err := shlex.Split(fmt.Sprintf(format, args...))
assert.NilError(t, err)
return icmd.Cmd{Command: cmd}
}
@@ -9,6 +9,7 @@ import (
// Assert checks wether the output contains the specified lines
func Assert(t *testing.T, actual string, expectedLines map[int]func(string) error) {
t.Helper()
for i, line := range strings.Split(actual, "\n") {
cmp, ok := expectedLines[i]
if !ok {
+3 -6
View File
@@ -5,7 +5,7 @@ github.com/coreos/etcd v3.2.1
github.com/cpuguy83/go-md2man v1.0.8
github.com/davecgh/go-spew 346938d642f2ec3594ed81d874461961cd0faa76
github.com/docker/distribution edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c
github.com/docker/docker ae7016427f8cba4e4d8fcb979d6ba313ee2c0702
github.com/docker/docker ed7b6428c133e7c59404251a09b7d6b02fa83cc2
github.com/docker/docker-credential-helpers 3c90bd29a46b943b2a9842987b58fb91a7c1819b
# the docker/go package contains a customized version of canonical/json
# and is used by Notary. The package is periodically rebased on current Go versions.
@@ -28,16 +28,14 @@ github.com/googleapis/gnostic e4f56557df6250e1945ee6854f181ce4e1c2c646
github.com/gorilla/context v1.1
github.com/gorilla/mux v1.1
github.com/gotestyourself/gotestyourself cf3a5ab914a2efa8bc838d09f5918c1d44d02909
# FIXME(vdemeester) try to deduplicate this with gojsonpointer
github.com/go-openapi/jsonpointer 46af16f9f7b149af66e5d1bd010e3574dc06de98
# FIXME(vdemeester) try to deduplicate this with gojsonreference
github.com/go-openapi/jsonreference 13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272
github.com/go-openapi/spec 6aced65f8501fe1217321abf0749d354824ba2ff
github.com/go-openapi/swag 1d0bd113de87027671077d3c71eb3ac5d7dbba72
github.com/gregjones/httpcache c1f8028e62adb3d518b823a2f8e6a95c38bdd3aa
github.com/grpc-ecosystem/grpc-gateway 1a03ca3bad1e1ebadaedd3abb76bc58d4ac8143b
github.com/howeyc/gopass 3ca23474a7c7203e0a0a070fd33508f6efdb9b3d
github.com/imdario/mergo ea74e0177b4df59af68c076af5008b427d00d40f
github.com/imdario/mergo 9d5f1277e9a8ed20c3684bda8fde67c05628518c # v0.3.4
github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
github.com/juju/ratelimit 5b9ff866471762aa2ab2dced63c9fb6f53921342
github.com/json-iterator/go 6240e1e7983a85228f7fd9c3e1b6932d46ec58e2
@@ -61,8 +59,7 @@ github.com/shurcooL/sanitized_anchor_name 10ef21a441db47d8b13ebcc5fd2310f636973c
github.com/sirupsen/logrus v1.0.3
github.com/spf13/cobra 34ceca591bcf34a17a8b7bad5b3ce5f9c165bee5
github.com/spf13/pflag 97afa5e7ca8a08a383cb259e06636b5e2cc7897f
github.com/stretchr/testify 4d4bfba8f1d1027c4fdbe371823030df51419987
github.com/theupdateframework/notary v0.6.0
github.com/theupdateframework/notary v0.6.1
github.com/tonistiigi/fsutil dea3a0da73aee887fc02142d995be764106ac5e2
github.com/xeipuuv/gojsonpointer e0fe6f68307607d540ed8eac07a342c33fa1b54a
github.com/xeipuuv/gojsonreference e02fc20de94c78484cd5ffb007f8af96be030a45
+4 -2
View File
@@ -192,7 +192,7 @@ func (cli *Client) setupHijackConn(req *http.Request, proto string) (net.Conn, e
// object that implements CloseWrite iff the underlying connection
// implements it.
if _, ok := c.(types.CloseWriter); ok {
c = &hijackedConnCloseWriter{c, br}
c = &hijackedConnCloseWriter{&hijackedConn{c, br}}
} else {
c = &hijackedConn{c, br}
}
@@ -220,7 +220,9 @@ func (c *hijackedConn) Read(b []byte) (int, error) {
// CloseWrite(). It is returned by setupHijackConn in the case that a) there
// was already buffered data in the http layer when Hijack() was called, and b)
// the underlying net.Conn *does* implement CloseWrite().
type hijackedConnCloseWriter hijackedConn
type hijackedConnCloseWriter struct {
*hijackedConn
}
var _ types.CloseWriter = &hijackedConnCloseWriter{}
@@ -40,21 +40,17 @@ type JSONProgress struct {
// If true, don't show xB/yB
HideCounts bool `json:"hidecounts,omitempty"`
Units string `json:"units,omitempty"`
nowFunc func() time.Time
winSize int
}
func (p *JSONProgress) String() string {
var (
width = 200
width = p.width()
pbBox string
numbersBox string
timeLeftBox string
)
ws, err := term.GetWinsize(p.terminalFd)
if err == nil {
width = int(ws.Width)
}
if p.Current <= 0 && p.Total <= 0 {
return ""
}
@@ -103,7 +99,7 @@ func (p *JSONProgress) String() string {
}
if p.Current > 0 && p.Start > 0 && percentage < 50 {
fromStart := time.Now().UTC().Sub(time.Unix(p.Start, 0))
fromStart := p.now().Sub(time.Unix(p.Start, 0))
perEntry := fromStart / time.Duration(p.Current)
left := time.Duration(p.Total-p.Current) * perEntry
left = (left / time.Second) * time.Second
@@ -115,6 +111,28 @@ func (p *JSONProgress) String() string {
return pbBox + numbersBox + timeLeftBox
}
// shim for testing
func (p *JSONProgress) now() time.Time {
if p.nowFunc == nil {
p.nowFunc = func() time.Time {
return time.Now().UTC()
}
}
return p.nowFunc()
}
// shim for testing
func (p *JSONProgress) width() int {
if p.winSize != 0 {
return p.winSize
}
ws, err := term.GetWinsize(p.terminalFd)
if err == nil {
return int(ws.Width)
}
return 200
}
// JSONMessage defines a message struct. It describes
// the created time, where it from, status, ID of the
// message. It's used for docker events.
-3
View File
@@ -45,9 +45,6 @@ var (
// IndexName is the name of the index
IndexName = "docker.io"
// NotaryServer is the endpoint serving the Notary trust server
NotaryServer = "https://notary.docker.io"
// DefaultV2Registry is the URI of the default v2 registry
DefaultV2Registry = &url.URL{
Scheme: "https",
+4 -6
View File
@@ -2,7 +2,6 @@
github.com/Azure/go-ansiterm d6e3b3328b783f23731bc4d058875b0371ff8109
github.com/Microsoft/hcsshim v0.6.8
github.com/Microsoft/go-winio v0.4.6
github.com/davecgh/go-spew 346938d642f2ec3594ed81d874461961cd0faa76
github.com/docker/libtrust 9cbd2a1374f46905c68a4eb3694a130610adc62a
github.com/go-check/check 4ed411733c5785b40214c70bce814c3a3a689609 https://github.com/cpuguy83/check.git
github.com/golang/gddo 9b12a26f3fbd7397dee4e20939ddca719d840d2a
@@ -19,10 +18,9 @@ golang.org/x/sys 37707fdb30a5b38865cfb95e5aab41707daec7fd
github.com/docker/go-units 9e638d38cf6977a37a8ea0078f3ee75a7cdb2dd1
github.com/docker/go-connections 7beb39f0b969b075d1325fecb092faf27fd357b6
golang.org/x/text f72d8390a633d5dfb0cc84043294db9f6c935756
github.com/stretchr/testify 4d4bfba8f1d1027c4fdbe371823030df51419987
github.com/pmezard/go-difflib v1.0.0
github.com/gotestyourself/gotestyourself 511344eed30e4384f010579a593dfb442033a692
github.com/google/go-cmp v0.1.0
github.com/gotestyourself/gotestyourself cf3a5ab914a2efa8bc838d09f5918c1d44d029
github.com/google/go-cmp v0.2.0
github.com/RackSec/srslog 456df3a81436d29ba874f3590eeeee25d666f8a5
github.com/imdario/mergo 0.2.1
@@ -34,7 +32,7 @@ github.com/tonistiigi/fsutil dea3a0da73aee887fc02142d995be764106ac5e2
#get libnetwork packages
# When updating, also update LIBNETWORK_COMMIT in hack/dockerfile/install/proxy accordingly
github.com/docker/libnetwork 8892d7537c67232591f1f3af60587e3e77e61d41
github.com/docker/libnetwork 1b91bc94094ecfdae41daa465cc0c8df37dfb3dd
github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80
github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec
@@ -63,7 +61,7 @@ github.com/ishidawataru/sctp 07191f837fedd2f13d1ec7b5f885f0f3ec54b1cb
# get graph and distribution packages
github.com/docker/distribution edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c
github.com/vbatts/tar-split v0.10.2
github.com/opencontainers/go-digest a6d0ee40d4207ea02364bd3b9e8e77b9159ba1eb
github.com/opencontainers/go-digest v1.0.0-rc1
# get go-zfs packages
github.com/mistifyio/go-zfs 22c9b32c84eb0d0c6f4043b6e90fc94073de92fa
+12 -6
View File
@@ -8,10 +8,11 @@ Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the
It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc](https://github.com/imdario/mergo#mergo-in-the-wild).
[![Build Status][1]][2]
[![GoDoc][3]][4]
[![GoCard][5]][6]
[![Build Status][1]][2]
[![Coverage Status][7]][8]
[![Sourcegraph][9]][10]
[1]: https://travis-ci.org/imdario/mergo.png
[2]: https://travis-ci.org/imdario/mergo
@@ -21,18 +22,22 @@ It is ready for production use. [It is used in several projects by Docker, Googl
[6]: https://goreportcard.com/report/github.com/imdario/mergo
[7]: https://coveralls.io/repos/github/imdario/mergo/badge.svg?branch=master
[8]: https://coveralls.io/github/imdario/mergo?branch=master
[9]: https://sourcegraph.com/github.com/imdario/mergo/-/badge.svg
[10]: https://sourcegraph.com/github.com/imdario/mergo?badge
### Latest release
[Release 0.3.2](https://github.com/imdario/mergo/releases/tag/0.3.2) is an important release because it changes `Merge()`and `Map()` signatures to support [transformers](#transformers). An optional/variadic argument has been added, so it won't break existing code.
[Release v0.3.4](https://github.com/imdario/mergo/releases/tag/v0.3.4).
### Important note
Please keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2) Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). An optional/variadic argument has been added, so it won't break existing code.
If you were using Mergo **before** April 6th 2015, please check your project works as intended after updating your local copy with ```go get -u github.com/imdario/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause (I hope it won't!) in existing projects after the change (release 0.2.0).
### Donations
If Mergo is useful to you, consider buying me a coffe, a beer or making a monthly donation so I can keep building great free software. :heart_eyes:
If Mergo is useful to you, consider buying me a coffee, a beer or making a monthly donation so I can keep building great free software. :heart_eyes:
<a href='https://ko-fi.com/B0B58839' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
[![Beerpay](https://beerpay.io/imdario/mergo/badge.svg)](https://beerpay.io/imdario/mergo)
@@ -93,7 +98,7 @@ If Mergo is useful to you, consider buying me a coffe, a beer or making a monthl
## Usage
You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. Also maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection).
You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as [they are not considered zero values](https://golang.org/ref/spec#The_zero_value) either. Also maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection).
```go
if err := mergo.Merge(&dst, src); err != nil {
@@ -104,7 +109,7 @@ if err := mergo.Merge(&dst, src); err != nil {
Also, you can merge overwriting values using the transformer `WithOverride`.
```go
if err := mergo.Merge(&dst, src, WithOverride); err != nil {
if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil {
// ...
}
```
@@ -164,6 +169,7 @@ package main
import (
"fmt"
"github.com/imdario/mergo"
"reflect"
"time"
)
@@ -195,7 +201,7 @@ type Snapshot struct {
func main() {
src := Snapshot{time.Now()}
dest := Snapshot{}
mergo.Merge(&dest, src, WithTransformers(timeTransfomer{}))
mergo.Merge(&dest, src, mergo.WithTransformers(timeTransfomer{}))
fmt.Println(dest)
// Will print
// { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 }
+7 -7
View File
@@ -31,8 +31,8 @@ func isExported(field reflect.StructField) bool {
// Traverses recursively both values, assigning src's fields values to dst.
// The map argument tracks comparisons that have already been seen, which allows
// short circuiting on recursive types.
func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *config) (err error) {
overwrite := config.overwrite
func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) {
overwrite := config.Overwrite
if dst.CanAddr() {
addr := dst.UnsafeAddr()
h := 17 * addr
@@ -128,23 +128,23 @@ func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, conf
// doesn't apply if dst is a map.
// This is separated method from Merge because it is cleaner and it keeps sane
// semantics: merging equal types, mapping different (restricted) types.
func Map(dst, src interface{}, opts ...func(*config)) error {
func Map(dst, src interface{}, opts ...func(*Config)) error {
return _map(dst, src, opts...)
}
// MapWithOverwrite will do the same as Map except that non-empty dst attributes will be overriden by
// MapWithOverwrite will do the same as Map except that non-empty dst attributes will be overridden by
// non-empty src attribute values.
// Deprecated: Use Map(…) with WithOverride
func MapWithOverwrite(dst, src interface{}, opts ...func(*config)) error {
func MapWithOverwrite(dst, src interface{}, opts ...func(*Config)) error {
return _map(dst, src, append(opts, WithOverride)...)
}
func _map(dst, src interface{}, opts ...func(*config)) error {
func _map(dst, src interface{}, opts ...func(*Config)) error {
var (
vDst, vSrc reflect.Value
err error
)
config := &config{}
config := &Config{}
for _, opt := range opts {
opt(config)
+35 -21
View File
@@ -8,7 +8,9 @@
package mergo
import "reflect"
import (
"reflect"
)
func hasExportedField(dst reflect.Value) (exported bool) {
for i, n := 0, dst.NumField(); i < n; i++ {
@@ -22,20 +24,21 @@ func hasExportedField(dst reflect.Value) (exported bool) {
return
}
type config struct {
overwrite bool
transformers transformers
type Config struct {
Overwrite bool
AppendSlice bool
Transformers Transformers
}
type transformers interface {
type Transformers interface {
Transformer(reflect.Type) func(dst, src reflect.Value) error
}
// Traverses recursively both values, assigning src's fields values to dst.
// The map argument tracks comparisons that have already been seen, which allows
// short circuiting on recursive types.
func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *config) (err error) {
overwrite := config.overwrite
func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) {
overwrite := config.Overwrite
if !src.IsValid() {
return
@@ -54,8 +57,8 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
visited[h] = &visit{addr, typ, seen}
}
if config.transformers != nil && !isEmptyValue(dst) {
if fn := config.transformers.Transformer(dst.Type()); fn != nil {
if config.Transformers != nil && !isEmptyValue(dst) {
if fn := config.Transformers.Transformer(dst.Type()); fn != nil {
err = fn(dst, src)
return
}
@@ -75,9 +78,8 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
}
}
case reflect.Map:
if len(src.MapKeys()) == 0 && !src.IsNil() && len(dst.MapKeys()) == 0 {
if dst.IsNil() && !src.IsNil() {
dst.Set(reflect.MakeMap(dst.Type()))
return
}
for _, key := range src.MapKeys() {
srcElement := src.MapIndex(key)
@@ -130,7 +132,14 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
}
}
case reflect.Slice:
dst.Set(reflect.AppendSlice(dst, src))
if !dst.CanSet() {
break
}
if !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
dst.Set(src)
} else {
dst.Set(reflect.AppendSlice(dst, src))
}
case reflect.Ptr:
fallthrough
case reflect.Interface:
@@ -174,36 +183,41 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
// src attributes if they themselves are not empty. dst and src must be valid same-type structs
// and dst must be a pointer to struct.
// It won't merge unexported (private) fields and will do recursively any exported field.
func Merge(dst, src interface{}, opts ...func(*config)) error {
func Merge(dst, src interface{}, opts ...func(*Config)) error {
return merge(dst, src, opts...)
}
// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overriden by
// non-empty src attribute values.
// Deprecated: use Merge(…) with WithOverride
func MergeWithOverwrite(dst, src interface{}, opts ...func(*config)) error {
func MergeWithOverwrite(dst, src interface{}, opts ...func(*Config)) error {
return merge(dst, src, append(opts, WithOverride)...)
}
// WithTransformers adds transformers to merge, allowing to customize the merging of some types.
func WithTransformers(transformers transformers) func(*config) {
return func(config *config) {
config.transformers = transformers
func WithTransformers(transformers Transformers) func(*Config) {
return func(config *Config) {
config.Transformers = transformers
}
}
// WithOverride will make merge override non-empty dst attributes with non-empty src attributes values.
func WithOverride(config *config) {
config.overwrite = true
func WithOverride(config *Config) {
config.Overwrite = true
}
func merge(dst, src interface{}, opts ...func(*config)) error {
// WithAppendSlice will make merge append slices instead of overwriting it
func WithAppendSlice(config *Config) {
config.AppendSlice = true
}
func merge(dst, src interface{}, opts ...func(*Config)) error {
var (
vDst, vSrc reflect.Value
err error
)
config := &config{}
config := &Config{}
for _, opt := range opts {
opt(config)
+5 -5
View File
@@ -29,16 +29,16 @@ secure. Once the publisher is ready to make the content available, they can
push their signed trusted collection to a Notary Server.
Consumers, having acquired the publisher's public key through a secure channel,
can then communicate with any notary server or (insecure) mirror, relying
can then communicate with any Notary server or (insecure) mirror, relying
only on the publisher's key to determine the validity and integrity of the
received content.
## Goals
Notary is based on [The Update Framework](https://www.theupdateframework.com/), a secure general design for the problem of software distribution and updates. By using TUF, notary achieves a number of key advantages:
Notary is based on [The Update Framework](https://www.theupdateframework.com/), a secure general design for the problem of software distribution and updates. By using TUF, Notary achieves a number of key advantages:
* **Survivable Key Compromise**: Content publishers must manage keys in order to sign their content. Signing keys may be compromised or lost so systems must be designed in order to be flexible and recoverable in the case of key compromise. TUF's notion of key roles is utilized to separate responsibilities across a hierarchy of keys such that loss of any particular key (except the root role) by itself is not fatal to the security of the system.
* **Freshness Guarantees**: Replay attacks are a common problem in designing secure systems, where previously valid payloads are replayed to trick another system. The same problem exists in the software update systems, where old signed can be presented as the most recent. notary makes use of timestamping on publishing so that consumers can know that they are receiving the most up to date content. This is particularly important when dealing with software update where old vulnerable versions could be used to attack users.
* **Freshness Guarantees**: Replay attacks are a common problem in designing secure systems, where previously valid payloads are replayed to trick another system. The same problem exists in the software update systems, where old signed can be presented as the most recent. Notary makes use of timestamping on publishing so that consumers can know that they are receiving the most up to date content. This is particularly important when dealing with software update where old vulnerable versions could be used to attack users.
* **Configurable Trust Thresholds**: Oftentimes there are a large number of publishers that are allowed to publish a particular piece of content. For example, open source projects where there are a number of core maintainers. Trust thresholds can be used so that content consumers require a configurable number of signatures on a piece of content in order to trust it. Using thresholds increases security so that loss of individual signing keys doesn't allow publishing of malicious content.
* **Signing Delegation**: To allow for flexible publishing of trusted collections, a content publisher can delegate part of their collection to another signer. This delegation is represented as signed metadata so that a consumer of the content can verify both the content and the delegation.
* **Use of Existing Distribution**: Notary's trust guarantees are not tied at all to particular distribution channels from which content is delivered. Therefore, trust can be added to any existing content delivery mechanism.
@@ -55,7 +55,7 @@ Any security vulnerabilities can be reported to security@docker.com.
# Getting started with the Notary CLI
Get the Notary Client CLI binary from [the official releases page](https://github.com/theupdateframework/notary/releases) or you can [build one yourself](#building-notary).
The version of Notary server and signer should be greater than or equal to Notary CLI's version to ensure feature compatibility (ex: CLI version 0.2, server/signer version >= 0.2), and all official releases are associated with GitHub tags.
The version of the Notary server and signer should be greater than or equal to Notary CLI's version to ensure feature compatibility (ex: CLI version 0.2, server/signer version >= 0.2), and all official releases are associated with GitHub tags.
To use the Notary CLI with Docker hub images, have a look at Notary's
[getting started docs](docs/getting_started.md).
@@ -68,7 +68,7 @@ To use the CLI against a local Notary server rather than against Docker Hub:
1. Ensure that you have [docker and docker-compose](http://docs.docker.com/compose/install/) installed.
1. `git clone https://github.com/theupdateframework/notary.git` and from the cloned repository path,
start up a local Notary server and signer and copy the config file and testing certs to your
local notary config directory:
local Notary config directory:
```sh
$ docker-compose build
@@ -82,8 +82,8 @@ func (c TUFChange) Content() []byte {
// unexpected race conditions between humans modifying the same delegation
type TUFDelegation struct {
NewName data.RoleName `json:"new_name,omitempty"`
NewThreshold int `json:"threshold, omitempty"`
AddKeys data.KeyList `json:"add_keys, omitempty"`
NewThreshold int `json:"threshold,omitempty"`
AddKeys data.KeyList `json:"add_keys,omitempty"`
RemoveKeys []string `json:"remove_keys,omitempty"`
AddPaths []string `json:"add_paths,omitempty"`
RemovePaths []string `json:"remove_paths,omitempty"`
+9 -8
View File
@@ -1,13 +1,14 @@
package notary
import "os"
import (
"crypto"
// Need to import md5 so can test availability.
_ "crypto/md5"
)
// FIPSEnvVar is the name of the environment variable that is being used to switch
// between FIPS and non-FIPS mode
const FIPSEnvVar = "GOFIPS"
// FIPSEnabled returns true if environment variable `GOFIPS` has been set to enable
// FIPS mode
// FIPSEnabled returns true if running in FIPS mode.
// If compiled in FIPS mode the md5 hash function is never available
// even when imported. This seems to be the best test we have for it.
func FIPSEnabled() bool {
return os.Getenv(FIPSEnvVar) != ""
return !crypto.MD5.Available()
}
@@ -86,10 +86,6 @@ func X509PublicKeyID(certPubKey data.PublicKey) (string, error) {
}
func parseLegacyPrivateKey(block *pem.Block, passphrase string) (data.PrivateKey, error) {
if notary.FIPSEnabled() {
return nil, fmt.Errorf("%s not supported in FIPS mode", block.Type)
}
var privKeyBytes []byte
var err error
if x509.IsEncryptedPEMBlock(block) {
@@ -146,6 +142,10 @@ func parseLegacyPrivateKey(block *pem.Block, passphrase string) (data.PrivateKey
// supports PKCS#8 as well as RSA/ECDSA (PKCS#1) only in non-FIPS mode and
// attempts to decrypt using the passphrase, if encrypted.
func ParsePEMPrivateKey(pemBytes []byte, passphrase string) (data.PrivateKey, error) {
return parsePEMPrivateKey(pemBytes, passphrase, notary.FIPSEnabled())
}
func parsePEMPrivateKey(pemBytes []byte, passphrase string, fips bool) (data.PrivateKey, error) {
block, _ := pem.Decode(pemBytes)
if block == nil {
return nil, errors.New("no valid private key found")
@@ -153,6 +153,9 @@ func ParsePEMPrivateKey(pemBytes []byte, passphrase string) (data.PrivateKey, er
switch block.Type {
case "RSA PRIVATE KEY", "EC PRIVATE KEY", "ED25519 PRIVATE KEY":
if fips {
return nil, fmt.Errorf("%s not supported in FIPS mode", block.Type)
}
return parseLegacyPrivateKey(block, passphrase)
case "ENCRYPTED PRIVATE KEY", "PRIVATE KEY":
if passphrase == "" {
@@ -433,6 +436,10 @@ func ED25519ToPrivateKey(privKeyBytes []byte) (data.PrivateKey, error) {
// ExtractPrivateKeyAttributes extracts role and gun values from private key bytes
func ExtractPrivateKeyAttributes(pemBytes []byte) (data.RoleName, data.GUN, error) {
return extractPrivateKeyAttributes(pemBytes, notary.FIPSEnabled())
}
func extractPrivateKeyAttributes(pemBytes []byte, fips bool) (data.RoleName, data.GUN, error) {
block, _ := pem.Decode(pemBytes)
if block == nil {
return "", "", errors.New("PEM block is empty")
@@ -440,7 +447,7 @@ func ExtractPrivateKeyAttributes(pemBytes []byte) (data.RoleName, data.GUN, erro
switch block.Type {
case "RSA PRIVATE KEY", "EC PRIVATE KEY", "ED25519 PRIVATE KEY":
if notary.FIPSEnabled() {
if fips {
return "", "", fmt.Errorf("%s not supported in FIPS mode", block.Type)
}
case "PRIVATE KEY", "ENCRYPTED PRIVATE KEY":
+8 -8
View File
@@ -8,15 +8,14 @@ github.com/docker/distribution edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c
github.com/opencontainers/go-digest a6d0ee40d4207ea02364bd3b9e8e77b9159ba1eb
github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55
github.com/docker/go d30aec9fd63c35133f8f79c3412ad91a3b08be06
github.com/dvsekhvalnov/jose2go 6387d3c1f5abd8443b223577d5a7e0f4e0e5731f # v1.2
github.com/dvsekhvalnov/jose2go f21a8cedbbae609f623613ec8f81125c243212e6 # v1.3
github.com/go-sql-driver/mysql a0583e0143b1624142adab07e0e97fe106d99561 # v1.3
github.com/gorilla/mux e444e69cbd2e2e3e0749a2f3c717cec491552bbf
github.com/gorilla/mux 53c1911da2b537f792e7cafcb446b05ffe33b996 # v1.6.1
github.com/jinzhu/gorm 5409931a1bb87e484d68d649af9367c207713ea2
github.com/jinzhu/inflection 1c35d901db3da928c72a72d8458480cc9ade058f
github.com/lib/pq 0dad96c0b94f8dee039aa40467f767467392a0af
github.com/mattn/go-sqlite3 b4142c444a8941d0d92b0b7103a24df9cd815e42 # v1.0.0
github.com/mattn/go-sqlite3 6c771bb9887719704b210e87e934f08be014bdb1 # v1.6.0
github.com/miekg/pkcs11 5f6e0d0dad6f472df908c8e968a98ef00c9224bb
github.com/mitchellh/go-homedir df55a15e5ce646808815381b3db47a8c66ea62f4
github.com/prometheus/client_golang 449ccefff16c8e2b7229f6be1921ba22f62461fe
github.com/prometheus/client_model fa8ad6fec33561be4280a8f0514318c79d7f6cb6 # model-0.0.2-12-gfa8ad6f
github.com/prometheus/procfs b1afdc266f54247f5dc725544f5d351a8661f502
@@ -32,9 +31,9 @@ github.com/pkg/errors 839d9e913e063e28dfd0e6c7b7512793e0a48be9
github.com/spf13/pflag e57e3eeb33f795204c1ca35f56c44f83227c6e66 # v1.0.0
github.com/spf13/cast 4d07383ffe94b5e5a6fa3af9211374a4507a0184
gopkg.in/yaml.v2 bef53efd0c76e49e6de55ead051f886bea7e9420
gopkg.in/yaml.v2 5420a8b6744d3b0345ab293f6fcba19c978f1183 # v2.2.1
gopkg.in/fatih/pool.v2 cba550ebf9bce999a02e963296d4bc7a486cb715
github.com/gorilla/context 14f550f51af52180c2eefed15e5fd18d63c0a64a
github.com/gorilla/context 14f550f51af52180c2eefed15e5fd18d63c0a64a # unused
github.com/spf13/jwalterweatherman 3d60171a64319ef63c78bd45bd60e6eab1e75f8b
github.com/mitchellh/mapstructure 2caf8efc93669b6c43e0441cdc6aed17546c96f3
github.com/magiconair/properties 624009598839a9432bd97bb75552389422357723 # v1.5.3
@@ -55,5 +54,6 @@ github.com/cenk/backoff 32cd0c5b3aef12c76ed64aaf678f6c79736be7dc #
# Testing requirements
github.com/stretchr/testify 089c7181b8c728499929ff09b62d3fdd8df8adff
github.com/cloudflare/cfssl 7fb22c8cba7ecaf98e4082d22d65800cf45e042a
github.com/google/certificate-transparency 0f6e3d1d1ba4d03fdaab7cd716f36255c2e48341
github.com/cloudflare/cfssl 4e2dcbde500472449917533851bf4bae9bdff562 # v1.3.1
github.com/google/certificate-transparency-go 5ab67e519c93568ac3ee50fd6772a5bcf8aa460d
github.com/gogo/protobuf 1adfc126b41513cc696b209667c8656ea7aac67c # v1.0.0
+31 -30
View File
@@ -32,10 +32,10 @@
# the case. Therefore, you don't have to disable it anymore.
#
FROM golang:1.9.4 AS base
FROM golang:1.10.1 AS base
# FIXME(vdemeester) this is kept for other script depending on it to not fail right away
# Remove this once the other scripts uses something else to detect the version
ENV GO_VERSION 1.9.4
ENV GO_VERSION 1.10.1
# allow replacing httpredir or deb mirror
ARG APT_MIRROR=deb.debian.org
RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
@@ -57,7 +57,7 @@ RUN apt-get update && apt-get install -y \
&& curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
&& cd /usr/src/criu \
&& make \
&& make PREFIX=/opt/criu install-criu
&& make PREFIX=/build/ install-criu
FROM base AS registry
# Install two versions of the registry. The first is an older version that
@@ -71,12 +71,12 @@ RUN set -x \
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -buildmode=pie -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
go build -buildmode=pie -o /build/registry-v2 github.com/docker/distribution/cmd/registry \
&& case $(dpkg --print-architecture) in \
amd64|ppc64*|s390x) \
(cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1"); \
GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH"; \
go build -buildmode=pie -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry; \
go build -buildmode=pie -o /build/registry-v2-schema1 github.com/docker/distribution/cmd/registry; \
;; \
esac \
&& rm -rf "$GOPATH"
@@ -86,8 +86,8 @@ RUN set -x \
FROM base AS docker-py
# Get the "docker-py" source so we can run their integration tests
ENV DOCKER_PY_COMMIT 8b246db271a85d6541dc458838627e89c683e42f
RUN git clone https://github.com/docker/docker-py.git /docker-py \
&& cd /docker-py \
RUN git clone https://github.com/docker/docker-py.git /build \
&& cd /build \
&& git checkout -q $DOCKER_PY_COMMIT
@@ -99,7 +99,7 @@ RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/go-swagger/go-swagger.git "$GOPATH/src/github.com/go-swagger/go-swagger" \
&& (cd "$GOPATH/src/github.com/go-swagger/go-swagger" && git checkout -q "$GO_SWAGGER_COMMIT") \
&& go build -o /usr/local/bin/swagger github.com/go-swagger/go-swagger/cmd/swagger \
&& go build -o /build/swagger github.com/go-swagger/go-swagger/cmd/swagger \
&& rm -rf "$GOPATH"
@@ -107,7 +107,7 @@ FROM base AS frozen-images
RUN apt-get update && apt-get install -y jq ca-certificates --no-install-recommends
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /
RUN /download-frozen-image-v2.sh /docker-frozen-images \
RUN /download-frozen-image-v2.sh /build \
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
busybox:glibc@sha256:0b55a30394294ab23b9afd58fab94e61a923f5834fba7ddbae7f8e0c11ba85e6 \
@@ -126,51 +126,51 @@ FROM base AS tomlv
ENV INSTALL_BINARY_NAME=tomlv
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/opt/$INSTALL_BINARY_NAME ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
FROM base AS vndr
ENV INSTALL_BINARY_NAME=vndr
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/opt/$INSTALL_BINARY_NAME ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
FROM base AS containerd
RUN apt-get update && apt-get install -y btrfs-tools
ENV INSTALL_BINARY_NAME=containerd
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/opt/$INSTALL_BINARY_NAME ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
FROM base AS proxy
ENV INSTALL_BINARY_NAME=proxy
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/opt/$INSTALL_BINARY_NAME ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
FROM base AS gometalinter
ENV INSTALL_BINARY_NAME=gometalinter
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/opt/$INSTALL_BINARY_NAME ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
FROM base AS dockercli
ENV INSTALL_BINARY_NAME=dockercli
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/opt/$INSTALL_BINARY_NAME ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
FROM runtime-dev AS runc
ENV INSTALL_BINARY_NAME=runc
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/opt/$INSTALL_BINARY_NAME ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
FROM base AS tini
RUN apt-get update && apt-get install -y cmake vim-common
COPY hack/dockerfile/install/install.sh ./install.sh
ENV INSTALL_BINARY_NAME=tini
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/opt/$INSTALL_BINARY_NAME ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
@@ -214,25 +214,26 @@ RUN apt-get update && apt-get install -y \
bzip2 \
xz-utils \
--no-install-recommends
COPY --from=swagger /usr/local/bin/swagger* /usr/local/bin/
COPY --from=frozen-images /docker-frozen-images /docker-frozen-images
COPY --from=gometalinter /opt/gometalinter/ /usr/local/bin/
COPY --from=tomlv /opt/tomlv/ /usr/local/bin/
COPY --from=vndr /opt/vndr/ /usr/local/bin/
COPY --from=tini /opt/tini/ /usr/local/bin/
COPY --from=runc /opt/runc/ /usr/local/bin/
COPY --from=containerd /opt/containerd/ /usr/local/bin/
COPY --from=proxy /opt/proxy/ /usr/local/bin/
COPY --from=dockercli /opt/dockercli /usr/local/cli
COPY --from=registry /usr/local/bin/registry* /usr/local/bin/
COPY --from=criu /opt/criu/ /usr/local/
COPY --from=docker-py /docker-py /docker-py
COPY --from=swagger /build/swagger* /usr/local/bin/
COPY --from=frozen-images /build/ /docker-frozen-images
COPY --from=gometalinter /build/ /usr/local/bin/
COPY --from=tomlv /build/ /usr/local/bin/
COPY --from=vndr /build/ /usr/local/bin/
COPY --from=tini /build/ /usr/local/bin/
COPY --from=runc /build/ /usr/local/bin/
COPY --from=containerd /build/ /usr/local/bin/
COPY --from=proxy /build/ /usr/local/bin/
COPY --from=dockercli /build/ /usr/local/cli
COPY --from=registry /build/registry* /usr/local/bin/
COPY --from=criu /build/ /usr/local/
COPY --from=docker-py /build/ /docker-py
# TODO: This is for the docker-py tests, which shouldn't really be needed for
# this image, but currently CI is expecting to run this image. This should be
# split out into a separate image, including all the `python-*` deps installed
# above.
RUN cd /docker-py \
&& pip install docker-pycreds==0.2.1 \
&& pip install yamllint==1.5.0 \
&& pip install -r test-requirements.txt
ENV PATH=/usr/local/cli:$PATH
+2 -2
View File
@@ -1,5 +1,5 @@
## Step 1: Build tests
FROM golang:1.9.4-alpine3.6 as builder
FROM golang:1.10.1-alpine3.7 as builder
RUN apk add --update \
bash \
@@ -40,7 +40,7 @@ RUN hack/make.sh build-integration-test-binary
RUN mkdir -p /output/tests && find . -name test.main -exec cp --parents '{}' /output/tests \;
## Step 2: Generate testing image
FROM alpine:3.6 as runner
FROM alpine:3.7 as runner
# GNU tar is used for generating the emptyfs image
RUN apk add --update \
+1 -1
View File
@@ -42,7 +42,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# will need updating, to avoid errors. Ping #docker-maintainers on IRC
# with a heads-up.
# IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored
ENV GO_VERSION 1.9.4
ENV GO_VERSION 1.10.1
RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz" \
| tar -xzC /usr/local
ENV PATH /go/bin:/usr/local/go/bin:$PATH
+1 -1
View File
@@ -161,7 +161,7 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref
# Environment variable notes:
# - GO_VERSION must be consistent with 'Dockerfile' used by Linux.
# - FROM_DOCKERFILE is used for detection of building within a container.
ENV GO_VERSION=1.9.4 `
ENV GO_VERSION=1.10.1 `
GIT_VERSION=2.11.1 `
GOPATH=C:\go `
FROM_DOCKERFILE=1
+1 -1
View File
@@ -66,7 +66,7 @@ DOCKER_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/do
# This allows the test suite to be able to run without worrying about the underlying fs used by the container running the daemon (e.g. aufs-on-aufs), so long as the host running the container is running a supported fs.
# The volume will be cleaned up when the container is removed due to `--rm`.
# Note that `BIND_DIR` will already be set to `bundles` if `DOCKER_HOST` is not set (see above BIND_DIR line), in such case this will do nothing since `DOCKER_MOUNT` will already be set.
DOCKER_MOUNT := $(if $(DOCKER_MOUNT),$(DOCKER_MOUNT),-v /go/src/github.com/docker/docker/bundles) -v $(CURDIR)/.git:/go/src/github.com/docker/docker/.git
DOCKER_MOUNT := $(if $(DOCKER_MOUNT),$(DOCKER_MOUNT),-v /go/src/github.com/docker/docker/bundles) -v "$(CURDIR)/.git:/go/src/github.com/docker/docker/.git"
# This allows to set the docker-dev container name
DOCKER_CONTAINER_NAME := $(if $(CONTAINER_NAME),--name $(CONTAINER_NAME),)
@@ -1,6 +1,7 @@
package build // import "github.com/docker/docker/api/server/backend/build"
import (
"context"
"fmt"
"github.com/docker/distribution/reference"
@@ -11,7 +12,6 @@ import (
"github.com/docker/docker/image"
"github.com/docker/docker/pkg/stringid"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
// ImageComponent provides an interface for working with images
@@ -1,6 +1,7 @@
package httputils // import "github.com/docker/docker/api/server/httputils"
import (
"context"
"io"
"mime"
"net/http"
@@ -9,7 +10,6 @@ import (
"github.com/docker/docker/errdefs"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
type contextKey string
@@ -1,13 +1,12 @@
package httputils // import "github.com/docker/docker/api/server/httputils"
import (
"context"
"fmt"
"io"
"net/url"
"sort"
"golang.org/x/net/context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/backend"
"github.com/docker/docker/pkg/ioutils"
@@ -1,10 +1,10 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
import (
"context"
"net/http"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
// CORSMiddleware injects CORS headers to each request
@@ -2,6 +2,7 @@ package middleware // import "github.com/docker/docker/api/server/middleware"
import (
"bufio"
"context"
"encoding/json"
"io"
"net/http"
@@ -10,7 +11,6 @@ import (
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/pkg/ioutils"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
// DebugRequestMiddleware dumps the request to logger
@@ -1,9 +1,8 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
import (
"context"
"net/http"
"golang.org/x/net/context"
)
// ExperimentalMiddleware is a the middleware in charge of adding the
@@ -1,9 +1,8 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
import (
"context"
"net/http"
"golang.org/x/net/context"
)
// Middleware is an interface to allow the use of ordinary functions as Docker API filters.
@@ -1,13 +1,13 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
import (
"context"
"fmt"
"net/http"
"runtime"
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/types/versions"
"golang.org/x/net/context"
)
// VersionMiddleware is a middleware that
@@ -1,6 +1,7 @@
package middleware // import "github.com/docker/docker/api/server/middleware"
import (
"context"
"net/http"
"net/http/httptest"
"runtime"
@@ -9,7 +10,6 @@ import (
"github.com/docker/docker/api/server/httputils"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
"golang.org/x/net/context"
)
func TestVersionMiddlewareVersion(t *testing.T) {
@@ -1,9 +1,10 @@
package build // import "github.com/docker/docker/api/server/router/build"
import (
"context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/backend"
"golang.org/x/net/context"
)
// Backend abstracts an image builder whose only purpose is to build an image referenced by an imageID.
@@ -2,6 +2,7 @@ package build // import "github.com/docker/docker/api/server/router/build"
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
@@ -25,7 +26,6 @@ import (
units "github.com/docker/go-units"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
type invalidIsolationError string
@@ -1,12 +1,12 @@
package checkpoint // import "github.com/docker/docker/api/server/router/checkpoint"
import (
"context"
"encoding/json"
"net/http"
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/types"
"golang.org/x/net/context"
)
func (s *checkpointRouter) postContainerCheckpoint(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
@@ -1,10 +1,9 @@
package container // import "github.com/docker/docker/api/server/router/container"
import (
"context"
"io"
"golang.org/x/net/context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/backend"
"github.com/docker/docker/api/types/container"
@@ -1,6 +1,7 @@
package container // import "github.com/docker/docker/api/server/router/container"
import (
"context"
"encoding/json"
"fmt"
"io"
@@ -20,7 +21,6 @@ import (
"github.com/docker/docker/pkg/signal"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
"golang.org/x/net/websocket"
)
@@ -3,6 +3,7 @@ package container // import "github.com/docker/docker/api/server/router/containe
import (
"compress/flate"
"compress/gzip"
"context"
"encoding/base64"
"encoding/json"
"io"
@@ -12,7 +13,6 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/versions"
gddohttputil "github.com/golang/gddo/httputil"
"golang.org/x/net/context"
)
type pathError struct{}
@@ -1,6 +1,7 @@
package container // import "github.com/docker/docker/api/server/router/container"
import (
"context"
"encoding/json"
"fmt"
"io"
@@ -13,7 +14,6 @@ import (
"github.com/docker/docker/errdefs"
"github.com/docker/docker/pkg/stdcopy"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
func (s *containerRouter) getExecByID(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
@@ -1,10 +1,10 @@
package container // import "github.com/docker/docker/api/server/router/container"
import (
"context"
"net/http"
"github.com/docker/docker/api/server/httputils"
"golang.org/x/net/context"
)
// getContainersByName inspects container's configuration and serializes it as json.
@@ -1,13 +1,13 @@
package debug // import "github.com/docker/docker/api/server/router/debug"
import (
"context"
"expvar"
"net/http"
"net/http/pprof"
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/server/router"
"golang.org/x/net/context"
)
// NewRouter creates a new debug router
@@ -1,10 +1,9 @@
package debug // import "github.com/docker/docker/api/server/router/debug"
import (
"context"
"net/http"
"net/http/pprof"
"golang.org/x/net/context"
)
func handlePprof(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
@@ -1,10 +1,11 @@
package distribution // import "github.com/docker/docker/api/server/router/distribution"
import (
"context"
"github.com/docker/distribution"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
"golang.org/x/net/context"
)
// Backend is all the methods that need to be implemented
@@ -1,6 +1,7 @@
package distribution // import "github.com/docker/docker/api/server/router/distribution"
import (
"context"
"encoding/base64"
"encoding/json"
"net/http"
@@ -15,7 +16,6 @@ import (
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
func (s *distributionRouter) getDistributionInfo(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
@@ -1,10 +1,9 @@
package router // import "github.com/docker/docker/api/server/router"
import (
"context"
"net/http"
"golang.org/x/net/context"
"github.com/docker/docker/api/server/httputils"
)
@@ -1,13 +1,13 @@
package image // import "github.com/docker/docker/api/server/router/image"
import (
"context"
"io"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/registry"
"golang.org/x/net/context"
)
// Backend is all the methods that need to be implemented
@@ -1,6 +1,7 @@
package image // import "github.com/docker/docker/api/server/router/image"
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
@@ -19,7 +20,6 @@ import (
"github.com/docker/docker/registry"
specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
// Creates an image from Pull or from Import
+1 -1
View File
@@ -1,10 +1,10 @@
package router // import "github.com/docker/docker/api/server/router"
import (
"context"
"net/http"
"github.com/docker/docker/api/server/httputils"
"golang.org/x/net/context"
)
// RouteWrapper wraps a route with extra functionality.
@@ -1,7 +1,7 @@
package network // import "github.com/docker/docker/api/server/router/network"
import (
"golang.org/x/net/context"
"context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
@@ -20,3 +20,13 @@ type Backend interface {
DeleteNetwork(networkID string) error
NetworksPrune(ctx context.Context, pruneFilters filters.Args) (*types.NetworksPruneReport, error)
}
// ClusterBackend is all the methods that need to be implemented
// to provide cluster network specific functionality.
type ClusterBackend interface {
GetNetworks() ([]types.NetworkResource, error)
GetNetwork(name string) (types.NetworkResource, error)
GetNetworksByName(name string) ([]types.NetworkResource, error)
CreateNetwork(nc types.NetworkCreateRequest) (string, error)
RemoveNetwork(name string) error
}
@@ -2,18 +2,17 @@ package network // import "github.com/docker/docker/api/server/router/network"
import (
"github.com/docker/docker/api/server/router"
"github.com/docker/docker/daemon/cluster"
)
// networkRouter is a router to talk with the network controller
type networkRouter struct {
backend Backend
cluster *cluster.Cluster
cluster ClusterBackend
routes []router.Route
}
// NewRouter initializes a new network router
func NewRouter(b Backend, c *cluster.Cluster) router.Router {
func NewRouter(b Backend, c ClusterBackend) router.Router {
r := &networkRouter{
backend: b,
cluster: c,
@@ -1,13 +1,12 @@
package network // import "github.com/docker/docker/api/server/router/network"
import (
"context"
"encoding/json"
"net/http"
"strconv"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
@@ -1,6 +1,7 @@
package plugin // import "github.com/docker/docker/api/server/router/plugin"
import (
"context"
"io"
"net/http"
@@ -8,7 +9,6 @@ import (
enginetypes "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/plugin"
"golang.org/x/net/context"
)
// Backend for Plugin
@@ -1,6 +1,7 @@
package plugin // import "github.com/docker/docker/api/server/router/plugin"
import (
"context"
"encoding/base64"
"encoding/json"
"net/http"
@@ -14,7 +15,6 @@ import (
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/streamformatter"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
func parseHeaders(headers http.Header) (map[string][]string, *types.AuthConfig) {
@@ -1,9 +1,8 @@
package session // import "github.com/docker/docker/api/server/router/session"
import (
"context"
"net/http"
"golang.org/x/net/context"
)
// Backend abstracts an session receiver from an http request.
@@ -1,10 +1,10 @@
package session // import "github.com/docker/docker/api/server/router/session"
import (
"context"
"net/http"
"github.com/docker/docker/errdefs"
"golang.org/x/net/context"
)
func (sr *sessionRouter) startSession(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

Some files were not shown because too many files have changed in this diff Show More