Commit graph

44632 commits

Author SHA1 Message Date
Bjorn Neergaard
4831ff9f27 refactor(pkg/archive): factor out createImpliedDirectories helper
This code was duplicated in two places -- factor it out, add
documentation, and move magic numbers into a constant.

Additionally, use the same permissions (0755) in both code paths, and
ensure that the ID map is used in both code paths.

Co-authored-by: Vasiliy Ulyanov <vulyanov@suse.de>
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
Signed-off-by: Vasiliy Ulyanov <vulyanov@suse.de>
2022-09-26 11:11:06 -06:00
Samuel Karp
67da3f7e6b
Merge pull request #44189 from thaJeztah/sequential_release 2022-09-25 00:05:25 -07:00
Akihiro Suda
58dd03a471
Merge pull request #44180 from thaJeztah/bump_gotest_tools
vendor: gotest.tools v3.3.0
2022-09-24 08:03:53 +09:00
Sebastiaan van Stijn
489e7b61bf
vendor: github.com/moby/sys/sequential v0.5.0
no changes, just updated to use the tagged version;

full diff: https://github.com/moby/sys/compare/b22ba8a69b30...sequential/v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-23 18:39:20 +02:00
Samuel Karp
8520b322aa
Merge pull request #44174 from thaJeztah/fix_g112_slowlorus 2022-09-22 13:25:44 -07:00
Sebastiaan van Stijn
e352e8deed
Merge pull request #44184 from thaJeztah/bump_go_systemd
vendor: github.com/github.com/coreos/go-systemd v22.4.0
2022-09-22 21:47:47 +02:00
Sebastiaan van Stijn
323ab8ef97
vendor: github.com/github.com/coreos/go-systemd v22.4.0
- dbus: add Connected methods to check connections status
- dbus: add support for querying unit by PID
- dbus: implement support for cgroup freezer APIs
- journal: remove implicit initialization
- login1: add methods to get session/user properties
- login1: add context-aware ListSessions and ListUsers methods

full diff: https://github.com/github.com/coreos/go-systemd/compare/v22.3.2...v22.4.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-22 19:57:44 +02:00
Brian Goff
c5c3568573
Merge pull request #44181 from rumpl/remove-os-check
Remove the OS check when creating a container
2022-09-22 09:45:55 -07:00
Djordje Lukic
1a3d8019d1 Remove the OS check when creating a container
Now that we can pass any custom containerd shim to dockerd there is need
for this check. Without this it becomes possible to use wasm shims for
example with images that have "wasi" as the OS.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2022-09-22 17:27:10 +02:00
Sebastiaan van Stijn
3e1601a980
vendor: gotest.tools v3.3.0
full diff: https://github.com/gotestyourself/gotest.tools/compare/v3.2.0...v3.3.0

