Commit graph

45651 commits

Author SHA1 Message Date
Sebastiaan van Stijn
f71439d527
reference: don't string-match errors in tests, and fix error format
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-06 13:01:34 +01:00
Sebastiaan van Stijn
669940065f
reference: use t.TempDir() for tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-06 13:01:34 +01:00
Sebastiaan van Stijn
520dc12c0e
reference: rename variables that collided with type / import
These variables collided with the "repository" and "store" types declared
in this package. Rename the variables colliding with "repository", and
rename the "store" type to "refStore".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-06 13:01:31 +01:00
Sebastiaan van Stijn
293c814688
Merge pull request #45095 from vvoland/vendor-buildkit-0.11.4-pre
vendor: buildkit v0.11.4-0.20230228113103-218e934edfba
2023-03-03 16:32:04 +01:00
Paweł Gronowski
3e4c4df664
builder/exporter: Remove commented unused const
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-03 11:05:07 +01:00
Paweł Gronowski
324290a5eb
vendor: buildkit v0.11.4-0.20230228113103-218e934edfba
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-03 11:05:05 +01:00
Sebastiaan van Stijn
de90b5e9ad
Merge pull request #45097 from vvoland/remove-buildinfo
builder: Remove buildkit's build information
2023-03-02 21:46:15 +01:00
Sebastiaan van Stijn
11261594d8
Merge pull request #45032 from corhere/shim-opts
daemon: allow shimv2 runtimes to be configured
2023-03-02 21:45:05 +01:00
Cory Snider
e3215702ae
Merge pull request #44968 from corhere/libnet/ipam-cleanup
libnetwork/ipam: refactor all the things
2023-03-02 15:28:53 -05:00
Sebastiaan van Stijn
2323f9deda
Merge pull request #43197 from dajudge/default-bridge-mtu
Introduce config option for default generic network options of newly created networks
2023-03-02 20:21:47 +01:00
Sebastiaan van Stijn
9822185d53
Merge pull request #44989 from laurazard/c8d-multi-arch-images
containerd integration: handle multi-platform images
2023-03-02 20:16:14 +01:00
Paweł Gronowski
6588b3eef0
builder: Remove buildkit's build information
Buildkit deprecated build information in v0.11 and will remove it in v0.12.
It's suggested to use provenance attestations instead.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-02 19:17:11 +01:00
Brian Goff
a026f3be4b
Merge pull request #45091 from corhere/remove-authz-middleware-from-config
daemon/config: remove AuthzMiddleware field
2023-03-02 17:51:06 +00:00
Laura Brehm
4ea1c9f8e5
docker image ls: handle multi-platform images
Multiple entries are returned for each platform of an image

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-03-02 11:07:19 +01:00
Akihiro Suda
e068c38618
Merge pull request #45085 from thaJeztah/vendor_containerd_1.6.19
vendor: github.com/Microsoft/hcsshim v0.9.7, github.com/containerd/containerd v1.6.19
2023-03-02 11:12:13 +09:00
Sebastiaan van Stijn
7aa36717bb
Merge pull request #45090 from vvoland/libcontainerd-nil-checkpoint
libcontainerd/client: Fix checkpoint not being set
2023-03-01 17:57:31 +01:00
Cory Snider
fb5df9722b
Merge pull request #45088 from corhere/make-apiserver-less-weird
api/server: delete Wait method
2023-03-01 10:14:09 -05:00
Cory Snider
a9e7360775 daemon/config: remove AuthzMiddleware field
The authorization.Middleware contains a sync.Mutex field, making it
non-copyable. Remove one of the barriers to allowing deep copies of
config.Config values.

Inject the middleware into Daemon as a constructor argument instead.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-03-01 09:43:39 -05:00
Cory Snider
7568bbc491
Merge pull request #45083 from corhere/unused-api-config-struct
api/server: drop unused Config struct
2023-03-01 09:38:18 -05:00
Cory Snider
e979518a69
Merge pull request #45087 from corhere/fix-registry-config-locking
registry: acquire mutex in IsInsecureRegistry
2023-03-01 09:10:25 -05:00
Paweł Gronowski
47e9caede7
libcontainerd/client: Rename cp to checkpoint
Make the variable longer to give a hint about it's broader scope.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-01 15:07:58 +01:00
Paweł Gronowski
0c751f904f
libcontainerd/client: Fix checkpoint not being set
`cp` variable is used later to populate the `info.Checkpoint` field
option used by Task creation.
Previous changes mistakenly changed assignment of the `cp` variable to
declaration of a new variable that's scoped only to the if block.

