Commit graph

42949 commits

Author SHA1 Message Date
Justin Cormack
9459423e31
Merge pull request #42503 from thaJeztah/bridge_redundant_list
libnetwork/bridge: remove unused "others" argument from isolateNetwork()
2021-06-10 10:51:19 +01:00
Sebastiaan van Stijn
c7b1e5ba38
portallocator: log instead of discard port-range failures
Both getDynamicPortRange() and sanitizePortRange() could produce
and error, and the error message was currently discarded, silently
falling back to using the default port range.

This patch:

- Moves the fallback message from getDynamicPortRange() to getDefaultPortRange(),
  which is where the actual fallback occurs.
- Logs the fallback message and the error that causes the fallback.

The message/error is currently printed at the INFO level, but could be raised
to a WARN, depending on what kind of situations can cause the error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 10:52:59 +02:00
Sebastiaan van Stijn
1f398f06aa
portallocator: minor refactor for readability
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 10:52:57 +02:00
Sebastiaan van Stijn
1f90fdd973
portallocator: use const for default port-ranges, instead of init()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 10:52:49 +02:00
Sebastiaan van Stijn
076d9c6037
daemon: remove graphdriver indexing by OS (used for LCOW)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 10:17:26 +02:00
Akihiro Suda
b57e71941e
Merge pull request #42499 from thaJeztah/remove_lcow_step2
Remove LCOW code (step 2)
2021-06-10 15:20:02 +09:00
Sebastiaan van Stijn
594fdec993
Merge pull request #42498 from thaJeztah/libnetwork_cleanup
libnetwork: remove some things that are no longer needed
2021-06-09 22:59:45 +02:00
Sebastiaan van Stijn
350e303c7f endpoint: remove redundant doUpdateHostsFile() function
The second (sandbox) argument was unused, and it was only
used in a single location, so we may as well inline the
check.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 22:38:34 +02:00
Sebastiaan van Stijn
508a0979d9
bridge: remove unused "others" argument from isolateNetwork()
This argument was used to detect conflicts, but was later removed in
1c73b1c99c14d7f048a2318a3caf589865c76fad.

However, it was never removed, and we were still getting a list
of all networks, without using the results.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 22:23:38 +02:00
Sebastiaan van Stijn
08ddbfbdac
libcontainerd: remove LCOW bits
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 22:05:10 +02:00
Sebastiaan van Stijn
117bca149f
libnetwork/resolver: fix minor linting issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 19:37:10 +02:00
Drew Erny
0d9b0ed678 Fix possible overlapping IPs
A node is no longer using its load balancer IP address when it no longer
has tasks that use the network that requires that load balancer. When
this occurs, the swarmkit manager will free that IP in IPAM, and may
reaassign it.

When a task shuts down cleanly, it attempts removal of the networks it
uses, and if it is the last task using those networks, this removal
succeeds, and the load balancer IP is freed.

However, this behavior is absent if the container fails. Removal of the
networks is never attempted.

To address this issue, I amend the executor. Whenever a node load
balancer IP is removed or changed, that information is passedd to the
executor by way of the Configure method. By keeping track of the set of
node NetworkAttachments from the previous call to Configure, we can
determine which, if any, have been removed or changed.

At first, this seems to create a race, by which a task can be attempting
to start and the network is removed right out from under it. However,
this is already addressed in the controller. The controller will attempt
to recreate missing networks before starting a task.

