Commit graph

45267 commits

Author SHA1 Message Date
Sebastiaan van Stijn
d109e429dd
Merge pull request #44723 from thaJeztah/devmapper_simplify_udev_error
daemon/graphdriver/devicemapper: simplify Udev log, and update link
2022-12-31 17:05:42 +01:00
Sebastiaan van Stijn
237c15888d
Merge pull request #44722 from thaJeztah/use_the_osusergo_luke
daemon/logger/gcplogs: remove ensureHomeIfIAmStatic workaround
2022-12-31 15:45:38 +01:00
Sebastiaan van Stijn
a5ebd28797
daemon/graphdriver/devicemapper: simplify Udev log, and update link
Simplify the error message so that we don't have to distinguish between static-
and non-static builds. Also update the link to the storage-driver section to
use a "/go/" redirect in the docs, as the anchor link was no longer correct.
Using a "/go/" redirect  makes sure the link remains functional if docs is  moving
around.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-31 14:36:57 +01:00
Sebastiaan van Stijn
155e39187c
daemon/logger/gcplogs: remove ensureHomeIfIAmStatic workaround
This function was added in b86e3bee5a to
work around an issue in os/user.Current(), which SEGFAULTS when compiling
statically with cgo enabled (see golang/go#13470).

We hit similar issues in other parts, and contributed a "osusergo" build-
tag in https://go-review.googlesource.com/c/go/+/330753. The "osusergo"
build tag must be set when compiling static binaries with cgo enabled.
If that build-tag is set, the cgo implementation for user.Current() won't
be used, and a pure-go implementation is used instead;
https://github.com/golang/go/blob/go1.19.4/src/os/user/cgo_lookup_unix.go#L5

With the above in place, we no longer need this workaround, and can remove
the ensureHomeIfIAmStatic() function.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-31 13:59:06 +01:00
Cory Snider
8e69882c03
Merge pull request #44379 from thaJeztah/container_strings_cut
api/types/container: refactor to use strings.Cut, DRY, move tests and fix validation
2022-12-30 15:07:56 -05:00
Bjorn Neergaard
f5106148e3
Merge pull request #43060 from akerouanton/fix-42127
Check iptables options before looking for ip6tables binary
2022-12-29 17:13:36 -07:00
Sebastiaan van Stijn
eef2d20e23
Merge pull request #43285 from thaJeztah/cleanup_testutils
integration-cli: cleanup some of the test-utilities
2022-12-30 00:41:35 +01:00
Bjorn Neergaard
d8e3e6d606
Merge pull request #44705 from thaJeztah/inspect_literal
daemon: rename vars that collided, and use struct-literals
2022-12-29 16:08:22 -07:00
Bjorn Neergaard
865fdf4dcd
Merge pull request #44668 from masibw/44269-marshal-json-empty
api: can marshal and unmarshal when args.fields is empty
2022-12-29 15:39:50 -07:00
Akihiro Suda
2f9987c816
Merge pull request #44713 from thaJeztah/carry_44600_update_delve
Update delve version (carry 44600)
2022-12-30 07:23:58 +09:00
Sebastiaan van Stijn
5b908cfb5f
Merge pull request #44699 from thaJeztah/docker_proxy_version_flag
cmd/docker-proxy: add "-v / --version" flag
2022-12-29 21:01:18 +01:00
Yamazaki Masashi
5fed968b1d
api: can marshal and unmarshal when args.fields is empty
Signed-off-by: Yamazaki Masashi <masi19bw@gmail.com>
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2022-12-29 12:49:01 -07:00
Bjorn Neergaard
0e4efb15f5
Merge pull request #44707 from zhsj/btrfs-progs-6.1
daemon/graphdriver/btrfs: workaround field rename in btrfs-progs 6.1
2022-12-29 12:45:18 -07:00
oscar.chen
ad8804885c
Update delve version
Signed-off-by: oscar.chen <2972789494@qq.com>
2022-12-29 18:57:55 +01:00
Sebastiaan van Stijn
e7d75c8db7
api/types/container: fix validation for UTSMode, UsernsMode, PidMode
The IPCMode type was added in 497fc8876e, and from
that patch, the intent was to allow `host` (without `:`), `""` (empty, default)
or `container:<container ID>`, but the `Valid()` function seems to be too relaxed
and accepting both `:`, as well as `host:<anything>`. No unit-tests were added
in that patch, and integration-tests only tested for valid values.

Later on, `PidMode`, and `UTSMode` were added in 23feaaa240
and f2e5207fc9, both of which were implemented as
a straight copy of the `IPCMode` implementation, copying the same bug.

Finally, commit d4aec5f0a6 implemented unit-tests
for these types, but testing for the wrong behavior of the implementation.

This patch updates the validation to correctly invalidate `host[:<anything>]`
and empty (`:`) types.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-29 18:49:27 +01:00
Sebastiaan van Stijn
018347f802
integration-cli: remove waitInspectWithArgs()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-29 18:26:12 +01:00
Sebastiaan van Stijn
61c434c030
integration-cli: remove inspectMountPointJSON()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-29 18:26:00 +01:00
Shengjing Zhu
ffbbe3d103 daemon/graphdriver/btrfs: workaround field rename in btrfs-progs 6.1
Closes: #44698

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2022-12-29 03:47:12 +08:00
Sebastiaan van Stijn
0eb7b49a17
daemon: remove some intermediate vars, use struct-literals
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-28 11:26:44 +01:00
Sebastiaan van Stijn
288cf20f98
daemon: rename some vars that collided with imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-28 11:25:05 +01:00
Sebastiaan van Stijn
940730093b
integration-cli: remove cli.Build(), cli.Inspect()
They were just small wrappers arround cli.Args(), and the abstraction
made one wonder if they were doing some "magic" things, but they weren't,
so just inlining the `cli.Args()` makes it more transparent what's executed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-28 09:25:27 +01:00
Sebastiaan van Stijn
bc0885f364
integration-cli: remove WaitRestart(), un-export WaitForInspectResult()
- Remove `WaitRestart()` as it was no longer used
- Un-export `WaitForInspectResult()` as it was only used internally, and we want
  to reduce uses of these utilities.
- Inline `appendDocker()` into `Docker()` as it was the only place it was used,
  and the name was incorrect anyway (should've been named `prependXX`).
- Simplify `Args()`, as it was first splitting the slice (into `command` and `args`),
  only to join them again into a single slice (in `icmd.Command()`).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-28 09:25:27 +01:00
Sebastiaan van Stijn
1bd486666b
api/types/container: use strings.Cut() and DRY
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-27 22:31:37 +01:00
Sebastiaan van Stijn
ab5e69c442
api/types/container: rewrite tests to use subtests and asserts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-27 22:31:37 +01:00
Sebastiaan van Stijn
e155cb4fee
hostconfig: move unit tests to api/types/container
These types were moved to api/types/container in 7ac4232e70,
but the unit-tests for them were not moved. This patch moves the unit-tests back together
with the types.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-27 22:31:37 +01:00
Sebastiaan van Stijn
12df6024db
cmd/docker-proxy: add "-v / --version" flag
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-27 22:26:57 +01:00
Sebastiaan van Stijn
598c295707
Merge pull request #44701 from thaJeztah/fix_buildkit_ci
gha: update buildkit to fix integration tests
2022-12-27 21:54:18 +01:00
Sebastiaan van Stijn
c42b304f62
gha: update buildkit to fix integration tests
full diff: 0bfcd83e6d...d77361423c

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-27 19:21:40 +01:00
Sebastiaan van Stijn
2a7908c939
Merge pull request #44182 from thaJeztah/subtests_TestNewClientWithOpsFromEnv
client: TestNewClientWithOpsFromEnv(): use sub-tests
2022-12-27 13:12:50 +01:00
Sebastiaan van Stijn
c4ed09ad4e
Merge pull request #44663 from thaJeztah/move_meminfo
pkg/system: move memory-info types to pkg/systeminfo, and minor refactor
2022-12-27 13:07:09 +01:00
Sebastiaan van Stijn
ab78900e29
Merge pull request #44649 from thaJeztah/config_cleanup
daemon/config: rename CommonTLSOptions, and remove RootDeprecated field
2022-12-27 13:06:16 +01:00
Sebastiaan van Stijn
980701114f
Merge pull request #44627 from thaJeztah/network_nit
daemon: CreateNetwork: remove redundant error check
2022-12-23 17:40:52 +01:00
Albin Kerouanton
799cc143c9
Always use iptables -C to look for rules
iptables -C flag was introduced in v1.4.11, which was released ten
years ago. Thus, there're no more Linux distributions supported by
Docker using this version. As such, this commit removes the old way of
checking if an iptables rule exists (by using substring matching).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2022-12-23 11:04:28 +01:00
Albin Kerouanton
205e5278c6
Merge iptables.probe() into iptables.detectIptables()
The former was doing some checks and logging warnings, whereas
the latter was doing the same checks but to set some internal variables.
As both are called only once and from the same place, there're now
merged together.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2022-12-23 11:04:28 +01:00
Cory Snider
3330fc2e93
Merge pull request #44667 from masibw/44610-logs-for-DNS-failures
libnetwork: improve logs for DNS failures
2022-12-22 16:24:47 -05:00
Tianon Gravi
bcb8f69cc5
Merge pull request #44239 from thaJeztah/resolvconf_refactor_step2
libnetwork: simplify handling of reading resolv.conf
2022-12-22 13:18:47 -08:00
Sebastiaan van Stijn
1eb09c8ce2
Merge pull request #44683 from thaJeztah/libnetwork_consts
libnetwork/netlabel: make consts actual consts, remove redundant utils
2022-12-22 21:55:05 +01:00
Sebastiaan van Stijn
b97ee34947
Merge pull request #44669 from thaJeztah/mux_tests
registry: use http.NewServeMux for tests instead of gorilla/mux
2022-12-22 21:49:26 +01:00
Sebastiaan van Stijn
bee4b80754
Merge pull request #44534 from thaJeztah/layer_minor_fix
layer: layerStore.registerWithDescriptor: rename var to prevent shadowing
2022-12-22 21:17:27 +01:00
Yamazaki Masashi
0787ea8b26 libnetwork: improve logs for DNS failures
Signed-off-by: Yamazaki Masashi <masi19bw@gmail.com>

libnetwork: fix function call

Signed-off-by: Yamazaki Masashi <masi19bw@gmail.com>
2022-12-22 23:25:21 +09:00
Tianon Gravi
204cbfb68d
Merge pull request #44684 from thaJeztah/libnetwork_bridge_remove_deprecated
libnetwork/drivers/bridge: remove "ioctl" fallback code for legacy kernels
2022-12-21 09:41:19 -08:00
Tianon Gravi
e6d4475a6c
Merge pull request #44678 from thaJeztah/errdefs_improve_debug_logs
errdefs: FromStatusCode() don't log "FIXME" debug message
2022-12-21 09:38:33 -08:00
Sebastiaan van Stijn
a959487597
libnetwork/netlabel: remove Key(), Value(), and KeyValue() utils
These were only used in a single location, and in a rather bad way;
replace them with strings.Cut() which should be all we need for this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-21 18:17:54 +01:00
Sebastiaan van Stijn
9015cb7111
libnetwork: controller: rename vars that collided or shadowed
- config collided with import
- cap collided with a built-in
- c collided with the "controller" receiver

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-21 18:17:17 +01:00
Sebastiaan van Stijn
96cfb076ce
libnetwork/netlabel: make consts actual consts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-21 18:17:13 +01:00
Tianon Gravi
3a5598affa
Merge pull request #44381 from thaJeztah/strings_cut
Replace uses of `strings.Split(N)` with `strings.Cut()`
2022-12-21 09:16:05 -08:00
Sebastiaan van Stijn
36151bd1d7
libnetwork/drivers/bridge: remove "ioctl" fallback code for legacy kernels
This code was forked from libcontainer (now runc) in
fb6dd9766e

From the description of this code:

> THIS CODE DOES NOT COMMUNICATE WITH KERNEL VIA RTNETLINK INTERFACE
> IT IS HERE FOR BACKWARDS COMPATIBILITY WITH OLDER LINUX KERNELS
> WHICH SHIP WITH OLDER NOT ENTIRELY FUNCTIONAL VERSION OF NETLINK

That comment was added as part of a refactor in;
4fe2c7a4db

Digging deeper into the code, it describes:

> This is more backward-compatible than netlink.NetworkSetMaster and
> works on RHEL 6.

That comment (and code) moved around a few times;

- moved into the libcontainer pkg: 6158ccad97
- moved within the networkdriver pkg: 4cdcea2047
- moved into the networkdriver pkg: 90494600d3

Ultimately leading to 7a94cdf8ed, which implemented
this:

> create the bridge device with ioctl
>
> On RHEL 6, creation of a bridge device with netlink fails.  Use the more
> backward-compatible ioctl instead.  This fixes networking on RHEL 6.

So from that information, it looks indeed to support RHEL 6, and Ubuntu 12.04
which are both EOL, and we haven't supported for a long time, so probably time
to remove this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-21 17:32:04 +01:00
Sebastiaan van Stijn
6a91e09218
pkg/parsers: use strings.Cut(), and cleanup error-messages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-21 11:09:03 +01:00
Sebastiaan van Stijn
3f935d0e2c
daemon/graphdriver/zfs: use strings.Cut, and refactor
Fixes a (theoretical?) panic if ID would be shorter than 12
characters. Also trim the ID _after_ cutting off the suffix.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-21 11:09:03 +01:00
Sebastiaan van Stijn
f95e9b68d6
daemon: use strings.Cut() and cleanup error messages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-21 11:09:03 +01:00