Commit graph

2990 commits

Author SHA1 Message Date
Tibor Vass
32e231a258 Merge pull request #2560 from thaJeztah/remove_dead_code
types: remove some dead code
2020-09-17 13:22:34 -07:00
Tibor Vass
2d8f0b4f87 Merge pull request #2562 from thaJeztah/replace_pkg_homedir
client/mflag: remove use of docker/docker/pkg/homedir
2020-09-17 13:21:49 -07:00
Tibor Vass
1d903b1089 Merge pull request #2580 from thaJeztah/update_circleci
CircleCI: update to Docker 19.03.12, and enable BuildKit
2020-09-17 13:13:15 -07:00
Sebastiaan van Stijn
0e8b02bac4 Makefile: enable BuildKit
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-11 16:39:51 +02:00
Sebastiaan van Stijn
53688d374e CircleCI: update to Docker 19.03.12
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-11 16:39:34 +02:00
Arko Dasgupta
37ce0eeea6 Merge pull request #2576 from thaJeztah/skip_kernel_version_checks
Skip redundant kernel version checks
2020-09-08 11:01:32 -07:00
Sebastiaan van Stijn
6dde6cb0b0 drivers/macvlan: skip kernel version check
All distros that are supported by Docker now have at least
kernel version 3.10, so this check should no longer be needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-31 20:45:02 +02:00
Sebastiaan van Stijn
02d313ca15 drivers/bridge: skip kernel version check
All distros that are supported by Docker now have at least
kernel version 3.10, so this check should no longer be needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-31 20:44:51 +02:00
Sebastiaan van Stijn
b4ba050e83 Merge pull request #2561 from thaJeztah/update_errortesting
testing: remove use of docker/docker/errdefs in tests
2020-08-31 17:46:37 +02:00
Sebastiaan van Stijn
570c5f9e76 testing: remove use of docker/docker/errdefs in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-17 11:08:39 +02:00
Arko Dasgupta
c37654e9d3 Merge pull request #2563 from thaJeztah/no_error
log error instead if disabling IPv6 router advertisement failed
2020-06-12 11:08:13 -07:00
Sebastiaan van Stijn
27345e8f8f log error instead if disabling IPv6 router advertisement failed
Previously, failing to disable IPv6 router advertisement prevented the daemon to
start.

An issue was reported by a user that started docker using `systemd-nspawn "machine"`,
which produced an error;

    failed to start daemon: Error initializing network controller:
    Error creating default "bridge" network: libnetwork:
    Unable to disable IPv6 router advertisement:
    open /proc/sys/net/ipv6/conf/docker0/accept_ra: read-only file system

This patch changes the error to a log-message instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-12 19:32:18 +02:00
Sebastiaan van Stijn
9fd12a5e31 client/mflag: remove use of docker/docker/pkg/homedir
The homedir package was only used to print default values for
flags that contained paths inside the user's home-directory in
a slightly nicer way (replace `/users/home` with `~`).

Given that this is not critical, we can replace this with golang's
function, which does not depend on libcontainer.

There's still one use of the homedir package in docker/docker/opts,
which is used by the dnet binary (but only requires the homedir
package when running in rootless mode)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-04 12:48:37 +02:00
Sebastiaan van Stijn
42b87e6a4b types: remove some dead code
These errors were not in use, so we can remove them

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-04 12:07:03 +02:00
Tibor Vass
dc89fc3449 Merge pull request #2558 from thaJeztah/master_router_advertisements
[master] bridge: disable IPv6 router advertisements
2020-06-02 11:02:38 -07:00
Arko Dasgupta
778162ba19 Merge pull request #2554 from xinfengliu/fix-network-not-found
Fix 'failed to get network during CreateEndpoint'
2020-06-02 08:34:55 -07:00
Samuel Karp
e65003a722 bridge: disable IPv6 router advertisements
Signed-off-by: Samuel Karp <skarp@amazon.com>
(cherry picked from commit 9489546c44d94d37337191c263879a7ac075a331)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-02 12:06:39 +02:00
Xinfeng Liu
0c8ffda2ab Fix 'failed to get network during CreateEndpoint'
Fix 'failed to get network during CreateEndpoint' during container starting.
Change the error type to `libnetwork.ErrNoSuchNetwork`, so `Start()` in `daemon/cluster/executor/container/controller.go` will recreate the network.

