Commit graph

48454 commits

Author SHA1 Message Date
Akihiro Suda
e5dbe10e65
Merge pull request #47123 from thaJeztah/cli_25
Dockerfile: update docker-cli to v25.0.0, docker compose v2.24.1
2024-01-22 11:05:43 +09:00
Akihiro Suda
8528ed3409
Merge pull request #47128 from thaJeztah/remove_pkg_loopback
remove deprecated pkg/loopback (utility package for devicemapper)
2024-01-22 11:05:15 +09:00
Akihiro Suda
570b8a794c
Merge pull request #47129 from thaJeztah/pkg_system_deprecated
pkg/system: remove deprecated ErrNotSupportedOperatingSystem, IsOSSupported
2024-01-22 11:04:25 +09:00
Akihiro Suda
5ad5334c2e
Merge pull request #47130 from thaJeztah/pkg_homedir_deprecated
pkg/homedir: remove deprecated Key() and GetShortcutString()
2024-01-22 11:03:54 +09:00
Akihiro Suda
417826376f
Merge pull request #47131 from thaJeztah/pkg_containerfs_deprecated
pkg/containerfs: remove deprecated ResolveScopedPath
2024-01-22 11:03:23 +09:00
Akihiro Suda
e30610aaa3
Merge pull request #47143 from thaJeztah/golang_x_updates
vendor: assorted golang.org/x/... updates
2024-01-22 11:02:48 +09:00
Sebastiaan van Stijn
27e85c7b68
Merge pull request #47141 from thaJeztah/internalize_pkg_platforms
pkg/platforms: internalize in daemon/containerd
2024-01-20 23:47:48 +01:00
Sebastiaan van Stijn
a404017a86
vendor: golang.org/x/tools v0.14.0
full diff: https://github.com/golang/tools/comopare/v0.13.0...v0.14.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 22:58:31 +01:00
Sebastiaan van Stijn
41a2aa2ee2
vendor: golang.org/x/oauth2 v0.11.0
full diff: https://github.com/golang/oauth2/comopare/v0.10.0...v0.11.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 22:58:31 +01:00
Sebastiaan van Stijn
2799417da1
vendor: golang.org/x/mod v0.13.0, golang.org/x/tools v0.13.0
full diff:

- https://github.com/golang/mod/comopare/v0.11.0...v0.13.0
- https://github.com/golang/tools/comopare/v0.10.0...v0.13.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 22:58:30 +01:00
Sebastiaan van Stijn
407ad89ff0
vendor: golang.org/x/sync v0.5.0
full diff: https://github.com/golang/sync/comopare/v0.3.0...v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 22:58:30 +01:00
Sebastiaan van Stijn
94b4765363
pkg/platforms: internalize in daemon/containerd
This matcher was only used internally in the containerd implementation of
the image store. Un-export it, and make it a local utility in that package
to prevent external use.

This package was introduced in 1616a09b61
(v24.0), and there are no known external consumers of this package, so there
should be no need to deprecate / alias the old location.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 22:28:56 +01:00
Sebastiaan van Stijn
c5187380d8
Merge pull request #46252 from thaJeztah/libnetwork_sandbox_sorting
libnetwork: Sandbox.ResolveName: refactor ordering of endpoints
2024-01-20 17:41:35 +01:00
Sebastiaan van Stijn
0a9bc3b507
libnetwork: Sandbox.ResolveName: refactor ordering of endpoints
When resolving names in swarm mode, services with exposed ports are
connected to user overlay network, ingress network, and local (docker_gwbridge)
networks. Name resolution should prioritize returning the VIP/IPs on user
overlay network over ingress and local networks.

Sandbox.ResolveName implemented this by taking the list of endpoints,
splitting the list into 3 separate lists based on the type of network
that the endpoint was attached to (dynamic, ingress, local), and then
creating a new list, applying the networks in that order.