Restore the old assignment behavior.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-01 15:07:42 +01:00
Cory Snider
be39be87f6 api/server: delete Wait method
It's surprising that the method to begin serving requests is named Wait.
And it is unidiomatic: it is a synchronous call, but it sends its return
value to the channel passed in as an argument instead of just returning
the value. And ultimately it is just a trivial wrapper around serveAPI.
Export the ServeAPI method instead so callers can decide how to call and
synchronize around it.

Call ServeAPI synchronously on the main goroutine in cmd/dockerd. The
goroutine and channel which the Wait() API demanded are superfluous
after all. The notifyReady() call was always concurrent and asynchronous
with respect to serving the API (its implementation spawns a goroutine)
so it makes no difference whether it is called before ServeAPI() or
after `go ServeAPI()`.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-03-01 09:03:34 -05:00
Alex Stockinger
91c2b12205 Make default options for newly created networks configurable
Signed-off-by: Alex Stockinger <alex@atomicjar.com>
Co-authored-by: Sergei Egorov <bsideup@gmail.com>
Co-authored-by: Cory Snider <corhere@gmail.com>
2023-03-01 07:58:26 +01:00
Cory Snider
19ad4ac03d registry: acquire mutex in IsInsecureRegistry
The mutex needs to be held when accessing s.config to prevent data
races.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-28 19:42:49 -05:00
Sebastiaan van Stijn
a48f19157a
Merge pull request #45068 from vvoland/deprecate-none
api: Remove <none> in Repo(Tags|Digests) for >= 1.43
2023-02-28 23:34:32 +01:00
Sebastiaan van Stijn
ef6f5367dc
vendor: github.com/containerd/containerd v1.6.19
Update hcsshim to v0.9.7 to include fix for graceful termination and pause containers

full diff: https://github.com/containerd/containerd/compare/v1.6.18...v1.6.19

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-28 23:27:11 +01:00
Sebastiaan van Stijn
5997ad8512
vendor: github.com/Microsoft/hcsshim v0.9.7
- Retain pause.exe as entrypoint for default pause images
- wcow: support graceful termination of servercore containers

full diff: https://github.com/Microsoft/hcsshim/compare/v0.9.6...v0.9.7

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-28 23:25:58 +01:00
Cory Snider
0a6a726d26 api/server: drop unused Config struct
The Server.cfg field is never referenced by any code in package
"./api/server". "./api/server".Config struct values are used by
DaemonCli code, but only to pass around configuration copied out of the
daemon config within the "./cmd/dockerd" package. Delete the
"./api/server".Config struct definition and refactor the "./cmd/dockerd"
package to pull configuration directly from cli.Config.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-28 13:49:53 -05:00
Paweł Gronowski
248745004a
api: Remove <none> in Repo(Tags|Digests) for >= 1.43
Deprecate `<none>:<none>` and `<none>@<none>` magic strings included in
`RepoTags` and `RepoDigests`.
Produce an empty arrays instead and leave the presentation of
untagged/dangling images up to the client.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-27 19:44:43 +01:00
Brian Goff
0021339b92
Merge pull request #45025 from corhere/oci-annotation-passthru 2023-02-24 16:27:11 +00:00
Cory Snider
0ffaa6c785 daemon: add annotations to container HostConfig
Allow clients to set annotations on a container which will applied to
the container's OCI spec.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-23 18:59:00 -05:00
Cory Snider
3c59ef247f libnet/ipam: use netip types internally
The netip types can be used as map keys, unlike net.IP and friends,
which is a very useful property to have for this application.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-23 18:10:01 -05:00
Cory Snider
01dbe23b6f libnet/ipam: simplify the data model
The address spaces are orthogonal. There is no shared state between them
logically so there is no reason for them to share any in-memory data
structures. addrSpace is responsible for allocating subnets and
addresses, while Allocator is responsible for implementing the IPAM API.
Lower all the implementation details of allocation into addrSpace.

