Commit graph

46924 commits

Author SHA1 Message Date
Sebastiaan van Stijn
d5b1e43b8f
libnetwork/datastore: move MockData to a _test file
It's only used in tests, and only within this package.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-24 15:28:07 +02:00
Bjorn Neergaard
d16579971e
Merge pull request #45981 from thaJeztah/bump_buildkit_0.11
vendor: github.com/moby/buildkit v0.11.7-dev
2023-07-24 07:13:40 -06:00
Sebastiaan van Stijn
0ec73a7892
vendor: github.com/moby/buildkit v0.11.7-dev
full diff: 0a15675913...616c3f613b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-24 10:03:53 +02:00
Sebastiaan van Stijn
afd4805278
Merge pull request #45399 from vvoland/winddows-unskip-kill-tests
integration/windows: Unskip some kill tests
2023-07-23 16:29:19 +02:00
Sebastiaan van Stijn
24fef11e44
Merge pull request #45724 from akhramov/feature/chroot-archive-freebsd-build
pkg/chrootarchive: fix FreeBSD build
2023-07-23 16:26:29 +02:00
Sebastiaan van Stijn
64c6f72988
libnetwork: remove Network interface
There's only one implementation; drop the interface and use the
concrete type instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-22 11:56:41 +02:00
Sebastiaan van Stijn
edafcb2c39
libnetwork/iptables: un-export ErrConntrackNotConfigurable, IsConntrackProgrammable
These were only used internally, and ErrConntrackNotConfigurable was not used
as a sentinel error anywhere. Remove ErrConntrackNotConfigurable, and change
IsConntrackProgrammable to return an error instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-21 21:08:12 +02:00
Sebastiaan van Stijn
e57b807a42
libnetwork: Controller.NewNetwork: inline arrangeUserFilterRule()
arrangeUserFilterRule uses the package-level [`ctrl` variable][1], which
holds a reference to a controller instance. This variable is set by
[`setupArrangeUserFilterRule()`][2], which is called when initialization
a controller ([`libnetwork.New`][3]).

In normal circumstances, there would only be one controller, created during
daemon startup, and the instance of the controller would be the same as
the controller that `NewNetwork` is called from, but there's no protection
for the `ctrl` variable, and various integration tests create their own
controller instance.

The global `ctrl` var was introduced in [54e7900fb89b1aeeb188d935f29cf05514fd419b][4],
with the assumption that [only one controller could ever exist][5].

This patch tries to reduce uses of the `ctrl` variable, and as we're calling
this code from inside a method on a specific controller, we inline the code
and use that specific controller instead.

[1]: 37b908aa62/libnetwork/firewall_linux.go (L12)
[2]: 37b908aa62/libnetwork/firewall_linux.go (L14-L17)
[3]: 37b908aa62/libnetwork/controller.go (L163)
[4]: 54e7900fb8
[5]: https://github.com/moby/libnetwork/pull/2471#discussion_r343457183

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-21 21:08:03 +02:00
Sebastiaan van Stijn
be8ff186d6
libnetwork: refactor TestErrorInterfaces into a test
This function was added in libnetwork through 50964c9948
and, based on the name of the function and its signature, I think it
was meant to be a test. This patch refactors it to be one.

Changing it into a test made it slightly broken:

    go test -v -run TestErrorInterfaces
    === RUN   TestErrorInterfaces
        errors_test.go:15: Failed to detect err network  not found is of type BadRequestError. Got type: libnetwork.ErrNoSuchNetwork
        errors_test.go:15: Failed to detect err endpoint  not found is of type BadRequestError. Got type: libnetwork.ErrNoSuchEndpoint
        errors_test.go:42: Failed to detect err unknown driver "" is of type ForbiddenError. Got type: libnetwork.NetworkTypeError
        errors_test.go:42: Failed to detect err unknown network  id  is of type ForbiddenError. Got type: *libnetwork.UnknownNetworkError
        errors_test.go:42: Failed to detect err unknown endpoint  id  is of type ForbiddenError. Got type: *libnetwork.UnknownEndpointError
    --- FAIL: TestErrorInterfaces (0.00s)
    FAIL