- golden: accept -update for updating files
- assert: golden variables

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-22 15:45:08 +02:00
Sebastiaan van Stijn
55fd77f724
set ReadHeaderTimeout to address G112: Potential Slowloris Attack (gosec)
After discussing in the maintainers meeting, we concluded that Slowloris attacks
are not a real risk other than potentially having some additional goroutines
lingering around, so setting a long timeout to satisfy the linter, and to at
least have "some" timeout.

    libnetwork/diagnostic/server.go:96:10: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
        srv := &http.Server{
            Addr:    net.JoinHostPort(ip, strconv.Itoa(port)),
            Handler: s,
        }
    api/server/server.go:60:10: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
                srv: &http.Server{
                    Addr: addr,
                },
    daemon/metrics_unix.go:34:13: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
            if err := http.Serve(l, mux); err != nil && !strings.Contains(err.Error(), "use of closed network connection") {
                      ^
    cmd/dockerd/metrics.go:27:13: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
            if err := http.Serve(l, mux); err != nil && !strings.Contains(err.Error(), "use of closed network connection") {
                      ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-22 12:13:28 +02:00
Sebastiaan van Stijn
08dccc2cb4
Merge pull request #44169 from crazy-max/ci-cache
ci: reduce cache throttling limits
2022-09-22 10:51:03 +02:00
Sebastiaan van Stijn
8e2fd56394
Merge pull request #44160 from thaJeztah/viewdb_no_interface
container: remove ViewDB and View interfaces, use concrete types
2022-09-21 23:31:42 +02:00
CrazyMax
6d59619d6e
ci: reduce cache throttling limits
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-21 22:41:45 +02:00
Sebastiaan van Stijn
6d20ea5c38
Merge pull request #44134 from crazy-max/test-summary
ci(test): report summary output
2022-09-21 18:07:58 +02:00
Sebastiaan van Stijn
a39ba095eb
Merge pull request #44060 from thaJeztah/archive_cleanup
pkg/archive: make CanonicalTarNameForPath and alias for filepath.ToSlash
2022-09-21 18:01:24 +02:00
Sebastiaan van Stijn
511a909ae6
container: remove ViewDB and View interfaces, use concrete types
These interfaces were added in aacddda89d, with
no clear motivation, other than "Also hide ViewDB behind an interface".

This patch removes the interface in favor of using a concrete implementation;
There's currently only one implementation of this interface, and if we would
decide to change to an alternative implementation, we could define relevant
interfaces on the receiver side.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-21 17:38:45 +02:00
Akihiro Suda
f53692a632
Merge pull request #44146 from neersighted/memberlist_transient_bumps
chore: bump transient dependencies of memberlist
2022-09-21 13:28:24 +01:00
Sebastiaan van Stijn
5fe640f579
Merge pull request #44131 from aya/fix/sysvinit-debian-restart
fix debian sysvinit script fails to restart docker daemon when stopped
2022-09-21 12:29:57 +02:00
Sebastiaan van Stijn
74cc242acc
Merge pull request #44158 from crazy-max/ci-fix-filter-pattern
ci: fix branch filter pattern
2022-09-21 10:57:35 +02:00
Akihiro Suda
39461732ab
Merge pull request #44138 from thaJeztah/client_kernel_memory
client: ignore kernel-memory on API >= 1.42
2022-09-21 07:24:59 +01:00
Akihiro Suda
6b9d9da8ef
Merge pull request #44147 from neersighted/go_1.18
chore: update supported go version to 1.18+
2022-09-21 07:23:26 +01:00
CrazyMax
5e50d002f1
ci: fix branch filter pattern
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-20 21:17:29 +02:00
Sebastiaan van Stijn
b7af3716a1
Merge pull request #44118 from crazy-max/jenkins-rm-validate
Jenkinsfile: remove leftover steps and stages
2022-09-19 16:29:16 +02:00
CrazyMax
8596486743
Jenkinsfile: remove unit-validate stage
Left cross step is already in GHA so we can remove
unit-validate stage.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-16 19:46:56 +02:00
CrazyMax
cd54f31984
Jenkinsfile: remove report bundles creation in unit-validate
This was missing to be removed from Jenkinsfile when we moved
to GHA for unit and integration tests.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-16 19:46:56 +02:00
CrazyMax
a354970eaa
Jenkinsfile: remove validation steps moved to GHA
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-16 19:46:56 +02:00
Sebastiaan van Stijn
fd3cf7193b
Merge pull request #44116 from crazy-max/gha-validate
ci(test): validate job matrix
2022-09-16 18:36:47 +01:00
Brian Goff
0f2376d58e
Merge pull request #44125 from thaJeztah/image_spec_no_literal
Update uses of Image platform fields in OCI image-spec
2022-09-15 13:49:51 -07:00
Bjorn Neergaard
85fa72c599 chore: update supported go version to 1.18+
The 1.16 `io/fs` compatibility code was being built on 1.18 and 1.19.
Drop it completely as 1.16 is long EOL, and additionally drop 1.17 as it
has been EOL for a month and 1.18 is both the minimum Go supported by
the 20.10 branch, as well as a very easy jump from 1.17.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2022-09-15 13:52:39 -06:00
Sebastiaan van Stijn
82c19beec4
Merge pull request #44135 from crazy-max/cleanup-test-suite
integration-cli: remove TestDockerSuite func
2022-09-15 17:57:13 +01:00
Bjorn Neergaard
c0fa14e8af vendor: github.com/armon/go-metrics v0.4.1
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2022-09-15 09:59:59 -06:00
Bjorn Neergaard
1d7ceb2fee vendor: github.com/google/btree v1.1.2
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2022-09-15 09:59:59 -06:00
Sebastiaan van Stijn
2597a71623
client: ignore kernel-memory on API >= 1.42
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-13 11:42:13 +02:00
CrazyMax
9b428a3d33
integration-cli: remove TestDockerSuite func
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-12 16:35:41 +02:00
CrazyMax
7b9877bd8a
ci(test): report summary output
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-12 15:20:32 +02:00
Yann Autissier
8ad8c6d887 fix debian sysvinit script fails to restart docker daemon when stopped
Fixes: #44130
Signed-off-by: Yann Autissier <yann.autissier@gmail.com>
2022-09-11 10:09:34 +00:00
CrazyMax
7602edfd06
ci: reusable dco workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-10 15:10:51 +02:00
CrazyMax
5a98363a92
ci(test): dynamic validate matrix
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-10 15:10:51 +02:00
Sebastiaan van Stijn
3cb933db9d
Update uses of Image platform fields in OCI image-spec
The OCI image spec is considering to change the Image struct and embedding the
Platform type (see opencontainers/image-spec#959) in the go implementation.
Moby currently uses some struct-literals to propagate the platform fields,
which will break once those changes in the OCI spec are merged.

Ideally (once that change arrives) we would update the code to set the Platform
information as a whole, instead of assigning related fields individually, but
in some cases in the code, image platform information is only partially set
(for example, OSVersion and OSFeatures are not preserved in all cases). This
may be on purpose, so needs to be reviewed.

This patch keeps the current behavior (assigning only specific fields), but
removes the use of struct-literals to make the code compatible with the
upcoming changes in the image-spec module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-10 12:09:06 +02:00
CrazyMax
a73d78f8d5
ci(test): validate job matrix
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-09 02:24:17 +02:00
Sebastiaan van Stijn
924edb948c
Merge pull request #44119 from thaJeztah/update_tests
Update some tests for supplementary group permissions
2022-09-09 02:11:13 +02:00
Sebastiaan van Stijn
c7e77dba7f
Update some tests for supplementary group permissions
Update tests checking for groups to adjust for new policy updated in
de7af816e7, which caused those tests
to fail:

    === FAIL: amd64.integration-cli TestDockerSwarmSuite/TestSwarmServiceWithGroup (1.94s)
    docker_cli_swarm_test.go:311: assertion failed: uid=0(root) gid=0(root) groups=0(root),10(wheel),29(audio),50(staff),777 (string) != uid=0(root) gid=0(root) groups=10(wheel),29(audio),50(staff),777
(string)
    --- FAIL: TestDockerSwarmSuite/TestSwarmServiceWithGroup (1.94s)

    === FAIL: amd64.integration-cli TestDockerCLIRunSuite/TestRunGroupAdd (0.41s)
    docker_cli_run_test.go:1091: expected output uid=0(root) gid=0(root) groups=10(wheel),29(audio),50(staff),777 received uid=0(root) gid=0(root) groups=0(root),10(wheel),29(audio),50(staff),777
    --- FAIL: TestDockerCLIRunSuite/TestRunGroupAdd (0.41s)

    === FAIL: amd64.integration-cli TestDockerCLIRunSuite/TestRunUserByIDZero (0.41s)
    docker_cli_run_test.go:790: expected daemon user got uid=0(root) gid=0(root) groups=0(root),10(wheel)
    --- FAIL: TestDockerCLIRunSuite/TestRunUserByIDZero (0.41s)

    === FAIL: amd64.integration-cli TestDockerCLIRunSuite (195.70s)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-08 23:27:59 +02:00
Sebastiaan van Stijn
de7af816e7
Merge pull request from GHSA-rc4r-wh2q-q6c4
AdditionalGids must include effective group ID
2022-09-08 21:29:35 +02:00
Sebastiaan van Stijn
098be5ffdd
Merge pull request #44078 from crazy-max/cleanup-jenkins
Jenkinsfile: remove steps moved to GitHub Actions
2022-09-08 18:35:18 +02:00
Sebastiaan van Stijn
eb29361d9d
Merge pull request #44072 from thaJeztah/bump_units
vendor: github.com/docker/go-units v0.5.0
2022-09-08 16:53:32 +02:00
CrazyMax
9f8bd80487
Jenkinsfile: remove steps moved to GitHub Actions
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-08 16:41:43 +02:00
Sebastiaan van Stijn
dba081975a
Merge pull request #44034 from crazy-max/gha-test
ci: gha test workflow for integration and unit test
2022-09-08 15:56:42 +02:00
CrazyMax
36688496ca
ci: fix .windows workflow name
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-08 12:12:03 +02:00
CrazyMax
807c849431
ci(test): send coverage to codecov
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-08 12:12:03 +02:00