Signed-off-by: Xinfeng Liu <xinfeng.liu@gmail.com>
2020-06-01 17:16:07 +08:00
Arko Dasgupta
fd1765ca9b Merge pull request #2556 from thaJeztah/remove_unused_error
store.getNetworksFromStore() remove unused error return
2020-05-28 20:03:21 -07:00
Sebastiaan van Stijn
07ed00102d store.getNetworksFromStore() remove unused error return
This function always returned `nil`, so we can remove the error
return, and update other functions that were handling errors.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-26 10:39:38 +02:00
Arko Dasgupta
3f0652ac36 Merge pull request #2548 from arkodg/add-intf-firewalld-zone
Add docker interfaces to firewalld docker zone
2020-05-21 11:34:49 -07:00
Arko Dasgupta
2b0385bc3f Merge pull request #2551 from thaJeztah/fix_error_handling
Resolver: fix error handling if we didn't receive a response
2020-05-21 11:02:33 -07:00
Sebastiaan van Stijn
efe0ab37a1 Resolver: fix error handling if we didn't receive a response
Commit 2a480d515e updated the DNS library
and updated the error handling.

Due to changes in the library, we now had to check the response itself
to check if the response was truncated (Truncated DNS replies should
be sent to the client so that the client can retry over TCP).

However, 1e02aae252 added an incorrect
`nil` check to fix a panic, which ignored situations where
an error was returned, but no response (for example, if we failed
to connect to the DNS server).

In that situation, the error would be ignored, and further down we
would consider the connection to have been succesfull, but the DNS
server not returning a result.

After a "successful" lookup (but no results), we break the loop,
and don't attempt lookups in other DNS servers.

Versions before 1e02aae252 would produce:

    Name To resolve: bbc.co.uk.
    [resolver] query bbc.co.uk. (A) from 172.21.0.2:36181, forwarding to udp:192.168.5.1
    [resolver] read from DNS server failed, read udp 172.21.0.2:36181->192.168.5.1:53: i/o timeout
    [resolver] query bbc.co.uk. (A) from 172.21.0.2:38582, forwarding to udp:8.8.8.8
    [resolver] received A record "151.101.0.81" for "bbc.co.uk." from udp:8.8.8.8
    [resolver] received A record "151.101.192.81" for "bbc.co.uk." from udp:8.8.8.8
    [resolver] received A record "151.101.64.81" for "bbc.co.uk." from udp:8.8.8.8
    [resolver] received A record "151.101.128.81" for "bbc.co.uk." from udp:8.8.8.8

Versions after that commit would ignore the error, and stop further lookups:

    Name To resolve: bbc.co.uk.
    [resolver] query bbc.co.uk. (A) from 172.21.0.2:59870, forwarding to udp:192.168.5.1
    [resolver] external DNS udp:192.168.5.1 returned empty response for "bbc.co.uk."

This patch updates the logic to handle the error to log the error (and continue with the next DNS):

 - if an error is returned, and no response was received
 - if an error is returned, but it was not related to a truncated response

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Tibor Vass <tibor@docker.com>
2020-05-21 17:50:39 +00:00
Arko Dasgupta
23d1ca4426 Add docker interfaces to firewalld docker zone
If firewalld is running, create a new docker zone and
add the docker interfaces to the docker zone to allow
container networking for distros with firewalld enabled

Fixes: https://github.com/moby/libnetwork/issues/2496

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2020-05-07 18:37:33 -07:00
Arko Dasgupta
b1729e8588 Merge pull request #2547 from thaJeztah/bump_ipvs
vendor: update moby/ipvs v1.0.1
2020-04-28 09:15:29 -07:00
Sebastiaan van Stijn
c30d55d067 vendor: update moby/ipvs v1.0.1
full diff: https://github.com/moby/ipvs/compare/v1.0.0...v1.0.1

- Fix compatibility issue on older kernels (< 3.18) where the address
  family attribute for destination servers do not exist
- Fix the stats attribute check when parsing destination addresses
- NetlinkSocketsTimeout should be a constant

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-28 17:04:14 +02:00
Arko Dasgupta
7fd076595a Merge pull request #2471 from suwang48404/master
DOCKER-USER chain not created when IPTableEnable=false.
2020-04-09 15:01:08 -07:00
Arko Dasgupta
8844968f3f Merge pull request #2544 from arkodg/fix-npe-ep-iface
Fix NPE due to null value returned by ep.Iface()
2020-04-04 08:54:23 -07:00
Arko Dasgupta
c7f0b0152e Fix NPE due to null value returned by ep.Iface()
This PR carryforwards https://github.com/moby/libnetwork/pull/2239
and incorporates the suggestions in comments to fix the NPE and
potential NPEs due to a null value returned by ep.Iface()

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2020-04-02 22:34:55 -07:00
Sebastiaan van Stijn
6b3673877c Merge pull request #2538 from wangyumu/add-error-invalid-default-address-pools
Fixes moby/moby#40388, produce an error with invalid address pool
2020-03-31 19:45:25 +02:00
Arko Dasgupta
2e64325fee Merge pull request #2540 from SamWhited/resolver_panic
Fixes a panic in the DNS resolver
2020-03-18 11:26:00 -07:00
Arko Dasgupta
e49ee8266d Merge pull request #2460 from moby/revert-2450-iptables-policy
Revert "Always configure iptables forward policy"
2020-03-18 11:22:47 -07:00
Sam Whited
1e02aae252 Fixes a panic in the DNS resolver
Under certain conditions it appears that the DNS response and returned
error can be nil. When this happens, checking resp.Truncated results in
a nil panic so we must first check that the response is not nil before
checking if a truncated response was received.

