Commit Graph

5848 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
81caabae43 Merge pull request #50462 from thaJeztah/move_stdcopy
deprecate pkg/stdcopy, move to api/stdcopy
2025-07-21 22:50:05 +02:00
Sebastiaan van Stijn
20d594fb79 deprecate pkg/stdcopy, move to api/stdcopy
The stdcopy package is used to produce and read multiplexed streams for
"attach" and "logs". It is used both by the API server (to produce), and
the client (to read / de-multiplex).

Move it to the api package, so that it can be included in the api module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 21:41:39 +02:00
Sebastiaan van Stijn
0dc3193b2b integration-cli: remove uses of lazyregexp
Not needed for test-files.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 21:23:35 +02:00
Derek McGowan
c47afd41c8 Create github.com/moby/moby/client module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:30:26 -07:00
Derek McGowan
afd6487b2e Create github.com/moby/moby/api module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:30:05 -07:00
Sebastiaan van Stijn
ab5d348b77 integration-cli: remove uses of "runconfig"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 21:04:49 +02:00
Derek McGowan
04f5276267 Move volume to daemon/volume
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-15 10:44:44 -07:00
Rob Murray
d86a303086 Merge pull request #50397 from thaJeztah/testutil_denoise
minor cleanups and reduce logs in tests
2025-07-15 17:25:29 +01:00
Derek McGowan
7a720df61f Move libnetwork to daemon/libnetwork
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-14 09:25:23 -07:00
Derek McGowan
f05652867d Move opts to daemon/pkg/opts
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-14 09:25:05 -07:00
Paweł Gronowski
a470ad7ffd Merge pull request #50390 from Abubacarr075/50159-migrate-api-images-history-cli-tests-to-integration
migrate test api images history integration cli test to integration test
2025-07-14 12:26:31 +02:00
Sebastiaan van Stijn
a327a9f341 integration-cli: fix flaky TestRestartStoppedContainer
This test was failing frequently on Windows, waiting for the state
of the container to be "running" after restarting, however, this
would race because the command of the container was very short-lived;

    === Failed
    === FAIL: github.com/docker/docker/integration-cli TestDockerCLIRestartSuite/TestRestartStoppedContainer (37.00s)
        docker_cli_restart_test.go:42: assertion failed: error is not nil: condition ""true" == "false"" not true in time (20s)

Ironically, that check was added in 48ccdd46ae
to make the test less flaky.