Signed-off-by: Drew Erny <derny@mirantis.com>
2021-06-09 11:21:41 -06:00
Sebastiaan van Stijn
86b4d88e55
Merge pull request #42492 from thaJeztah/remove_fsutil_debug_log
pkg/fileutils: PatternMatcher.Matches(): remove debug logging
2021-06-09 18:19:01 +02:00
Sebastiaan van Stijn
774b970cb1
libnetwork: remove MAINTAINERS and LICENSE
There's already a copy of the Apache license at the root of the
repository.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 12:37:45 +02:00
Sebastiaan van Stijn
e90d6abfcd
libnetwork: update Dockerfile to Go 1.13.15
Also adds other build-args to match the main Dockerfile

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 12:34:01 +02:00
Sebastiaan van Stijn
a384f83e7a
libnetwork: remove CircleCI config and code
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 12:31:52 +02:00
Sebastiaan van Stijn
ef4d473401
Merge pull request #42028 from thaJeztah/fix_duplicate_volume_event
volumes: only send "create" event when actually creating volume
2021-06-09 12:01:21 +02:00
Sebastiaan van Stijn
bc8acc5b08
pkg/fileutils: PatternMatcher.Matches(): remove debug logging
Trying to avoid logging code in "libraries" used elsewhere.
If this debug log is important, it should be easy to add in code
that's calling it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 11:56:00 +02:00
Sebastiaan van Stijn
4c2ec79bf2
Merge pull request #42490 from thaJeztah/test_helpers
networkdb: mark test-helpers as t.Helper()
2021-06-09 09:16:16 +02:00
Sebastiaan van Stijn
fb2c4b2cd6
Merge pull request #42486 from tianon/packagers
Remove a lot of outdated "project/PACKAGERS.md" text
2021-06-09 08:23:10 +02:00
Brian Goff
b0cef58b5e
Merge pull request #42474 from thaJeztah/unfork_swarmkit
vendor: swarmkit master (after libnetwork move)
2021-06-08 16:59:43 -07:00
Sebastiaan van Stijn
9f6add406e
networkdb: mark test-helpers as t.Helper()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 01:44:46 +02:00
Tianon Gravi
adb26d3fbe
Merge pull request #42488 from sparrc/log-fix-wait-timeout
Fix log statement 'failed to exit' timeout accuracy
2021-06-08 15:14:07 -07:00
Tianon Gravi
25879d3134 Remove a lot of outdated "project/PACKAGERS.md" text
This is just a first pass to axe some low hanging fruit.  At this point, the project is generally mature enough that I do not believe most of this is necessary.

Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
2021-06-08 14:24:19 -07:00
Sebastiaan van Stijn
b6052669e6
vendor: swarmkit master (after libnetwork move)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-08 22:47:33 +02:00
Brian Goff
a7ea29a5a6
Merge pull request #42451 from thaJeztah/remove_lcow_step1
Remove LCOW code (step 1)
2021-06-08 13:41:45 -07:00
Cam
d15ce134ef
Fix log statement 'failed to exit' timeout accuracy
log statement should reflect how long it actually waited, not how long
it theoretically could wait based on the 'seconds' integer passed in.

Signed-off-by: Cam <gh@sparr.email>
2021-06-08 13:37:58 -07:00
Akihiro Suda
0ad2293d0e
Merge pull request #41656 from thaJeztah/unexport_things 2021-06-08 12:07:40 +09:00
Sebastiaan van Stijn
424c0eb3c0
docker pull: warn when pulled single-arch image does not match --platform
This takes the same approach as was implemented on `docker build`, where a warning
is printed if `FROM --platform=...` is used (added in 399695305c)

Before:

    docker rmi armhf/busybox
    docker pull --platform=linux/s390x armhf/busybox

    Using default tag: latest
    latest: Pulling from armhf/busybox
    d34a655120f5: Pull complete
    Digest: sha256:8e51389cdda2158935f2b231cd158790c33ae13288c3106909324b061d24d6d1
    Status: Downloaded newer image for armhf/busybox:latest
    docker.io/armhf/busybox:latest

With this change:

    docker rmi armhf/busybox
    docker pull --platform=linux/s390x armhf/busybox

    Using default tag: latest
    latest: Pulling from armhf/busybox
    d34a655120f5: Pull complete
    Digest: sha256:8e51389cdda2158935f2b231cd158790c33ae13288c3106909324b061d24d6d1
    Status: Downloaded newer image for armhf/busybox:latest
    WARNING: image with reference armhf/busybox was found but does not match the specified platform: wanted linux/s390x, actual: linux/arm64
    docker.io/armhf/busybox:latest

And daemon logs print:

   WARN[2021-04-26T11:19:37.153572667Z] ignoring platform mismatch on single-arch image  error="image with reference armhf/busybox was found but does not match the specified platform: wanted linux/s390x, actual: linux/arm64" image=armhf/busybox

