Commit Graph

5122 Commits

Author SHA1 Message Date
a037b250cf Merge pull request #33471 from Snorch/sysconf-nrprocessors-onln-errno
Do not treat C.sysconf(C._SC_NPROCESSORS_ONLN) non-zero errno as error
Upstream-commit: 8b1adf55c2af329a4334f21d9444d6a169000c81
Component: engine
2017-06-06 10:22:41 +02:00
b9c4f53912 Remove the last of pkg/httputil
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4060d6ee0b130cf74294c309dfbd3c860fd2a7f8
Component: engine
2017-06-02 16:54:36 -04:00
a1a5b0a48d move multireader out of /pkg
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 2445e6b99d4beecb25d556d9a099bdf47703e174
Component: engine
2017-06-01 16:22:00 -07:00
10e27f6561 Merge pull request #33335 from cpuguy83/33334_check_unset_sig
Check signal is unset before using user stopsignal
Upstream-commit: 872e28bb1452c6e333549a55dcb651fcff2a6bd1
Component: engine
2017-06-01 23:10:16 +02:00
008c8eb206 Do not treat C.sysconf(C._SC_NPROCESSORS_ONLN) non-zero errno as error
Treat return code -1 as error instead.

People from glibc say that errno is undefined in case of successful
sysconf call according to POSIX standard:
Glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21536

More over in sysconf man it is wrongly said that "errno is not changed"
on success. So I've created a bug to man-pages:
https://bugzilla.kernel.org/show_bug.cgi?id=195955

Background: Glibc's sysconf(_SC_NPROCESSORS_ONLN) changes errno to
ENOENT, if there is no /sys/devices/system/cpu/online file, while
the call itself is successful. In Virtuozzo containers we prohibit
most of sysfs files for security reasons. So we have Run():daemon
/stats/collector.go infinitely loop never actualy collecting stats
from publisher pairs.

v2: add comment

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Upstream-commit: dec084962eab41eb20b1808955de34cfec4fc8b3
Component: engine
2017-06-01 18:23:49 +03:00
a5b7ff8786 Merge pull request #33305 from thaJeztah/suppress-logger-close-error
Don't log error if file is already closed
Upstream-commit: 316681cd2a644ef7f98fbaf4ca91a45a021b4b22
Component: engine
2017-05-31 17:09:09 +02:00
02dca610a4 Merge pull request #33249 from ripcurld0/env_validate
Add container environment variables correctly to the health check
Upstream-commit: 7c2f20107a0599008152179a18cc8d0323ccc589
Component: engine
2017-05-31 07:35:28 -07:00
0a1989cb37 Check signal is unset before using user stopsignal
This fixes an issue where if a stop signal is set, and a user sends
SIGKILL, `container.ExitOnNext()` is not set, thus causing the container
to restart.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 114652ab86609e5c0cbfad84f642942b466a0596
Component: engine
2017-05-30 13:04:36 -04:00
9b30256194 Merge pull request #33360 from aaronlehmann/vendor-swarmkit-7e096ced
Vendor swarmkit 7e096ced
Upstream-commit: 6629f1d0e753edc960f30030299e0e5d48b845aa
Component: engine
2017-05-30 09:59:48 -07:00
c13c5f5760 Merge pull request #33311 from msabansal/dnssearch
Adding support for DNS search on RS1
Upstream-commit: 4bf8714fac11e95e835cf78eb15ba5a518c67c4b
Component: engine
2017-05-30 13:09:18 +02:00
e9185f10cf Don't log error if file is already closed
When closing the log-file, and the file is already
closed, there's no need to log an error.

This patch adds a `closed` boolean to check if the
file was closed, and if so, skip closing the file.
This prevents errors like this being logged:

    level=error msg="Error closing logger: invalid argument"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 07b51ed300429e88871e40b4d67dc031e2e8901c
Component: engine
2017-05-29 17:42:37 +02:00
7acd97d8f9 Merge pull request #33257 from mtesselH/master
Add CreatedAt filed to volume. Display when volume is inspected.
Upstream-commit: 79b19c2e16c43f22187538953f49b2c048b063f8
Component: engine
2017-05-29 10:48:07 +01:00
f35cfc66e5 prevent image prune panic
Signed-off-by: Alfred Landrum <alfred.landrum@docker.com>
Upstream-commit: 32da2a4234c5c68ff466dc1afc91ba98dbbe199a
Component: engine
2017-05-26 12:54:39 -07:00
3d97792442 Add CreatedAt filed to volume. Display when volume is inspected.
Closes #32663 by adding CreatedAt field when volume is created.
Displaying CreatedAt value when volume is inspected
Adding tests to verfiy the new field is correctly populated