This patch takes the approach from TestRestartRunningContainer, which had
similar issues on Windows that were addressed in bae22d167c

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-12 17:45:27 +02:00
Sebastiaan van Stijn
1c8b09ccf6 integration-cli: TestDockerNetworkHostModeUngracefulDaemonRestart start, not restart
This test was testing a non-gracceful kill od the daemon, after which it
started it again, however `d.Stop()` would log that the daemon wasn't running,
which is expected, so let's reduce noise;

    docker_cli_network_unix_test.go:1143: [dadd2ae3b638b] daemon is not started

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-12 17:35:51 +02:00
Abubacarr Ceesay
669163c416 remove test api images history integration cli test suite
Signed-off-by: Abubacarr Ceesay <abubacarr671@gmail.com>
2025-07-11 19:03:19 +02:00
Sebastiaan van Stijn
ac9d5a6068 integration-cli: TestPullFailsWithAlteredLayer: use OCI manifest
The OCI types should be able to unmarshal the image manifest (regardless
if it was created from the legacy distribution types or otherwise), so
we can drop the use of the legacy distribution types here.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-05 17:56:35 +02:00
Sebastiaan van Stijn
fd47ccef7b integration-cli: TestPullFailsWithAlteredManifest: use OCI manifest
The OCI types should be able to unmarshal the image manifest (regardless
if it was created from the legacy distribution types or otherwise), so
we can drop the use of the legacy distribution types here.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-05 17:52:48 +02:00
Sebastiaan van Stijn
4e818970e2 integration-cli: TestPullManifestList: use OCI media-types
This test is verifying that push/pull works; current versions of the registry
used should support both the legacy (docker distribution) and OCI media-types,
so let's use the OCI types.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-05 17:48:48 +02:00
Sebastiaan van Stijn
f6ef56a0bc integration-cli: TestPullManifestList: rewrite using OCI types
Trying to reduce the places where we depend on the legacy distribution
dependency. For this test, we used it to generate the JSON for a manifest-list,
which we can do with the OCI types as well.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-05 17:44:50 +02:00
Sebastiaan van Stijn
033750cf80 image/tarexport: remove suport for loading v0/v1 images
This removes the tarexporter.legacyLoadImage method and related helpers.
This functionality was added in 01ba0a935b
(docker v1.10), which introduced the new content-addressable image
format; this code provided backward-compatibility with older archives
which contained v0/v1 images.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-04 11:48:52 +02:00
Rob Murray
242916b3f9 Merge pull request #45415 from thaJeztah/test_TestPushToCentralRegistryUnauthorized
integration-cli: debug TestPushToCentralRegistryUnauthorized
2025-07-03 14:16:56 +01:00
Sebastiaan van Stijn
8dbe0f45a9 integration-cli: debug TestPushToCentralRegistryUnauthorized
Seeing some test-failures, which could be due to changes on Docker Hub

    === Failed
    === FAIL: github.com/docker/docker/integration-cli TestDockerCLIPushSuite/TestPushToCentralRegistryUnauthorized (51.08s)
        docker_cli_push_test.go:229: assertion failed: strings.Contains(out, "Retrying") is true

    === FAIL: github.com/docker/docker/integration-cli TestDockerCLIPushSuite (101.49s)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-30 15:44:52 +02:00
Sebastiaan van Stijn
a30b63eafc integration-cli: remove uses of deprecated dockerCmdWithResult utility
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-30 13:21:30 +02:00
Matthieu MOREL
381d9d0723 fix use-errors-new from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-26 12:07:38 +00:00
Rob Murray
f9e6f25677 Merge pull request #50196 from robmry/fix_TestDaemonRestartRestoreBridgeNetwork
Fix flaky test TestDaemonRestartRestoreBridgeNetwork
2025-06-13 12:21:19 +01:00
Rob Murray
aac0260d21 Fix flaky test TestDaemonRestartRestoreBridgeNetwork
It checked for "Bind for 0.0.0.0:80 failed: port is already
allocated". But, since commit d662091 ("portallocator: always
check for ports allocated for 0.0.0.0/::"), the message is
sometimes about ":::80".

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-06-13 10:53:22 +01:00
Matthieu MOREL
6d737371b8 fix comparison rule from errorlint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-13 08:26:56 +00:00
Rob Murray
6b9bd0a800 Merge pull request #50144 from thaJeztah/rm_import_aliases
all: remove redundant import-aliases for "go-winio"
2025-06-11 11:25:05 +01:00
Paweł Gronowski
e84353ebbd Merge pull request #50135 from thaJeztah/inspect_no_omitempty
api: image inspect: add back fields that did not omitempty
2025-06-11 08:58:14 +00:00
Matthieu MOREL
b8a4f6534f fix stringsCompare and stringConcatSimplify from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
a62de57aa1 fix sprintfQuotedString from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
bc9ec5fc02 fix emptyStringTest from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
9b5d8cd186 fix thelper linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-05 21:42:05 +00:00
Sebastiaan van Stijn
bd20bfdc41 all: remove redundant import-aliases for "go-winio"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-05 12:11:30 +02:00
Sebastiaan van Stijn
f85394dd5d api: image inspect: add back fields that did not omitempty
commit 4dc961d0e9 removed deprecated
fields from the image inspect response for API v1.50 and up. As
part of that change, it changed the type used for the Config field
to use the docker image spect structs, which embeds the OCI image
spec structs.