This was because some errors were tested twice, but for the wrong type
(`NetworkTypeError`, `UnknownNetworkError`, `UnknownEndpointError`).

Moving them to the right test left no test-cases for `types.ForbiddenError`,
so I added `ActiveContainerError` to not make that part of the code feel lonely.

Other failures were because some errors were changed from `types.BadRequestError`
to a `types.NotFoundError` error in commit ba012a703a,
so I moved those to the right part.

Before this patch:

    go test -v -run TestErrorInterfaces
    === RUN   TestErrorInterfaces
    --- PASS: TestErrorInterfaces (0.00s)
    PASS
    ok  	github.com/docker/docker/libnetwork	0.013s

After this patch:

    go test -v -run TestErrorInterfaces
    === RUN   TestErrorInterfaces
    --- PASS: TestErrorInterfaces (0.00s)
    PASS
    ok  	github.com/docker/docker/libnetwork	0.013s

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-21 20:52:48 +02:00
Sebastiaan van Stijn
9484520327
libnetwork: arrangeUserFilterRule: don't return early
commit ffd75c2e0c updated this function to
set up the DOCKER-USER chain for both iptables and ip6tables, however the
function would return early if a failure happened (instead of continuing
with the next iptables version).

This patch extracts setting up the chain to a separate function, and updates
arrangeUserFilterRule to log the failure as a warning, but continue with
the next iptables version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-21 20:08:58 +02:00
Sebastiaan van Stijn
a5f45b47a3
libnetwork: Controller: combine iptablesEnabled and ip6tablesEnabled
These functions were mostly identical, except for iptables being enabled
by default (unless explicitly disabled by config).

Rewrite the function to a enabledIptablesVersions, which returns the list
of iptables-versions that are enabled for the controller. This prevents
having to acquire a lock twice, and simplifies arrangeUserFilterRule, which
can now just iterate over the enabled versions.

Also moving this function to a linux-only file, as other platforms don't have
the iptables types defined.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-21 20:08:53 +02:00
Sebastiaan van Stijn
454b6a7cf5
Merge pull request #45954 from thaJeztah/cleanup_ioutils
pkg/ioutils: some cleanups in tests
2023-07-20 19:44:21 +02:00
Akihiro Suda
483a1933a2
volume: remove the short RRO forms in favor of the long forms
"ro-non-recursive", "ro-force-recursive", and "rro" are
now removed from the legacy mount API.

CLI may still support them via the new mount API (if we want).

Follow-up to PR 45278

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-07-20 22:34:09 +09:00
Sebastiaan van Stijn
49dce504bf
Merge pull request #46032 from thaJeztah/bk_deps_part2
vendor: update dependencies in preparation of BuildKit v0.12 and containerd 1.7 update (part 2)
2023-07-20 11:01:38 +02:00
Sebastiaan van Stijn
5da84141c4
vendor: github.com/prometheus/common v0.42.0
full diff: https://github.com/prometheus/common/compare/v0.37.0...v0.42.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-20 08:02:55 +02:00
Sebastiaan van Stijn
44ab4d44e0
vendor: github.com/prometheus/procfs v0.9.0
full diff: https://github.com/prometheus/procfs/compare/v0.8.0...v0.9.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-20 08:01:34 +02:00
Sebastiaan van Stijn
6791b8051a
vendor: github.com/felixge/httpsnoop v1.0.3
full diff: https://github.com/felixge/httpsnoop/compare/v1.0.2...v1.0.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-20 07:58:41 +02:00
Sebastiaan van Stijn
9d3590f375
vendor: github.com/Microsoft/go-winio v0.6.1
Unfortunately also brings in golang.org/x/tools as a dependency, due to
go-winio using a "tools.go" file.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-20 07:54:31 +02:00
Sebastiaan van Stijn
35d180126a
vendor: google.golang.org/protobuf v1.30.0
no changes in vendored files