Signed-off-by: Marianna <mtesselh@gmail.com>

Moving CreatedAt tests from the CLI

Moving the tests added for the newly added CreatedAt field for Volume, from CLI to API tests

Signed-off-by: Marianna <mtesselh@gmail.com>
Upstream-commit: a46f757c4043031379362c5d6b3bad7562ab9fed
Component: engine
2017-05-26 11:47:02 -07:00
933e100f5e Merge pull request #33384 from Microsoft/jjh/sandboxpath
Windows: Remove unused SandboxPath
Upstream-commit: e925820bfd5af066497800a02c597d6846988398
Component: engine
2017-05-25 11:21:15 -07:00
6a7791114d Merge pull request #33292 from keloyang/attach-restart-check
Add a restarting check to ContainerAttach
Upstream-commit: da3c3ec1458588d5d263dc3babd3dca95fdc7d8d
Component: engine
2017-05-24 18:30:05 -07:00
be30b971d7 Windows: Remove unused SandboxPath
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2f038c25868727310992104b7b267fed6c7dad39
Component: engine
2017-05-24 13:44:35 -07:00
5556f64d13 Vendor swarmkit 7e096ced
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 10df99f9ae48acc9888494223256637a8ca06f50
Component: engine
2017-05-23 15:01:35 -07:00
90e101ed15 Do not clear swarm directory at the begining of swarm init and swarm join now.
However, do clear the directory if init or join fails, because we don't
want to leave it in a half-finished state.

Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: bf3e9293a66c77a2fddf4e691222898846b4af9f
Component: engine
2017-05-22 17:45:20 -07:00
3dea3b7a46 Merge pull request #32774 from darrenstahlmsft/ProcessorMaximum
Use CpuMaximum instead of CpuPercent for more precision
Upstream-commit: bb64d45be1dce3fe1a526b2362a7d8451bfdcbe3
Component: engine
2017-05-22 08:55:17 -07:00
a5644c91a3 Add container environment variables correctly to the health check
The health check process doesn't have all the environment
varialbes in the container or has them set incorrectly.

This patch should fix that problem.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 5836d86ac4d617e837d94010aa60384648ab59ea
Component: engine
2017-05-21 21:39:00 +03:00
d150808e81 Add a restarting check to ContainerAttach
Signed-off-by: yangshukui <yangshukui@huawei.com>
Upstream-commit: 5010e09534c4595ea4bc3f53a415626fc9e9d3b1
Component: engine
2017-05-20 11:27:45 +08:00
c9ec562bee remove RuntimeData from cluster and types
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 8eeba751983d6499a07fcd21c26f381eb1d17d19
Component: engine
2017-05-19 17:10:32 -04:00
f1ce9152c0 Use CpuMaximum instead of CpuPercent for more precision
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 425973cbb87aef6a32b225a57f5ef2d78d5749d5
Component: engine
2017-05-19 12:33:14 -07:00
b0a3ababea Merge pull request #33286 from aboch/ingr
Properly identify ingress network created with older swarm
Upstream-commit: 39a604c0d419424bab0314e7070c49bcacca3bda
Component: engine
2017-05-19 10:04:29 -04:00
1e0f9dbab8 arg filt
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
Upstream-commit: 49bf533fe72fd2390da89d133fbe984d0284ebe2
Component: engine
2017-05-19 13:47:32 +08:00
ba221c0328 Properly identify ingress network created with older swarm
- otherwise docker network prune will remove it

Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 93763f11eeec5e9b1d0308a3ad85bbf069f9107f
Component: engine
2017-05-18 19:47:45 -07:00
b1680367c9 Adding support for DNS search on RS1
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
Upstream-commit: b8e8dcd6e031d005a2d46d95f84da35b436cd870
Component: engine
2017-05-18 19:41:06 -07:00
01eae47819 Merge pull request #33281 from dmcgowan/overlay2-on-btrfs
Support overlay2 on btrfs
Upstream-commit: 01af41ed99f96693bd04bec1cf0f7a6b97bc2408
Component: engine
2017-05-19 03:09:39 +02:00
10c5371927 Support overlay2 on btrfs
OverlayFS is supported on top of btrfs as of Linux Kernel 4.7.
Skip the hard enforcement when on kernel 4.7 or newer and
respect the kernel check override flag on older kernels.
https://btrfs.wiki.kernel.org/index.php/Changelog#By_feature

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: f64a4ad008e68996afcec3ab34a869887716f944
Component: engine
2017-05-18 15:26:03 -07:00
6b7f9e397d Merge pull request #33250 from cyphar/apparmor-readonly-root-fix
apparmor: make pkg/aaparser work on read-only root
Upstream-commit: 6b262572028cc249b7da8cc55459197395fdb33e
Component: engine
2017-05-18 23:17:31 +02:00
b7e3ae2808 Merge pull request #33264 from wenjianhn/chkp-ls
Fix checkpoint ls
Upstream-commit: cc24049f77eb94ad486bd22c2470f0d13d6158a1
Component: engine
2017-05-18 13:37:42 -07:00
17712f857a Improved poor memory efficiency of awslogs
Signed-off-by: YAMASAKI Masahide <masahide.y@gmail.com>
Upstream-commit: 524f30634018ce619da61aa0a13dad245e098226
Component: engine
2017-05-18 23:30:00 +09:00
a65ff11d52 Fix checkpoint ls
Use create=false when calling getCheckpointDir
Fix #33263

Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
Upstream-commit: c0d2ec1eb585a31e3d7734aef7acb753644c49c0
Component: engine
2017-05-18 10:57:10 +08:00
cee45f7710 Adding network specific options to service create/update
The commit adds capability to accept csv parameters
for network option in service create/update commands.The change
includes name,alias driver options specific to the network.
With this the following will be supported