While the OCI image spect struct contains the same fields as we
used before, those fields also have "omitempty" set, which means
they are now omitted when empty.

We should probably consider deprecating that behavior in the API,
and call out that these fields are omitted if not set, but in the
meantime, we can add them back with their default (zero) value.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-04 18:01:19 +02:00
Sebastiaan van Stijn
a4b0d32fa6 integration-cli: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:13 +02:00
Matthieu MOREL
528f2284ee integration-cli: replace uses of errdefs package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-28 05:40:06 +00:00
Sebastiaan van Stijn
4dc961d0e9 image-inspect: remove Config fields that are not part of the image
commit af0cdc36c7 marked these fields as
deprecated and to be removed in API v1.47 (which was targeted for v28.0).
We shipped v1.47 with the v27.2 release, but did not yet remove the erroneous
fields, so the version to deprecate was updated to v1.48 through
3df03d8e66

This patch removes fields that are not part of the image by replacing the
type with the Config struct from the docker image-spec.

    curl -s --unix-socket /var/run/docker.sock http://localhost/v1.50/images/alpine/json | jq .Config
    {
      "Env": [
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
      ],
      "Cmd": [
        "/bin/sh"
      ]
    }

    curl -s --unix-socket /var/run/docker.sock http://localhost/v1.49/images/alpine/json | jq .Config
    {
      "Hostname": "",
      "Domainname": "",
      "User": "",
      "AttachStdin": false,
      "AttachStdout": false,
      "AttachStderr": false,
      "Tty": false,
      "OpenStdin": false,
      "StdinOnce": false,
      "Env": [
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
      ],
      "Cmd": [
        "/bin/sh"
      ],
      "Image": "",
      "Volumes": null,
      "WorkingDir": "",
      "Entrypoint": null,
      "OnBuild": null,
      "Labels": null
    }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-26 17:14:37 +02:00
Sebastiaan van Stijn
7148c6a5f5 Merge pull request #42300 from thaJeztah/carry_39384_remove_v2_schema1_push
Remove support for pulling v2 schema1
2025-05-21 23:43:41 +02:00
Sebastiaan van Stijn
0b1c7a8306 api/types: move ServiceUpdateOptions to api/types/swarm
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-19 16:30:33 +02:00
Sebastiaan van Stijn
31d62930f7 api/types: move ServiceCreateOptions to api/types/swarm
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-19 16:30:31 +02:00
Sebastiaan van Stijn
5ad0867236 api/types: move TaskListOptions to api/types/swarm
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-19 16:30:03 +02:00
Sebastiaan van Stijn
f008d85edc api/types: move NodeListOptions, NodeRemoveOptions to types/swarm
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-19 13:43:16 +02:00
Sebastiaan van Stijn
b13528522a api/types: move ServiceListOptions, ServiceInspectOptions to types/swarm
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-19 13:41:59 +02:00
Sebastiaan van Stijn
7130cd4f16 Remove DockerSchema1RegistrySuite schema 2 version 1 tests
Also remove the DOCKER_ALLOW_SCHEMA1_PUSH_DONOTUSE from Jenkins

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-16 18:00:06 +02:00
Matthieu MOREL
205ba05feb fix usestdlibvars
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-15 18:24:58 +02:00
Sebastiaan van Stijn
3bbdda696d use container.ContainerState consts in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-13 15:03:34 +02:00
Rob Murray
37259540e9 Remove/replace integration-cli tests that use iptables directly
In preparation for testing with an nftables backend.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-05-12 17:51:59 +01:00
Sebastiaan van Stijn
d1c58bdbbe integration-cli: remove/rename err-returns and remove naked returns
Prevent accidentally shadowing these errors, which are used in defers, and
remove naked returns.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-08 14:33:08 +02:00
Matthieu MOREL
b0711d5fe9 fix(QF1001): Apply De Morgan’s law
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-01 14:16:44 +02:00
Sebastiaan van Stijn
c690e0076a use consts for health-status in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-26 15:05:26 +02:00