This patch refactors that logic to use a custom sorter (sort.Interface),
which makes the code more transparent, and prevents iterating over the
list of endpoints multiple times.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 12:41:33 +01:00
Sebastiaan van Stijn
17c3829528
Merge pull request #47132 from corhere/allow-container-ip-outside-subpool
libnetwork: loosen container IPAM validation
2024-01-20 11:29:51 +01:00
Cory Snider
058b30023f libnetwork: loosen container IPAM validation
Permit container network attachments to set any static IP address within
the network's IPAM master pool, including when a subpool is configured.
Users have come to depend on being able to statically assign container
IP addresses which are guaranteed not to collide with automatically-
assigned container addresses.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2024-01-19 20:18:15 -05:00
Sebastiaan van Stijn
dfdd5169a2
Merge pull request #46113 from akerouanton/remove-deprecated-oom-score-adjust
daemon: remove --oom-score-adjust flag
2024-01-20 01:35:37 +01:00
Sebastiaan van Stijn
844ca49743
pkg/containerfs: remove deprecated ResolveScopedPath
This function was deprecated in b8f2caa80a
(v25.0), and is no longer in use.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 01:27:07 +01:00
Sebastiaan van Stijn
2767d9ba05
pkg/homedir: remove deprecated Key() and GetShortcutString()
These were deprecated in ddd9665289 (v25.0),
and 3c1de2e667, and are no longer used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 01:11:44 +01:00
Sebastiaan van Stijn
f16a2179a6
pkg/system: remove deprecated ErrNotSupportedOperatingSystem, IsOSSupported
These were deprecated in a3c97beee0 (v25.0.0),
and are no longer used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 01:01:11 +01:00
Sebastiaan van Stijn
e2086b941f
remove deprecated pkg/loopback (utility package for devicemapper)
This package was introduced in af59752712
as a utility package for devicemapper, which was removed in commit
dc11d2a2d8 (v25.0.0), and the package
was deprecated in bf692d47fb.

This patch removes the package.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-20 00:55:09 +01:00
Albin Kerouanton
f07c45e4f2
daemon: remove --oom-score-adjust flag
This flag was marked deprecated in commit 5a922dc16 (released in v24.0)
and to be removed in the next release.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-01-20 00:40:28 +01:00
Sebastiaan van Stijn
307fe9c716
Dockerfile: update docker compose to v2.24.1
Update the version of compose used in CI to the latest version.

- full diff: https://github.com/docker/compose/compare/v2.24.0...v2.24.1
- release notes: https://github.com/docker/compose/releases/tag/v2.24.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-19 23:27:59 +01:00
Sebastiaan van Stijn
dfced4b557
Dockerfile: update dev-shell version of the cli to v25.0.0
Update the docker CLI that's available for debugging in the dev-shell
to the v25 release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-19 23:25:12 +01:00
Sebastiaan van Stijn
75fd873fe6
Merge pull request #47009 from cpuguy83/swarm_rotate_key_flake
De-flake TestSwarmClusterRotateUnlockKey... again... maybe?
2024-01-19 23:13:34 +01:00
Sebastiaan van Stijn
31ccdbb7a8
Merge pull request #45687 from vvoland/volume-mount-subpath
volumes: Implement subpath mount
2024-01-19 18:41:12 +01:00
Paweł Gronowski
5bbcc41c20
volumes/subpath: Plumb context
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:32:21 +01:00
Paweł Gronowski
cb1af229f2
daemon/populateVolumes: Support volume subpath
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:32:20 +01:00
Paweł Gronowski
349a52b279
container: Change comment into debug log
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:32:18 +01:00
Paweł Gronowski
42afac91d7
internal/safepath: Add windows implementation
All components of the path are locked before the check, and
released once the path is already mounted.
This makes it impossible to replace the mounted directory until it's
actually mounted in the container.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:32:17 +01:00
Paweł Gronowski
5841ed4e5e
internal/safepath: Adapt k8s openat2 fallback
Adapts the function source code to the Moby codebase.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:32:16 +01:00
Paweł Gronowski
56bb143a4d
internal/safepath: Import k8s safeopen function
For use as a soft fallback if Openat2 is not available.
Source: 55fb1805a1/pkg/volume/util/subpath/subpath_linux.go

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:32:14 +01:00
Paweł Gronowski
3784316d46
internal/safepath: Handle EINTR in unix syscalls
Handle EINTR by retrying the syscall.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:32:13 +01:00
Paweł Gronowski
9a0cde66ba
internal/safepath: Add linux implementation
All subpath components are opened with openat, relative to the base
volume directory and checked against the volume escape.
The final file descriptor is mounted from the /proc/self/fd/<fd> to a
temporary mount point owned by the daemon and then passed to the
underlying container runtime.
Temporary mountpoint is removed after the container is started.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:32:12 +01:00
Paweł Gronowski
bfb810445c
volumes: Implement subpath mount
`VolumeOptions` now has a `Subpath` field which allows to specify a path
relative to the volume that should be mounted as a destination.