full diff: https://github.com/protocolbuffers/protobuf-go/compare/v1.29.1...v1.30.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-20 07:50:35 +02:00
Sebastiaan van Stijn
b835c28383
vendor: golang.org/x/oauth2 v0.6.0
full diff: https://github.com/golang/oauth2/compare/v0.1.0...v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-20 07:49:00 +02:00
Sebastiaan van Stijn
51fad48097
Merge pull request #45937 from thaJeztah/testattach_table
integration/container: use subtests for TestAttach
2023-07-19 19:24:33 +02:00
Sebastiaan van Stijn
6b2ee07a26
Merge pull request #45929 from neersighted/with-go-mod_ROOTDIR
hack: use Git-free ROOTDIR
2023-07-19 19:23:00 +02:00
Sebastiaan van Stijn
203c683dff
Merge pull request #46028 from thaJeztah/bump_runc_binary_1.1.8
Dockerfile: update runc binary to v1.1.8
2023-07-19 19:18:21 +02:00
Sebastiaan van Stijn
3cfc1ffb0a
pkg/ioutils: some cleanups in tests
- remove gotest.tools dependency as it was only used in one test,
  and only for a trivial check
- use t.TempDir()
- rename vars that collided with package types
- don't use un-keyed structs
- explicitly ignore some errors to please linters
- use iotest.ErrReader
- TestReadCloserWrapperClose: verify reading works before closing :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 19:17:22 +02:00
Akihiro Suda
3b77e38b8e
Merge pull request #46027 from thaJeztah/bk_deps
vendor: update dependencies in preparation of BuildKit v0.12 and containerd 1.7 update
2023-07-20 02:03:13 +09:00
Sebastiaan van Stijn
df86d855f5
Dockerfile: update runc binary to v1.1.8
release notes: https://github.com/opencontainers/runc/releases/tag/v1.1.8
full diff: https://github.com/opencontainers/runc/compare/v1.1.7...v1.1.9

This is the eighth patch release of the 1.1.z release branch of runc.
The most notable change is the addition of RISC-V support, along with a
few bug fixes.

- Support riscv64.
- init: do not print environment variable value.
- libct: fix a race with systemd removal.
- tests/int: increase num retries for oom tests.
- man/runc: fixes.
- Fix tmpfs mode opts when dir already exists.
- docs/systemd: fix a broken link.
- ci/cirrus: enable some rootless tests on cs9.
- runc delete: call systemd's reset-failed.
- libct/cg/sd/v1: do not update non-frozen cgroup after frozen failed.
- CI: bump Fedora, Vagrant, bats.
- .codespellrc: update for 2.2.5.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:22:03 +02:00
Sebastiaan van Stijn
f5e64a9eaa
vendor: github.com/containerd/stargz-snapshotter/estargz v0.14.3
no changes in vendored files

full diff: https://github.com/containerd/stargz-snapshotter/estargz/compare/v0.13.0...v0.14.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:02 +02:00
Sebastiaan van Stijn
d431345bf3
vendor: google.golang.org/protobuf v1.29.1
full diff: https://github.com/protocolbuffers/protobuf-go/compare/v1.28.1...v1.29.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:02 +02:00
Sebastiaan van Stijn
30916df3d3
vendor: github.com/containerd/ttrpc v1.2.2
full diff: https://github.com/containerd/ttrpc/compare/v1.1.1...v1.2.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:01 +02:00
Sebastiaan van Stijn
4f4dd2d995
vendor: github.com/containerd/go-cni v1.1.9
full diff: https://github.com/containerd/go-cni/compare/v1.1.6...v1.1.9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:01 +02:00
Sebastiaan van Stijn
287130a254
vendor: github.com/cenkalti/backoff/v4 v4.2.0
full diff: https://github.com/cenkalti/backoff/compare/v4.1.2...v4.2.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:01 +02:00
Sebastiaan van Stijn
7145129f27
vendor: k8s.io/klog/v2 v2.90.1
full diff: https://github.com/kubernetes/klog/compare/v2.80.1...v2.90.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:01 +02:00
Sebastiaan van Stijn
410a52b763
vendor: github.com/fsnotify/fsnotify v1.6.0
full diff: https://github.com/fsnotify/fsnotify/compare/v1.5.1...v1.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:01 +02:00
Sebastiaan van Stijn
741c28ae9f
vendor: github.com/containerd/cgroups v1.1.0
no changes in vendored files