docker service create --name web --network name=docknet,alias=web1,driver-opt=field1=value1 nginx
docker service create --name web --network docknet nginx
docker service update web --network-add name=docknet,alias=web1,driver-opt=field1=value1
docker service update web --network-rm docknet

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
Upstream-commit: fe11de01772ec7c7501d3b679ce94d41bcc14060
Component: engine
2017-05-17 18:46:34 -07:00
4f94cc50a4 Integrate local datascope network with swarm
Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: b34d3e730fe3eee4b058e4dc165a7d4964e00a2a
Component: engine
2017-05-17 15:50:28 -07:00
eefcf59562 Allow to control network scope
- User can now promote a network's scope to swarm,
  so that the network is visible to swarm

Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: fcafc7108b7b7f2ca9c2982b29b47de424f2da52
Component: engine
2017-05-17 15:50:28 -07:00
9f01da606a Support configuration networks
- They are configuration-only networks which
  can be used to supply the configuration
  when creating regular networks.
- They do not get allocated and do net get plumbed.
  Drivers do not get to know about them.
- They can be removed, once no other network is
  using them.
- When user creates a network specifying a
  configuration network for the config, no
  other network specific configuration field
  is are accepted. User can only specify
  network operator fields (attachable, internal,...)

Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 9ee7b4dda926a1444dc0ea50c4ca6d90c8684060
Component: engine
2017-05-17 15:50:28 -07:00
5f22605796 support cluster events
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: 59d45c384a2de7bca73296ce1471646db14cb0c8
Component: engine
2017-05-17 11:46:30 -07:00
e7e4e93352 apparmor: make pkg/aaparser work on read-only root
This is necessary because normally `apparmor_parser -r` will try to
create a temporary directory on the host (which is not allowed if the
host has a rootfs). However, the -K option bypasses saving things to the
cache (which avoids this issue).

  % apparmor_parser -r /tmp/docker-profile
  mkstemp: Read-only file system
  % apparmor_parser -Kr /tmp/docker-profile
  %

In addition, add extra information to the ensureDefaultAppArmorProfile
errors so that problems like this are easier to debug.