There is no longer a need to include the name of the address space in
the map keys for subnets now that each addrSpace holds its own state
independently from other addrSpaces. Remove the AddressSpace field from
the struct used for map keys within an addrSpace so that an addrSpace
does not need to know its own name.

Pool allocations were encoded in a tree structure, using parent
references and reference counters. This structure affords for pools
subdivided an arbitrary number of times to be modeled, in theory. In
practice, the max depth is only two: master pools and sub-pools. The
allocator data model has also been heavily influenced by the
requirements and limitations of Datastore persistence, which are no
longer applicable.

Address allocations are always associated with a master pool. Sub-pools
only serve to restrict the range of addresses within the master pool
which could be allocated from. Model pool allocations within an address
space as a two-level hierarchy of maps.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-23 18:09:22 -05:00
Cory Snider
8273db28f3 libnet/ipam: inline parsePoolRequest function
There is only one call site, in (*Allocator).RequestPool. The logic is
tightly coupled between the caller and callee, and having them separate
makes it harder to reason about.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-23 18:09:22 -05:00
Cory Snider
9a8b45c133 libnet/ipam: drop vestiges of custom addrSpaces
Only two address spaces are supported: LocalDefault and GlobalDefault.
Support for non-default address spaces in the IPAM Allocator is
vestigial, from a time when IPAM state was stored in a persistent shared
datastore. There is no way to create non-default address spaces through
the IPAM API so there is no need to retain code to support the use of
such address spaces. Drop all pretense that more address spaces can
exist, to the extent that the IPAM API allows.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-23 18:09:22 -05:00
Cory Snider
18ac200efe libnet/ipam: get rid of superfluous closure
The two-phase commit dance serves no purpose with the current IPAM
allocator implementation. There are no fallible operations between the
call to aSpace.updatePoolDBOnAdd() and invoking the returned closure.
Allocate the subnet in the address space immediately when called and get
rid of the closure return.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-23 18:09:22 -05:00
Bjorn Neergaard
2f0e308c7d
Merge pull request #45070 from corhere/libnet/fix-networkdb-test-panic
libnet/networkdb: fix nil-dereference panic in test
2023-02-23 15:22:31 -07:00
Bjorn Neergaard
a9f17a28db
Merge pull request #44840 from vvoland/c8d-list-dangling-upstream
c8d/list: Fix Repo(Digests|Tags) for untagged images
2023-02-23 14:25:03 -07:00
Cory Snider
88f6b637a0 libnet/networkdb: fix nil-dereference panic in test
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-23 14:31:48 -05:00
Bjorn Neergaard
855c684708
Merge pull request #44664 from corhere/embedded-resolver-fixes
libnetwork: improve embedded DNS resolver
2023-02-23 12:25:58 -07:00
Sebastiaan van Stijn
ca2fe6859f
Merge pull request #45019 from corhere/libnet/fix-ipam-flaky-test
libnetwork/ipam: fix racy, flaky unit test
2023-02-23 20:24:59 +01:00
Paweł Gronowski
f8791db4be
c8d/list: Fix Repo(Digests|Tags) for untagged images
Show dangling images in `docker image ls` output.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-23 19:54:21 +01:00
Bjorn Neergaard
89ac2061f5
Merge pull request #44620 from neersighted/go_1.20
Upgrade to Go 1.20.1
2023-02-22 15:37:53 -07:00
Cory Snider
cd779dae46 Upgrade to Go 1.20.1
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-22 16:38:01 -05:00
Bjorn Neergaard
d4e7a87b96 Upgrade to Go 1.20
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
Co-authored-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-22 16:37:59 -05:00
Bjorn Neergaard
10a7435ebb
Merge pull request #45063 from corhere/golangci-lint_v1.51.2
Upgrade to golangci-lint v1.51.2
2023-02-22 13:06:14 -07:00
Cory Snider
3606d6a7cd Upgrade to golangci-lint v1.51.2
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-22 14:17:30 -05:00
Brian Goff
73db49f8ef
Merge pull request #44003 from vvoland/invalidfilter 2023-02-22 16:24:47 +00:00
Paweł Gronowski
2f9e3cca3d
api: Move Repo(Digests|Tags) <none> fallback from daemon
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-02-22 17:08:45 +01:00