When pulling without specifying `--platform, no warning is currently printed (but we can add a warning in future);

    docker rmi armhf/busybox
    docker pull armhf/busybox

    Using default tag: latest
    latest: Pulling from armhf/busybox
    d34a655120f5: Pull complete
    Digest: sha256:8e51389cdda2158935f2b231cd158790c33ae13288c3106909324b061d24d6d1
    Status: Downloaded newer image for armhf/busybox:latest
    docker.io/armhf/busybox:latest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-07 23:08:45 +02:00
Sebastiaan van Stijn
22186d2645
vendor: github.com/opencontainers/selinux v1.8.2
full diff:

- https://github.com/opencontainers/selinux/compare/v1.8.0...v1.8.2
- https://github.com/bits-and-blooms/bitset/compare/v1.1.11...v1.2.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-07 10:09:21 +02:00
Sebastiaan van Stijn
aa4dce742f
daemon: improve handling of ROOTLESSKIT_PARENT_EUID
- daemon.WithRootless():  make sure ROOTLESSKIT_PARENT_EUID is valid int
- daemon.RawSysInfo(): minor simplification, and rename variable that
  clashed with imported package.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-05 21:12:32 +02:00
Sebastiaan van Stijn
8dbd90ec00
Merge pull request #42071 from jmguzik/41926-cgroups-swap-memory-max
Fix setting swaplimit=true without checking memory.swap.max
2021-06-05 17:01:35 +02:00
Sebastiaan van Stijn
58f0a1597d
Merge pull request #42465 from thaJeztah/no_sushi_today
libnetwork: replace BurntSushi/toml with pelletier/go-toml
2021-06-05 15:56:29 +02:00
Sebastiaan van Stijn
a7ecbd4b29
libnetwork: replace BurntSushi/toml with pelletier/go-toml
The BurntSushi project is no longer maintained, and the container ecosystem
is moving to use the pelletier/go-toml project instead.

This patch moves libnetwork to use the pelletier/go-toml library, to reduce
our dependency tree and use the same library in all places.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-05 00:53:49 +02:00
Brian Goff
e27beeba0f
Merge pull request #42249 from thaJeztah/bump_containerd
vendor: github.com/containerd/containerd v1.5.2
2021-06-04 15:33:47 -07:00
Sebastiaan van Stijn
7c1c123555
vendor: github.com/containerd/containerd v1.5.2
full diff: 19ee068f93...v1.5.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-04 16:32:37 +02:00
Sebastiaan van Stijn
989cd6e8f6
vendor: github.com/containerd/typeurl v1.0.2
Fixes locking for getTypeByUrl

full diff: https://github.com/containerd/typeurl/compare/v1.0.1...v1.0.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-04 16:27:41 +02:00
Sebastiaan van Stijn
0bc4035f76
vendor: github.com/containerd/go-runc v1.0.0 (add version comment)
v1.0.0 and the commit we were using were identical:

16b287bc67...v1.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-04 16:27:39 +02:00
Sebastiaan van Stijn
0691addf6a
vendor: github.com/containerd/cgroups v1.0.1
full diff: 0b889c03f1...v1.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-04 16:27:37 +02:00
Sebastiaan van Stijn
134b73a1ea
vendor: github.com/containerd/continuity v0.1.0
full diff: efbc4488d8...v0.1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-04 16:27:35 +02:00
Sebastiaan van Stijn
bfb5b8017b
vendor: github.com/containerd/fifo v1.0.0
full diff: 0724c46b32...v1.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-04 16:27:05 +02:00
Akihiro Suda
e0cabedf14
Merge pull request #42460 from thaJeztah/update_authors
Update AUTHORS and mailmap
2021-06-04 15:10:51 +09:00
Akihiro Suda
33c332ad19
Merge pull request #42143 from thaJeztah/check_libcontainer
vendor: github.com/opencontainers/runc v1.0.0-rc95
2021-06-04 14:00:13 +09:00
Sebastiaan van Stijn
778c8f787d
Update AUTHORS and mailmap
Updating the list to account for the new commits from libnetwork.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-04 02:18:49 +02:00
Samuel Karp
a2343c8c4f
Merge pull request #42409 from joakimr-axis/joakimr-axis_noawk
contrib/check-config.sh: Remove awk dependency
2021-06-03 15:55:21 -07:00
Jakub Guzik
7ef6ece774 Fix setting swaplimit=true without checking
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-06-03 22:54:10 +02:00
Joakim Roubert
ffc6d8d3dd contrib/check-config.sh: Remove awk dependency
The awk dependency is an issue when running check-config.sh on systems
without awk. The use of awk can be replaced with sed, which improves
portability.

The PR code review discussion iterated via grep to this final sed
version that is all Tianon Gravi's art.

Co-authored-by: Tianon Gravi <admwiggin@gmail.com>
Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
2021-06-03 21:26:49 +02:00
Sebastiaan van Stijn
e047d984dc
Remove LCOW code (step 1)
The LCOW implementation in dockerd has been deprecated in favor of re-implementation
in containerd (in progress). Microsoft started removing the LCOW V1 code from the
build dependencies we use in Microsoft/opengcs (soon to be part of Microsoft/hcshhim),
which means that we need to start removing this code.

This first step removes the lcow graphdriver, the LCOW initialization code, and
some LCOW-related utilities.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-03 21:16:21 +02:00
Brian Goff
a77317882d
Merge pull request #42262 from cpuguy83/move_libnetwork
Move libnetwork
2021-06-03 12:06:31 -07:00
Brian Goff
20eb137e0a
Merge pull request #42334 from AkihiroSuda/rootless-overlay2-k511-selinux
rootless: disable overlay2 if running with SELinux
2021-06-03 10:33:27 -07:00