Fixes: 2f7596aaef3a ("apparmor: do not save profile to /etc/apparmor.d")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: dd340c52cb37d29d8bae687fdc60e039341b4295
Component: engine
2017-05-18 00:05:13 +10:00
f81cca9824 Merge pull request #33075 from x1022as/stop
fix inconsistent state string with containerd
Upstream-commit: 4dd3e5b77c2f5ab8203cb8fc239e8441a504d799
Component: engine
2017-05-17 09:27:47 -04:00
ad53a9e7a1 Merge pull request #30891 from mixja/awslogs-multiline-support
Add awslogs multiline support
Upstream-commit: 50342883819194f6d86594d076efc948f92c757d
Component: engine
2017-05-17 09:27:21 -04:00
6f26254653 Merge pull request #32237 from jlhawn/update_container_wait
Update Container Wait
Upstream-commit: c053a2069e1c8e99488517071540fb3e526233f3
Component: engine
2017-05-17 02:39:52 +02:00
0e311d1c4e Merge pull request #33151 from nwt/push-foreign-layers
Add daemon option to push foreign layers
Upstream-commit: a30ef99e8dd2c3e7a54b6410a5709f61db59c07f
Component: engine
2017-05-17 02:04:31 +02:00
4fcc705035 Merge pull request #33169 from johnstep/windows-configs
Add Windows configs support
Upstream-commit: 7658851e74b63fa7a1c3dfa5bf950712cfe72d4e
Component: engine
2017-05-16 16:46:34 -07:00
caabf0e2ac Merge pull request #32388 from nishanttotla/pin-by-digest-on-client-alternative
Moving docker service digest pinning to client side
Upstream-commit: d6f4fe9e38b60f63e429fff7ffced9c26cbf8236
Component: engine
2017-05-16 15:24:07 -07:00
fa44d02011 Update ContainerWait API
This patch adds the untilRemoved option to the ContainerWait API which
allows the client to wait until the container is not only exited but
also removed.

This patch also adds some more CLI integration tests for waiting for a
created container and waiting with the new --until-removed flag.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Handle detach sequence in CLI

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Update Container Wait Conditions

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Apply container wait changes to API 1.30

The set of changes to the containerWait API missed the cut for the
Docker 17.05 release (API version 1.29). This patch bumps the version
checks to use 1.30 instead.

This patch also makes a minor update to a testfile which was added to
the builder/dockerfile package.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Remove wait changes from CLI

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address minor nits on wait changes

- Changed the name of the tty Proxy wrapper to `escapeProxy`
- Removed the unnecessary Error() method on container.State
- Fixes a typo in comment (repeated word)

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Use router.WithCancel in the containerWait handler

This handler previously added this functionality manually but now uses
the existing wrapper which does it for us.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Add WaitCondition constants to api/types/container

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address more ContainerWait review comments

- Update ContainerWait backend interface to not return pointer values
  for container.StateStatus type.
- Updated container state's Wait() method comments to clarify that a
  context MUST be used for cancelling the request, setting timeouts,
  and to avoid goroutine leaks.
- Removed unnecessary buffering when making channels in the client's
  ContainerWait methods.
- Renamed result and error channels in client's ContainerWait methods
  to clarify that only a single result or error value would be sent
  on the channel.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Move container.WaitCondition type to separate file

... to avoid conflict with swagger-generated code for API response

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address more ContainerWait review comments

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 4921171587c09d0fcd8086a62a25813332f44112
Component: engine
2017-05-16 15:11:39 -07:00
3f22cbeb2a Update Container Wait Backend
This patch consolidates the two WaitStop and WaitWithContext methods
on the container.State type. Now there is a single method, Wait, which
takes a context and a bool specifying whether to wait for not just a
container exit but also removal.

The behavior has been changed slightly so that a wait call during a
Created state will not return immediately but instead wait for the
container to be started and then exited.

The interface has been changed to no longer block, but instead returns
a channel on which the caller can receive a *StateStatus value which
indicates the ExitCode or an error if there was one (like a context
timeout or state transition error).

These changes have been propagated through the rest of the deamon to
preserve all other existing behavior.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: cfdf84d5d04c8ee656e5c4ad3db993c258e52674
Component: engine
2017-05-16 15:09:14 -07:00
67b57727bd Add daemon option to push foreign layers
The --allow-nondistributable-artifacts daemon option specifies
registries to which foreign layers should be pushed.  (By default,
foreign layers are not pushed to registries.)

Additionally, to make this option effective, foreign layers are now
pulled from the registry if possible, falling back to the URLs in the
image manifest otherwise.

This option is useful when pushing images containing foreign layers to a
registry on an air-gapped network so hosts on that network can pull the
images without connecting to another server.

Signed-off-by: Noah Treuhaft <noah.treuhaft@docker.com>
Upstream-commit: 67fdf574d5acd6ddccb6ece0ffe0ace1c1608712
Component: engine
2017-05-16 14:36:36 -07:00
0f00ae4912 Add Windows configs support
Signed-off-by: John Stephens <johnstep@docker.com>
Upstream-commit: e0d533b1e8a8dd62ed6dff2dfda3c3220e0474b9
Component: engine
2017-05-16 14:25:32 -07:00