Commit graph

44165 commits

Author SHA1 Message Date
Sebastiaan van Stijn
20d6b5c1bd
Merge pull request #43702 from thaJeztah/daemon_event_simplify
daemon: LogDaemonEventWithAttributes: don't call SystemInfo()
2022-06-08 02:25:23 +02:00
Sebastiaan van Stijn
9959eceb9a
Merge pull request #42626 from mfeit-internet2/small-ipv4-networks
Support small ipv4 networks
2022-06-07 22:15:19 +02:00
Sebastiaan van Stijn
3b94561db2
Merge pull request #43662 from vvoland/fix-logs-regression2
daemon/logger: Driver-scope buffer pools, bigger buffers
2022-06-07 22:04:14 +02:00
Sebastiaan van Stijn
f90056a79d
daemon: LogDaemonEventWithAttributes: don't call SystemInfo()
This function was calling SystemInfo() only to get the daemon's name
to add to the event that's generated.

SystemInfo() is quite heavy, and no info other than the Name was used.
The name returned is just looking up the hostname, so instead, call
`hostName()` directly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-07 22:01:12 +02:00
Sebastiaan van Stijn
237c30dacf
Merge pull request #43704 from thaJeztah/codecov_report_only
codecov: disable patch status
2022-06-07 20:21:07 +02:00
Sebastiaan van Stijn
9ccedde970
Merge pull request #43695 from AkihiroSuda/remove-io.containerd.runtime.v1.linux
daemon: remove support for deprecated `io.containerd.runtime.v1.linux`
2022-06-07 17:29:54 +02:00
Sebastiaan van Stijn
b2795564dc
codecov: disable "patch" status
CodeCov has been very hit-and-miss recently; it looks like we
may need some additional settings to make it compare with the
correct parent commit (perhaps it doesn't work well with rebasing),

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-07 17:24:46 +02:00
Sebastiaan van Stijn
aca813e135
Merge pull request #43700 from thaJeztah/update_containerd_1.6.6
update containerd binary to v1.6.6
2022-06-07 01:50:53 +02:00
Tianon Gravi
9948e1425d
Merge pull request #43699 from thaJeztah/bump_containerd_1.6.6
vendor: github.com/containerd/containerd v1.6.6
2022-06-06 16:04:46 -07:00
Sebastiaan van Stijn
73b4b07c4d
vendor: github.com/containerd/containerd v1.6.6
full diff: https://github.com/containerd/containerd/compare/v1.6.5...v1.6.6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-06 22:42:00 +02:00
Sebastiaan van Stijn
a7e3182757
update containerd binary to v1.6.6
Welcome to the v1.6.6 release of containerd!

The sixth patch release for containerd 1.6 includes a fix for
[CVE-2022-31030](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-31030).

Notable Updates

- Fix ExecSync handler to cap console output size ([GHSA-5ffw-gxpp-mxpf](https://github.com/containerd/containerd/security/advisories/GHSA-5ffw-gxpp-mxpf))

full diff: https://github.com/containerd/containerd/compare/v1.6.5...v1.6.6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-06 22:38:36 +02:00
Akihiro Suda
c3eefab550
hack: remove error_on_leaked_containerd_shims
The function does not support containerd-shim-runc-v2 (io.containerd.runc.v2)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-06-05 18:41:44 +09:00
Akihiro Suda
1fcd9f73d4
hack: stop installing containerd-shim (io.containerd.runtime.v1.linux)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-06-05 18:41:44 +09:00
Akihiro Suda
658a4b0fec
libcontainerd: remove support for runtime v1 API
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-06-05 18:41:44 +09:00
Akihiro Suda
2c7a6d7bb1
daemon: remove support for deprecated io.containerd.runtime.v1.linux
This has been deprecated in Docker 20.10.0 (f63f73a4a8)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-06-05 18:41:30 +09:00
Akihiro Suda
4734f1e8c9
Merge pull request #43693 from thaJeztah/bump_containerd_1.6.5
vendor: github.com/containerd/containerd v1.6.5
2022-06-05 13:39:28 +09:00
Akihiro Suda
4f1e3516f1
Merge pull request #43691 from thaJeztah/bump_containerd_binary_1.6.5
update containerd binary to v1.6.5
2022-06-05 13:39:08 +09:00
Sebastiaan van Stijn
89db5a6fd4
vendor: github.com/containerd/containerd v1.6.5
full diff: https://github.com/containerd/containerd/compare/v1.6.4...v1.6.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-04 22:39:32 +02:00
Sebastiaan van Stijn
a747cd3702
update containerd binary to v1.6.5
Welcome to the v1.6.5 release of containerd!

The fifth patch release for containerd 1.6 includes a few fixes and updated
version of runc.

Notable Updates

- Fix for older CNI plugins not reporting version
- Fix mount path handling for CRI plugin on Windows

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-04 22:28:42 +02:00
Samuel Karp
a586d536be
Merge pull request #43688 from ferozsalam/fix-names-alphabetisation 2022-06-03 16:12:03 -07:00
Sebastiaan van Stijn
38633e7971
Merge pull request #43689 from thaJeztah/fix_incorrect_warnings
daemon.NewDaemon(): fix network feature detection on first start
2022-06-03 19:30:24 +02:00
Sebastiaan van Stijn
b241e2008e
daemon.NewDaemon(): fix network feature detection on first start
Commit 483aa6294b introduced a regression, causing
spurious warnings to be shown when starting a daemon for the first time after
a fresh install:

    docker info
    ...
    WARNING: IPv4 forwarding is disabled
    WARNING: bridge-nf-call-iptables is disabled
    WARNING: bridge-nf-call-ip6tables is disabled

The information shown is incorrect, as checking the corresponding options on
the system, shows that these options are available:

    cat /proc/sys/net/ipv4/ip_forward
    1
    cat /proc/sys/net/bridge/bridge-nf-call-iptables
    1
    cat /proc/sys/net/bridge/bridge-nf-call-ip6tables
    1

The reason this is failing is because the daemon itself reconfigures those
options during networking initialization in `configureIPForwarding()`;
cf4595265e/libnetwork/drivers/bridge/setup_ip_forwarding.go (L14-L25)

Network initialization happens in the `daemon.restore()` function within `daemon.NewDaemon()`:
cf4595265e/daemon/daemon.go (L475-L478)

However, 483aa6294b moved detection of features
earlier in the `daemon.NewDaemon()` function, and collects the system information
(`d.RawSysInfo()`) before we enter `daemon.restore()`;
cf4595265e/daemon/daemon.go (L1008-L1011)

For optimization (collecting the system information comes at a cost), those
results are cached on the daemon, and will only be performed once (using a
`sync.Once`).

This patch:

- introduces a `getSysInfo()` utility, which collects system information without
  caching the results
- uses `getSysInfo()` to collect the preliminary information needed at that
  point in the daemon's lifecycle.
- moves printing warnings to the end of `daemon.NewDaemon()`, after all information
  can be read correctly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 17:54:43 +02:00
Feroz Salam
1db286c5e8 Fix alphabetisation of possible names
Signed-off-by: Feroz Salam <feroz.salam@sourcegraph.com>
2022-06-03 15:07:52 +01:00
Sebastiaan van Stijn
cf4595265e
Merge pull request #43687 from thaJeztah/update_authors_mailmap
update AUTHORS and mailmap
2022-06-03 13:15:27 +02:00
Sebastiaan van Stijn
ca6e94f994
update AUTHORS and mailmap
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 12:29:40 +02:00
Sebastiaan van Stijn
6e80c027c5
Merge pull request #43409 from vincentbernat/fix/udp-conntrack
bridge: also flush conntrack entries when setting up endpoints
2022-06-03 11:29:25 +02:00
Sebastiaan van Stijn
82e58a0011
Merge pull request #43066 from akerouanton/fix-43054
Revert "Added API to set ephemeral port allocator range."
2022-06-03 10:13:03 +02:00
Sebastiaan van Stijn
9cace7da9e
Merge pull request #43632 from thaJeztah/volumes_fixup_part2
volume/local: refactor validation to allow invalidating early
2022-06-03 09:37:57 +02:00
Sebastiaan van Stijn
cd58d11b2a
volume/local.New(): extract loading options to a function
Note that Windows does not support options, so strictly doesn't need
to have this code, but keeping it in case we're adding support.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 00:34:29 +02:00
Sebastiaan van Stijn
7e907e29a3
volume/local.New() always unmount existing mounts
Unmounting does not depend on wether or not loading options failed.

This code-path seemed to be used as a "hack" to prevent hitting the
unmount on Windows (which does not support unmounting).

Moving it outside of the "if" to make more clear that it's independent
of loading the options.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 00:34:27 +02:00
Sebastiaan van Stijn
c0f0cf6c19
volume/local: extract saving options to a separate method
Differentiate between Windows and Linux, as Windows doesn't support
options, so there's no need to save options to disk,

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 00:34:25 +02:00
Sebastiaan van Stijn
d3930330a7
volume/local: store both volume's "data" and "root" path
Instead of evaluating these paths each time (appending `_data`, or using
`filepath.Dir()` to find the root path from the `_data_` path).

This also removes the `root.DataPath()` utility, which is now no longer needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 00:34:24 +02:00
Sebastiaan van Stijn
e106e3f5c6
volume/local: make "validateOpts()" a method on Root
This way we can validate if Root supports quotaCtl, allowing us to
fail early, before creating any of the directories.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 00:34:22 +02:00
Sebastiaan van Stijn
29c6224fe9
volume/local.Create(): validate early
This moves validation of options to the start of the Create function
to prevent hitting the filesystem and having to remove the volume
from disk.

Also addressing some minor nits w.r.t. errors.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 00:34:21 +02:00
Sebastiaan van Stijn
a77b90c35e
volume/local: make setOpts() a method of localVolume
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 00:34:19 +02:00
Sebastiaan van Stijn
b56fc2d0f8
volume/local.New(): don't register volume before we're done
Loading options may fail, in which case we don't have to add
the volume to the list.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 00:34:17 +02:00
Sebastiaan van Stijn
eecf7a0840
volume/local: localVolume.mount() move errors.Wrap()
While the current code is correct (as errors.Wrap() returns nil if
err is nil), relying on this behavior has caused some confusion in
the past, resulting in regressions.

This patch makes the error-handling code slightly more idiomatic and
defensive against such regressions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 00:34:16 +02:00
Sebastiaan van Stijn
c1671abf14
volume/local: add test for validation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-03 00:34:08 +02:00
Sebastiaan van Stijn
b4b2a0323b
libnetwork/portallocator: un-export consts for defaults
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-02 22:59:32 +02:00
Albin Kerouanton
414dd017b3
Revert "Added API to set ephemeral port allocator range."
Since commit 2c4a868f64, Docker doesn't
use the value of net.ipv4.ip_local_port_range when choosing an ephemeral
port. This change reverts back to the previous behavior.

Fixes #43054.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2022-06-02 22:56:18 +02:00
Tianon Gravi
0e04b514fb
Merge pull request #43681 from thaJeztah/reduce_flakiness
fix flaky TestRunContainerWithRmFlag tests
2022-06-02 13:19:39 -07:00
Sebastiaan van Stijn
7bb335999e
Merge pull request #43675 from tonistiigi/make-pull-match-containerd
distribution: match manifest list resolution with containerd
2022-06-02 22:04:55 +02:00
Sebastiaan van Stijn
6f1cefe385
Merge pull request #43678 from crazy-max/ci-concurrency
ci: add concurrency check
2022-06-02 21:22:01 +02:00
Tonis Tiigi
9adad264d2 distribution: match manifest list resolution with containerd
Make finding the correct runtime image from image index
more compliant with OCI spec and match containerd implementation.

Changes:
- Manifest list is allowed to contain manifest lists
- Unknown mediatype inside manifest list is skipped instead of causing an error
- Platform in descriptor is optional 

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-06-02 11:21:07 -07:00
Tianon Gravi
1f00103722
Merge pull request #43676 from thaJeztah/update_golang_1.18.3
update golang to 1.18.3
2022-06-02 11:05:39 -07:00
Sebastiaan van Stijn
585c147b7a
fix flaky TestRunContainerWithRmFlag tests
This attempts to fix CI flakiness on the TestRunContainerWithRmFlagCannotStartContainer
and TestRunContainerWithRmFlagExitCodeNotEqualToZero tests.

These tests;

- get a list of all container ID's
- run a container with `--rm`
- wait for it to exit
- checks that the list of all container IDs is empty

The last step assumes that no other tests are running on the same daemon; if
another test is running, there may be other containers present (unrelated to
the test).

This patch updates the tests to use a `docker inspect` to verify the container
no longer exists afterwards.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-02 16:55:44 +02:00
Sebastiaan van Stijn
fbcdc6a980
Merge pull request #43604 from Ultimator14/master
Use separate openrc init script for containerd
2022-06-02 16:05:19 +02:00
CrazyMax
a0a6b82a0d
ci: add concurrency check
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-06-02 15:21:05 +02:00
Sebastiaan van Stijn
c1a9ffc97a
update golang to 1.18.3
go1.18.3 (released 2022-06-01) includes security fixes to the crypto/rand,
crypto/tls, os/exec, and path/filepath packages, as well as bug fixes to the
compiler, and the crypto/tls and text/template/parse packages. See the Go
1.18.3 milestone on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.18.3+label%3ACherryPickApproved

Hello gophers,

We have just released Go versions 1.18.3 and 1.17.11, minor point releases.

These minor releases include 4 security fixes following the security policy:

- crypto/rand: rand.Read hangs with extremely large buffers
  On Windows, rand.Read will hang indefinitely if passed a buffer larger than
  1 << 32 - 1 bytes.

  Thanks to Davis Goodin and Quim Muntal, working at Microsoft on the Go toolset,
  for reporting this issue.

  This is [CVE-2022-30634][CVE-2022-30634] and Go issue https://go.dev/issue/52561.
- crypto/tls: session tickets lack random ticket_age_add
  Session tickets generated by crypto/tls did not contain a randomly generated
  ticket_age_add. This allows an attacker that can observe TLS handshakes to
  correlate successive connections by comparing ticket ages during session
  resumption.

  Thanks to GitHub user nervuri for reporting this.

  This is [CVE-2022-30629][CVE-2022-30629] and Go issue https://go.dev/issue/52814.
- `os/exec`: empty `Cmd.Path` can result in running unintended binary on Windows

  If, on Windows, `Cmd.Run`, `cmd.Start`, `cmd.Output`, or `cmd.CombinedOutput`
  are executed when Cmd.Path is unset and, in the working directory, there are
  binaries named either "..com" or "..exe", they will be executed.

  Thanks to Chris Darroch, brian m. carlson, and Mikhail Shcherbakov for reporting
  this.

  This is [CVE-2022-30580][CVE-2022-30580] and Go issue https://go.dev/issue/52574.
- `path/filepath`: Clean(`.\c:`) returns `c:` on Windows

  On Windows, the `filepath.Clean` function could convert an invalid path to a
  valid, absolute path. For example, Clean(`.\c:`) returned `c:`.

  Thanks to Unrud for reporting this issue.

  This is [CVE-2022-29804][CVE-2022-29804] and Go issue https://go.dev/issue/52476.

[CVE-2022-30634]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30634
[CVE-2022-30629]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30629
[CVE-2022-30580]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30580
[CVE-2022-29804]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-29804

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-02 09:16:46 +02:00
Jan Breig
bb69104381 Openrc: Depend on containerd init script
Signed-off-by: Jan Breig <git@pygos.space>
2022-06-01 15:09:52 +02:00