full diff: https://github.com/containerd/cgroups/compare/v1.0.4...v1.1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:01 +02:00
Sebastiaan van Stijn
e84b72710b
vendor: github.com/aws/aws-sdk-go-v2/config v1.18.16
full diff: https://github.com/aws/aws-sdk-go-v2/compare/config/v1.17.4...config/v1.18.16

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:00 +02:00
Sebastiaan van Stijn
e235763a38
vendor: github.com/aws/aws-sdk-go-v2/credentials v1.13.16
full diff: https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.12.17...credentials/v1.13.16

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:00 +02:00
Sebastiaan van Stijn
4c30bf1667
vendor: github.com/aws/aws-sdk-go-v2 v1.17.6
full diff: https://github.com/aws/aws-sdk-go-v2/compare/v1.16.13...v1.17.6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:00 +02:00
Sebastiaan van Stijn
cb53ce9f89
vendor: github.com/aws/smithy-go v1.13.5
full diff: https://github.com/aws/smithy-go/compare/v1.13.1...v1.13.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:06:00 +02:00
Sebastiaan van Stijn
f463e50719
vendor: github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1
full diff: 3345c89a7c...43070de90f

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:05:59 +02:00
Sebastiaan van Stijn
359ab384fd
vendor: google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4
full diff: 10f96fb3db...7f2fa6fef1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:05:59 +02:00
Sebastiaan van Stijn
b11bdb9212
vendor: cloud.google.com/go/logging v1.7.0
full diff: https://github.com/googleapis/google-cloud-go/compare/logging/v1.4.2...logging/v1.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:05:59 +02:00
Sebastiaan van Stijn
64609120d8
vendor: github.com/googleapis/gax-go/v2 v2.7.0
full diff: https://github.com/googleapis/gax-go/compare/v2.4.0...v2.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:05:59 +02:00
Sebastiaan van Stijn
2990defea7
vendor: go.opencensus.io v0.24.0
full diff: https://github.com/census-instrumentation/opencensus-go/compare/v0.23.0...v0.24.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:05:58 +02:00
Sebastiaan van Stijn
d7aa47ddb8
vendor: github.com/googleapis/enterprise-certificate-proxy v0.2.3
full diff: https://github.com/googleapis/enterprise-certificate-proxy/compare/v0.1.0...v0.2.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:05:58 +02:00
Sebastiaan van Stijn
296040b1f4
vendor: github.com/cespare/xxhash/v2 v2.2.0
full diff: https://github.com/cespare/xxhash/compare/v2.1.2...v2.2.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:05:58 +02:00
Sebastiaan van Stijn
033f882314
vendor: golang.org/x/oauth2 v0.5.0
full diff: https://github.com/golang/oauth2/compare/v0.1.0...v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:05:58 +02:00
Sebastiaan van Stijn
b615d195b2
vendor: github.com/golang/protobuf v1.5.3
- jsonpb: accept 'null' as a valid representation of NullValue in unmarshal
  The canonical JSON representation for NullValue is JSON "null".

full diff: https://github.com/golang/protobuf/compare/v1.5.2...v1.5.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:05:57 +02:00
Sebastiaan van Stijn
c5c8f433e6
vendor: github.com/containerd/typeurl/v2 v2.1.1
- unmarshal does not return nil object when value is nil
- fixes "ctr tasks checkpoint returns invalid task checkpoint option for io.containerd.runc.v2: unknown"

full diff: https://github.com/containerd/typeurl/compare/v2.1.0...v2.1.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-19 18:05:57 +02:00
Sebastiaan van Stijn
82190c7296
Merge pull request #46022 from thaJeztah/bump_buildx_compose
Dockerfile: update buildx v0.11.2, compose v2.20.1
2023-07-19 16:58:35 +02:00
Sebastiaan van Stijn
6f2a242193
Merge pull request #46024 from vvoland/c8d-inspect-variant
c8d/inspect: Include platform Variant
2023-07-19 15:33:36 +02:00