Symlinks are supported, but they cannot escape the base volume
directory.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:32:10 +01:00
Paweł Gronowski
f2e1105056
Introduce a helper that collects cleanup functions
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:27:17 +01:00
Paweł Gronowski
f07387466a
daemon/oci: Extract side effects from withMounts
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:27:16 +01:00
Paweł Gronowski
9c8752505f
volume/mounts: Rename errors in defer block
To make it easier to distinguish if an output variable is modified.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 17:27:15 +01:00
Sebastiaan van Stijn
17d80442cc
Merge pull request #47111 from robmry/fix_TestAddRemoveInterface
Fix libnetwork/osl test TestAddRemoveInterface
2024-01-19 16:15:49 +01:00
Sebastiaan van Stijn
d35e923a4c
Merge pull request #47116 from thaJeztah/minor_nits
assorted minor linting issues
2024-01-19 16:09:12 +01:00
Sebastiaan van Stijn
67de5c84d3
Merge pull request #47118 from vvoland/api-1.45
API: bump version to 1.45
2024-01-19 15:35:47 +01:00
Paweł Gronowski
5bcbedb7ee
API: bump version to 1.45
Docker 25.0 was released with API v1.44, so any change in the API should
now target v1.45.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-19 14:42:19 +01:00
Sebastiaan van Stijn
35789fce99
daemon.images: ImageService.getImage: use named fields in struct literals
Prevent things from breaking if additional fields are added to this struct.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-19 13:11:40 +01:00
Sebastiaan van Stijn
7c1914411f
daemon/images: ImageService.manifestMatchesPlatform: optimize logger
We constructed a "function level" logger, which was used once "as-is", but
also added additional Fields in a loop (for each resource), effectively
overwriting the previous one for each iteration. Adding additional
fields can result in some overhead, so let's construct a "logger" only for
inside the loop.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-19 13:08:30 +01:00
Sebastiaan van Stijn
5581efe7cd
rename "ociimage" var to be proper camelCase
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-19 12:50:13 +01:00
Sebastiaan van Stijn
66cf6e3a7a
rename "image" vars to prevent conflicts with imports
We have many "image" packages, so these vars easily conflict/shadow
imports. Let's rename them (and in some cases use a const) to
prevent that.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-19 12:49:53 +01:00
Tianon Gravi
4a40d10b60
Merge pull request #47109 from whalelines/git-url-regex
Fix isGitURL regular expression
2024-01-18 14:02:57 -08:00
Rob Murray
c72e458a72 Fix libnetwork/osl test TestAddRemoveInterface
For some time, when adding an interface with no IPv6 address (an
interface to a network that does not have IPv6 enabled), we've been
disabling IPv6 on that interface.

As part of a separate change, I'm removing that logic - there's nothing
wrong with having IPv6 enabled on an interface with no routable address.
The difference is that the kernel will assign a link-local address.

TestAddRemoveInterface does this...
- Assign an IPv6 link-local address to one end of a veth interface, and
  add it to a namespace.
- Add a bridge with no assigned IPv6 address to the namespace.
- Remove the veth interface from the namespace.
- Put the veth interface back into the namespace, still with an
  explicitly assigned IPv6 link local address.

When IPv6 is disabled on the bridge interface, the test passes.

But, when IPv6 is enabled, the bridge gets a kernel assigned link-local
address.

Then, when re-adding the veth interface, the test generates an error in
'osl/interface_linux.go:checkRouteConflict()'. The conflict is between
the explicitly assigned fe80::2 on the veth, and a route for fe80::/64
belonging to the bridge.

So, in preparation for not-disabling IPv6 on these interfaces, use a
unique-local address in the test instead of link-local.

I don't think that changes the intent of the test.

With the change to not-always disable IPv6, it is possible to repro the
problem with a real container, disconnect and re-connect a user-defined
network with '--subnet fe80::/64' while the container's connected to an
IPv4 network. So, strictly speaking, that will be a regression.

But, it's also possible to repro the problem in master, by disconnecting
and re-connecting the fe80::/64 network while another IPv6 network is
connected. So, I don't think it's a problem we need to address, perhaps
other than by prohibiting '--subnet fe80::/64'.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-01-18 21:01:41 +00:00
David Dooling
768146b1b0
Fix isGitURL regular expression
Escape period (.) so regular expression does not match any character before "git".

Signed-off-by: David Dooling <david.dooling@docker.com>
2024-01-18 14:14:08 -06:00
Paweł Gronowski
615dfdf672
Merge pull request #47106 from vvoland/c8d-windows-pull-error-msg
c8d/integration: Adjust error in TestPullLinuxImageFailsOnWindows
2024-01-18 17:28:52 +01:00