See moby/moby#40715

Signed-off-by: Sam Whited <sam@samwhited.com>
2020-03-18 13:59:59 -04:00
Wang Yumu
4dda50d226 Fixes moby/moby#40388
Signed-off-by: Wang Yumu <37442693@qq.com>
2020-03-18 00:09:10 +08:00
Arko Dasgupta
e8d86036c1 Merge pull request #2536 from thaJeztah/update_netlink
vendor: update vishvananda/netlink v1.1.0
2020-03-12 14:31:41 -07:00
Sebastiaan van Stijn
d846c2b1ab vendor: update vishvananda/netlink v1.1.0
full diff: https://github.com/vishvananda/netlink/compare/v1.0.0...v1.1.0

also updated moby/ipvs, which is compatible with this version of netlink,
and update vishvananda/netns to current master (which added go.mod)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-03-12 18:25:54 +01:00
Arko Dasgupta
3dc9ff93cb Merge pull request #2533 from cpuguy83/ipvs_vendor
Use vendored ipvs package
2020-03-11 12:29:53 -07:00
Brian Goff
a533fe7094 Use vendored ipvs package
The ipvs package was moved to a separate repo.

The ipvs package is a fairly generic set of helpers for managing IPVS.
The ipvs package is used by docker swarm and kubernetes.
Because we want to merge libnetwork back into the moby/moby codebase
while also not creating more dependencies for other projects on
moby/moby itself, it was decided that the best path for ipvs is to live
on it's own since there are no other ties to libnetwork.

Ref: https://github.com/moby/libnetwork/issues/2522

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-03-11 12:13:37 -07:00
elangovan sivanandam
c485bbf754 Merge pull request #2523 from arkodg/seperate-internal-empty-parent
Macvlan: Separate empty parent and internal
2020-03-05 15:26:57 -05:00
elangovan sivanandam
a9596db128 Merge pull request #2524 from trapier/cleanup-vfp-during-network-removal
Cleanup VFP during overlay network removal
2020-03-05 14:55:50 -05:00
Arko Dasgupta
76b5905cbe Macvlan: Separate empty parent and internal
https://github.com/docker/libnetwork/pull/2419 and
https://github.com/docker/libnetwork/pull/2407
attempted to seperate out empty parent and internal for
macvlan and ipvlan networks

However it didnt pass the integration tests in moby
https://github.com/moby/moby/pull/40596 and exposed some
more plumbing that needed to be done to make sure
we separate the two things

If the -o parent is empty we create a dummylink
and if internal is set we dont add a default gateway
and make sure north-south communication cannot take place
(only east-west / container-container can)

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2020-03-04 13:24:10 -08:00
Arko Dasgupta
402a6b7dbc Merge pull request #2519 from wangyumu/fix-InhibitIPv4-nil-panic
Fix InhibitIPv4 nil panic
2020-03-04 13:20:06 -08:00
Trapier Marshall
c39ac9c05e Cleanup VFP during overlay network removal
Deleting a network sandbox on Linux implicitly clears OS (ipvs) load
balancer state.  Deleting an HNS network on Windows by contrast does not
inherently remove its corresponding VFP load balancers. The method to
remove load balancers belongs to the network and so must be called prior
to or while deleting a network. This commit reverts one line from
ea2fa20859, reintroducing a call to
explicitly remove backend load balancers during network removal.

Signed-off-by: Trapier Marshall <tmarshall@mirantis.com>
2020-03-03 19:48:38 -05:00
Arko Dasgupta
6a176585c6 Merge pull request #2518 from AkihiroSuda/vendor-gobus-v5
vendor godbus/dbus v5
2020-03-02 17:38:47 -08:00
Wang Yumu
41a91e9a5d fix InhibitIPv4 nil panic
Signed-off-by: Wang Yumu <37442693@qq.com>
2020-03-02 23:38:13 +08:00
Akihiro Suda
7ca71f2c49 vendor godbus/dbus v5
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-02-28 18:47:00 +09:00
elangovan sivanandam
6b083a72d0 Merge pull request #2514 from thaJeztah/bump_golang_1.13
Dockerfile: update to Go 1.13.8
2020-02-27 23:12:44 -05:00
Sebastiaan van Stijn
add7253d68 Dockerfile: update to Go 1.13.8
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-27 11:46:18 +01:00
Sebastiaan van Stijn
129e28baa3 Fix gofmt in preparation of Go 1.13 update
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-27 11:46:16 +01:00
elangovan sivanandam
c3cf1da916 Merge pull request #2513 from thaJeztah/bump_golang_1.12.17
Dockerfile: update to Golang 1.12.17
2020-02-26 18:06:17 -05:00