Skip to content
Success

Changes

Summary

  1. Refactor 'resolv.conf' generation. (details)
  2. client: fix TestPingWithError (details)
  3. client: NegotiateAPIVersion: do not ignore (connection) errors from Ping (details)
  4. client: doRequest: make sure we return a connection-error (details)
  5. client: fix connection-errors being shadowed by API version mismatch errors (details)
  6. ci: Make `find` for test reports more specific (details)
  7. Allow to enable host loopback and use 10.0.2.2 to connect to the host (OPTIONALLY) (details)
  8. Revert "integration/TestDaemonProxy: Remove OTEL span" (details)
  9. integration: Reset `OTEL_EXPORTER_OTLP_ENDPOINT` for sub-daemons (details)
  10. disable pulling legacy image formats by default (details)
  11. ci: Update `teststat` to v0.1.25 (details)
  12. Dockerfile: Update dev cli to v26.0.0-rc1 (details)
  13. distribution/xfer: fix pull progress message (details)
  14. libn/cnmallocator: migrate tests to gotest.tools/v3 (details)
  15. hack: block imports of vendored testify packages (details)
Commit beb97f7fdfa53b809cecacb074ad5f69af420da7 by rob.murray
Refactor 'resolv.conf' generation.

Replace regex matching/replacement and re-reading of generated files
with a simple parser, and struct to remember and manipulate the file
content.

Annotate the generated file with a header comment saying the file is
generated, but can be modified, and a trailing comment describing how
the file was generated and listing external nameservers.

Always start with the host's resolv.conf file, whether generating config
for host networking, or with/without an internal resolver - rather than
editing a file previously generated for a different use-case.

Resolves an issue where rewrites of the generated file resulted in
default IPv6 nameservers being unnecessarily added to the config.

Signed-off-by: Rob Murray <rob.murray@docker.com>
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/Extra_required_options.golden
The file was addedlibnetwork/internal/resolvconf/resolvconf.go
The file was addedintegration/networking/resolvconf_test.go
The file was modified libnetwork/sandbox_dns_unix.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_present_and_required.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/No_host_nameserver,_no_iv6.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCSetHeader.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_and_IPv6_localhost,_ipv6_enabled.golden
The file was removedlibnetwork/resolvconf/utils_test.go
The file was modified integration-cli/docker_cli_run_test.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCModify/No_content_no_overrides.golden
The file was modified libnetwork/libnetwork_linux_test.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/.gitattributes
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCInvalidNS.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_ipv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost,_IPv6_private,_IPv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCModify/Overrides.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_host,_override_and_required.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/No_host_nameserver,_iv6.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6_localhost,_IPv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_and_IPv6,_ipv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_missing_but_required.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCModify/No_overrides.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCModify/Add_option_no_overrides.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_IPv6_routeable,_ipv6_disabled.golden
The file was modified libnetwork/sandbox_store.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6_localhost,_ipv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_IPv6_routeable,_ipv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCUnknownDirectives.golden
The file was modified libnetwork/resolvconf/resolvconf.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv6_addr,_IPv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_only.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_ipv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6,_ipv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Override_nameservers.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost,_IPv6_private,_IPv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/resolvconf_path.go
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_and_IPv6,_ipv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6,_ipv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/resolvconf_test.go
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_only.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost_override.golden
The file was removedlibnetwork/resolvconf/utils.go
The file was modified daemon/container_operations_unix.go (diff)
The file was modified libnetwork/resolvconf/resolvconf_unix_test.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_and_IPv6_localhost,_ipv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost,_ipv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCModify/Empty_overrides.golden
The file was modified libnetwork/sandbox_dns_windows.go (diff)
Commit 349abc64ed9c18410592d69e90ef52036e35a7ce by Sebastiaan van Stijn
client: fix TestPingWithError

This test was added in 27ef09a46ffeb8ba42548de937b68351009f30ea, which changed
the Ping handling to ignore internal server errors. That case is tested in
TestPingFail, which verifies that we accept the Ping response if a 500
status code was received.

The TestPingWithError test was added to verify behavior if a protocol
(connection) error occurred; however the mock-client returned both a
response, and an error; the error returned would only happen if a connection
error occurred, which means that the server would not provide a reply.

Running the test also shows that returning a response is unexpected, and
ignored:

    === RUN   TestPingWithError
    2024/02/23 14:16:49 RoundTripper returned a response & error; ignoring response
    2024/02/23 14:16:49 RoundTripper returned a response & error; ignoring response
    --- PASS: TestPingWithError (0.00s)
    PASS

This patch updates the test to remove the response.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified client/ping_test.go (diff)
Commit 901b90593d6f845ccd403a36345a70a2a8a3b279 by Sebastiaan van Stijn
client: NegotiateAPIVersion: do not ignore (connection) errors from Ping

NegotiateAPIVersion was ignoring errors returned by Ping. The intent here
was to handle API responses from a daemon that may be in an unhealthy state,
however this case is already handled by Ping itself.

Ping only returns an error when either failing to connect to the API (daemon
not running or permissions errors), or when failing to parse the API response.

Neither of those should be ignored in this code, or considered a successful
"ping", so update the code to return

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified client/client_test.go (diff)
The file was modified client/ping.go (diff)
The file was modified client/client.go (diff)
Commit 913478b428268579b996dd54ee9a155d5d249e8a by Sebastiaan van Stijn
client: doRequest: make sure we return a connection-error

This function has various errors that are returned when failing to make a
connection (due to permission issues, TLS mis-configuration, or failing to
resolve the TCP address).

The errConnectionFailed error is currently used as a special case when
processing Ping responses. The current code did not consistently treat
connection errors, and because of that could either absorb the error,
or process the empty response.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified client/errors.go (diff)
The file was modified client/request.go (diff)
Commit 6aea26b431ea152a8b085e453da06ea403f89886 by Sebastiaan van Stijn
client: fix connection-errors being shadowed by API version mismatch errors

Commit e6907243af215a90fe36b377d89a49e3a2eded0a applied a fix for situations
where the client was configured with API-version negotiation, but did not yet
negotiate a version.

However, the checkVersion() function that was implemented copied the semantics
of cli.NegotiateAPIVersion, which ignored connection failures with the
assumption that connection errors would still surface further down.

However, when using the result of a failed negotiation for NewVersionError,
an API version mismatch error would be produced, masking the actual connection
error.

This patch changes the signature of checkVersion to return unexpected errors,
including failures to connect to the API.

Before this patch:

    docker -H unix:///no/such/socket.sock secret ls
    "secret list" requires API version 1.25, but the Docker daemon API version is 1.24

With this patch applied:

    docker -H unix:///no/such/socket.sock secret ls
    Cannot connect to the Docker daemon at unix:///no/such/socket.sock. Is the docker daemon running?

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified client/container_exec_test.go (diff)
The file was modified client/container_create_test.go (diff)
The file was modified client/network_create_test.go (diff)
The file was modified client/client_test.go (diff)
The file was modified client/image_list.go (diff)
The file was modified client/service_update.go (diff)
The file was modified client/container_wait.go (diff)
The file was modified client/container_wait_test.go (diff)
The file was modified client/service_update_test.go (diff)
The file was modified client/container_stop.go (diff)
The file was modified client/network_create.go (diff)
The file was modified client/container_create.go (diff)
The file was modified client/container_restart.go (diff)
The file was modified client/container_restart_test.go (diff)
The file was modified client/image_list_test.go (diff)
The file was modified client/container_stop_test.go (diff)
The file was modified client/errors.go (diff)
The file was modified client/volume_remove.go (diff)
The file was modified client/service_create_test.go (diff)
The file was modified client/service_create.go (diff)
The file was modified client/volume_remove_test.go (diff)
The file was modified client/container_exec.go (diff)
The file was modified client/client.go (diff)
Commit e4de4dea5cdbb0d91dd9d5f3e9b2e35ea33b56f2 by Paweł Gronowski
ci: Make `find` for test reports more specific

Don't use all `*.json` files blindly, take only these that are likely to
be reports from go test.
Also, use `find ... -exec` instead of piping results to `xargs`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The file was modified .github/workflows/.windows.yml (diff)
The file was modified .github/workflows/.test.yml (diff)
Commit b649e272bb0253fe766069966416b9330a2e38c0 by serhii.n
Allow to enable host loopback and use 10.0.2.2 to connect to the host (OPTIONALLY)

This should allow to enable host loopback by setting
DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK to false,
defaults true.

Signed-off-by: serhii.n <serhii.n@thescimus.com>
The file was modified contrib/dockerd-rootless.sh (diff)
Commit 84eecc4a30c456c18bbebe1921e2ec754154e953 by Paweł Gronowski
Revert "integration/TestDaemonProxy: Remove OTEL span"

This reverts commit 56aeb548b23882e6e10bbcd9a3b1731cdfb86b57.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The file was modified integration/daemon/daemon_test.go (diff)
Commit 5fe96e234d23fc53639cdbe9f3a7bb08a7a51208 by Paweł Gronowski
integration: Reset `OTEL_EXPORTER_OTLP_ENDPOINT` for sub-daemons

When creating a new daemon in the `TestDaemonProxy`, reset the
`OTEL_EXPORTER_OTLP_ENDPOINT` to an empty value to disable OTEL
collection to avoid it hitting the proxy.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The file was modified integration/daemon/daemon_test.go (diff)
Commit 62b33a2604c0bacdd26bfbe7303cb6e2ed26d432 by Sebastiaan van Stijn
disable pulling legacy image formats by default

This patch disables pulling legacy (schema1 and schema 2, version 1) images by
default.

A `DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE` environment-variable is
introduced to allow re-enabling this feature, aligning with the environment
variable used in containerd 2.0 (`CONTAINERD_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE`).

With this patch, attempts to pull a legacy image produces an error:

With graphdrivers:

    docker pull docker:1.0
    1.0: Pulling from library/docker
    [DEPRECATION NOTICE] Docker Image Format v1, and Docker Image manifest version 2, schema 1 support will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format, or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/

With the containerd image store enabled, output is slightly different
as it returns the error before printing the `1.0: pulling ...`:

    docker pull docker:1.0
    Error response from daemon: [DEPRECATION NOTICE] Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default and will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/

Using the "distribution" endpoint to resolve the digest for an image also
produces an error:

    curl -v --unix-socket /var/run/docker.sock http://foo/distribution/docker.io/library/docker:1.0/json
    *   Trying /var/run/docker.sock:0...
    * Connected to foo (/var/run/docker.sock) port 80 (#0)
    > GET /distribution/docker.io/library/docker:1.0/json HTTP/1.1
    > Host: foo
    > User-Agent: curl/7.88.1
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < Api-Version: 1.45
    < Content-Type: application/json
    < Docker-Experimental: false
    < Ostype: linux
    < Server: Docker/dev (linux)
    < Date: Tue, 27 Feb 2024 16:09:42 GMT
    < Content-Length: 354
    <
    {"message":"[DEPRECATION NOTICE] Docker Image Format v1, and Docker Image manifest version 2, schema 1 support will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format, or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/"}
    * Connection #0 to host foo left intact

Starting the daemon with the `DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE`
env-var set to a non-empty value allows pulling the image;

    docker pull docker:1.0
    [DEPRECATION NOTICE] Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default and will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/
    b0a0e6710d13: Already exists
    d193ad713811: Already exists
    ba7268c3149b: Already exists
    c862d82a67a2: Already exists
    Digest: sha256:5e7081837926c7a40e58881bbebc52044a95a62a2ea52fb240db3fc539212fe5
    Status: Image is up to date for docker:1.0
    docker.io/library/docker:1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified api/server/router/distribution/distribution_routes.go (diff)
The file was modified distribution/pull_v2.go (diff)
The file was modified distribution/errors.go (diff)
The file was modified distribution/manifest.go (diff)
The file was modified daemon/containerd/image_pull.go (diff)
The file was modified hack/make/.integration-daemon-start (diff)
The file was modified distribution/manifest_test.go (diff)
Commit fc0e5401f2218f3a1c6c9fc2a42a548df69d468c by Paweł Gronowski
ci: Update `teststat` to v0.1.25

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The file was modified .github/workflows/.test.yml (diff)
The file was modified .github/workflows/.windows.yml (diff)
Commit 2af2496c8cc17c1407f5c1011369feb6a4cc23ef by Paweł Gronowski
Dockerfile: Update dev cli to v26.0.0-rc1

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The file was modified Dockerfile (diff)
Commit ebf3f8c7fe100253c19e3781ff8c4c6d2adfbfb8 by Sebastiaan van Stijn
distribution/xfer: fix pull progress message

This message accidentally changed in ac2a028dcc05532109e14f8af105ca42c0abf1f3
because my IDE's "refactor tool" was a bit over-enthusiastic. It also went and
updated the tests accordingly, so CI didn't catch this :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified distribution/xfer/download.go (diff)
The file was modified distribution/xfer/download_test.go (diff)
Commit 4f30a930ad02b31bb228ae2963072f107bdd7ed3 by Cory Snider
libn/cnmallocator: migrate tests to gotest.tools/v3

Apply command gotest.tools/v3/assert/cmd/gty-migrate-from-testify to the
cnmallocator package to be consistent with the assertion library used
elsewhere in moby.

Signed-off-by: Cory Snider <csnider@mirantis.com>
The file was modified vendor.mod (diff)
The file was modified libnetwork/cnmallocator/networkallocator_test.go (diff)
The file was modified libnetwork/cnmallocator/provider_test.go (diff)
Commit 7ebd88d2d9d499f606e56a567be8fe6a18f25258 by Cory Snider
hack: block imports of vendored testify packages

While github.com/stretchr/testify is not used directly by any of the
repository code, it is a transitive dependency via Swarmkit and
therefore still easy to use without having to revendor. Add lint rules
to ban importing testify packages to make sure nobody does.

Signed-off-by: Cory Snider <csnider@mirantis.com>
The file was modified .golangci.yml (diff)

Summary

  1. Refactor 'resolv.conf' generation. (details)
  2. client: fix TestPingWithError (details)
  3. client: NegotiateAPIVersion: do not ignore (connection) errors from Ping (details)
  4. client: doRequest: make sure we return a connection-error (details)
  5. client: fix connection-errors being shadowed by API version mismatch errors (details)
  6. ci: Make `find` for test reports more specific (details)
  7. Allow to enable host loopback and use 10.0.2.2 to connect to the host (OPTIONALLY) (details)
  8. Revert "integration/TestDaemonProxy: Remove OTEL span" (details)
  9. integration: Reset `OTEL_EXPORTER_OTLP_ENDPOINT` for sub-daemons (details)
  10. disable pulling legacy image formats by default (details)
  11. ci: Update `teststat` to v0.1.25 (details)
  12. Dockerfile: Update dev cli to v26.0.0-rc1 (details)
  13. distribution/xfer: fix pull progress message (details)
  14. libn/cnmallocator: migrate tests to gotest.tools/v3 (details)
  15. hack: block imports of vendored testify packages (details)
Commit beb97f7fdfa53b809cecacb074ad5f69af420da7 by rob.murray
Refactor 'resolv.conf' generation.

Replace regex matching/replacement and re-reading of generated files
with a simple parser, and struct to remember and manipulate the file
content.

Annotate the generated file with a header comment saying the file is
generated, but can be modified, and a trailing comment describing how
the file was generated and listing external nameservers.

Always start with the host's resolv.conf file, whether generating config
for host networking, or with/without an internal resolver - rather than
editing a file previously generated for a different use-case.

Resolves an issue where rewrites of the generated file resulted in
default IPv6 nameservers being unnecessarily added to the config.

Signed-off-by: Rob Murray <rob.murray@docker.com>
The file was addedlibnetwork/internal/resolvconf/resolvconf_path.go
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6_localhost,_IPv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCModify/Add_option_no_overrides.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6,_ipv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCModify/Overrides.golden
The file was modified libnetwork/libnetwork_linux_test.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCInvalidNS.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_and_IPv6_localhost,_ipv6_enabled.golden
The file was modified libnetwork/sandbox_store.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCUnknownDirectives.golden
The file was modified libnetwork/resolvconf/resolvconf.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/.gitattributes
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv6_addr,_IPv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_and_IPv6_localhost,_ipv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/Extra_required_options.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/No_host_nameserver,_iv6.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_present_and_required.golden
The file was addedintegration/networking/resolvconf_test.go
The file was modified libnetwork/resolvconf/resolvconf_unix_test.go (diff)
The file was addedlibnetwork/internal/resolvconf/resolvconf.go
The file was modified libnetwork/sandbox_dns_unix.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_IPv6_routeable,_ipv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost_override.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_ipv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_and_IPv6,_ipv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCSetHeader.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_missing_but_required.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost,_IPv6_private,_IPv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_ipv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_IPv6_routeable,_ipv6_disabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCModify/Empty_overrides.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6,_ipv6_enabled.golden
The file was modified daemon/container_operations_unix.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/No_host_nameserver,_no_iv6.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_only.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Override_nameservers.golden
The file was removedlibnetwork/resolvconf/utils.go
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCModify/No_overrides.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_and_IPv6,_ipv6_enabled.golden
The file was modified libnetwork/sandbox_dns_windows.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_host,_override_and_required.golden
The file was removedlibnetwork/resolvconf/utils_test.go
The file was modified integration-cli/docker_cli_run_test.go (diff)
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6_localhost,_ipv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost,_IPv6_private,_IPv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost,_ipv6_enabled.golden
The file was addedlibnetwork/internal/resolvconf/resolvconf_test.go
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCModify/No_content_no_overrides.golden
The file was addedlibnetwork/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_only.golden
Commit 349abc64ed9c18410592d69e90ef52036e35a7ce by Sebastiaan van Stijn
client: fix TestPingWithError

This test was added in 27ef09a46ffeb8ba42548de937b68351009f30ea, which changed
the Ping handling to ignore internal server errors. That case is tested in
TestPingFail, which verifies that we accept the Ping response if a 500
status code was received.

The TestPingWithError test was added to verify behavior if a protocol
(connection) error occurred; however the mock-client returned both a
response, and an error; the error returned would only happen if a connection
error occurred, which means that the server would not provide a reply.

Running the test also shows that returning a response is unexpected, and
ignored:

    === RUN   TestPingWithError
    2024/02/23 14:16:49 RoundTripper returned a response & error; ignoring response
    2024/02/23 14:16:49 RoundTripper returned a response & error; ignoring response
    --- PASS: TestPingWithError (0.00s)
    PASS

This patch updates the test to remove the response.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified client/ping_test.go (diff)
Commit 901b90593d6f845ccd403a36345a70a2a8a3b279 by Sebastiaan van Stijn
client: NegotiateAPIVersion: do not ignore (connection) errors from Ping

NegotiateAPIVersion was ignoring errors returned by Ping. The intent here
was to handle API responses from a daemon that may be in an unhealthy state,
however this case is already handled by Ping itself.

Ping only returns an error when either failing to connect to the API (daemon
not running or permissions errors), or when failing to parse the API response.

Neither of those should be ignored in this code, or considered a successful
"ping", so update the code to return

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified client/ping.go (diff)
The file was modified client/client.go (diff)
The file was modified client/client_test.go (diff)
Commit 913478b428268579b996dd54ee9a155d5d249e8a by Sebastiaan van Stijn
client: doRequest: make sure we return a connection-error

This function has various errors that are returned when failing to make a
connection (due to permission issues, TLS mis-configuration, or failing to
resolve the TCP address).

The errConnectionFailed error is currently used as a special case when
processing Ping responses. The current code did not consistently treat
connection errors, and because of that could either absorb the error,
or process the empty response.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified client/errors.go (diff)
The file was modified client/request.go (diff)
Commit 6aea26b431ea152a8b085e453da06ea403f89886 by Sebastiaan van Stijn
client: fix connection-errors being shadowed by API version mismatch errors

Commit e6907243af215a90fe36b377d89a49e3a2eded0a applied a fix for situations
where the client was configured with API-version negotiation, but did not yet
negotiate a version.

However, the checkVersion() function that was implemented copied the semantics
of cli.NegotiateAPIVersion, which ignored connection failures with the
assumption that connection errors would still surface further down.

However, when using the result of a failed negotiation for NewVersionError,
an API version mismatch error would be produced, masking the actual connection
error.

This patch changes the signature of checkVersion to return unexpected errors,
including failures to connect to the API.

Before this patch:

    docker -H unix:///no/such/socket.sock secret ls
    "secret list" requires API version 1.25, but the Docker daemon API version is 1.24

With this patch applied:

    docker -H unix:///no/such/socket.sock secret ls
    Cannot connect to the Docker daemon at unix:///no/such/socket.sock. Is the docker daemon running?

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified client/image_list_test.go (diff)
The file was modified client/container_wait_test.go (diff)
The file was modified client/image_list.go (diff)
The file was modified client/network_create.go (diff)
The file was modified client/network_create_test.go (diff)
The file was modified client/container_create_test.go (diff)
The file was modified client/container_create.go (diff)
The file was modified client/service_create.go (diff)
The file was modified client/container_restart.go (diff)
The file was modified client/volume_remove_test.go (diff)
The file was modified client/container_exec_test.go (diff)
The file was modified client/service_update_test.go (diff)
The file was modified client/client_test.go (diff)
The file was modified client/container_stop_test.go (diff)
The file was modified client/container_wait.go (diff)
The file was modified client/service_update.go (diff)
The file was modified client/container_stop.go (diff)
The file was modified client/volume_remove.go (diff)
The file was modified client/container_restart_test.go (diff)
The file was modified client/client.go (diff)
The file was modified client/container_exec.go (diff)
The file was modified client/service_create_test.go (diff)
The file was modified client/errors.go (diff)
Commit e4de4dea5cdbb0d91dd9d5f3e9b2e35ea33b56f2 by Paweł Gronowski
ci: Make `find` for test reports more specific

Don't use all `*.json` files blindly, take only these that are likely to
be reports from go test.
Also, use `find ... -exec` instead of piping results to `xargs`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The file was modified .github/workflows/.test.yml (diff)
The file was modified .github/workflows/.windows.yml (diff)
Commit b649e272bb0253fe766069966416b9330a2e38c0 by serhii.n
Allow to enable host loopback and use 10.0.2.2 to connect to the host (OPTIONALLY)

This should allow to enable host loopback by setting
DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK to false,
defaults true.

Signed-off-by: serhii.n <serhii.n@thescimus.com>
The file was modified contrib/dockerd-rootless.sh (diff)
Commit 84eecc4a30c456c18bbebe1921e2ec754154e953 by Paweł Gronowski
Revert "integration/TestDaemonProxy: Remove OTEL span"

This reverts commit 56aeb548b23882e6e10bbcd9a3b1731cdfb86b57.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The file was modified integration/daemon/daemon_test.go (diff)
Commit 5fe96e234d23fc53639cdbe9f3a7bb08a7a51208 by Paweł Gronowski
integration: Reset `OTEL_EXPORTER_OTLP_ENDPOINT` for sub-daemons

When creating a new daemon in the `TestDaemonProxy`, reset the
`OTEL_EXPORTER_OTLP_ENDPOINT` to an empty value to disable OTEL
collection to avoid it hitting the proxy.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The file was modified integration/daemon/daemon_test.go (diff)
Commit 62b33a2604c0bacdd26bfbe7303cb6e2ed26d432 by Sebastiaan van Stijn
disable pulling legacy image formats by default

This patch disables pulling legacy (schema1 and schema 2, version 1) images by
default.

A `DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE` environment-variable is
introduced to allow re-enabling this feature, aligning with the environment
variable used in containerd 2.0 (`CONTAINERD_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE`).

With this patch, attempts to pull a legacy image produces an error:

With graphdrivers:

    docker pull docker:1.0
    1.0: Pulling from library/docker
    [DEPRECATION NOTICE] Docker Image Format v1, and Docker Image manifest version 2, schema 1 support will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format, or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/

With the containerd image store enabled, output is slightly different
as it returns the error before printing the `1.0: pulling ...`:

    docker pull docker:1.0
    Error response from daemon: [DEPRECATION NOTICE] Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default and will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/

Using the "distribution" endpoint to resolve the digest for an image also
produces an error:

    curl -v --unix-socket /var/run/docker.sock http://foo/distribution/docker.io/library/docker:1.0/json
    *   Trying /var/run/docker.sock:0...
    * Connected to foo (/var/run/docker.sock) port 80 (#0)
    > GET /distribution/docker.io/library/docker:1.0/json HTTP/1.1
    > Host: foo
    > User-Agent: curl/7.88.1
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < Api-Version: 1.45
    < Content-Type: application/json
    < Docker-Experimental: false
    < Ostype: linux
    < Server: Docker/dev (linux)
    < Date: Tue, 27 Feb 2024 16:09:42 GMT
    < Content-Length: 354
    <
    {"message":"[DEPRECATION NOTICE] Docker Image Format v1, and Docker Image manifest version 2, schema 1 support will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format, or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/"}
    * Connection #0 to host foo left intact

Starting the daemon with the `DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE`
env-var set to a non-empty value allows pulling the image;

    docker pull docker:1.0
    [DEPRECATION NOTICE] Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default and will be removed in an upcoming release. Suggest the author of docker.io/library/docker:1.0 to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/
    b0a0e6710d13: Already exists
    d193ad713811: Already exists
    ba7268c3149b: Already exists
    c862d82a67a2: Already exists
    Digest: sha256:5e7081837926c7a40e58881bbebc52044a95a62a2ea52fb240db3fc539212fe5
    Status: Image is up to date for docker:1.0
    docker.io/library/docker:1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified distribution/manifest.go (diff)
The file was modified api/server/router/distribution/distribution_routes.go (diff)
The file was modified distribution/errors.go (diff)
The file was modified hack/make/.integration-daemon-start (diff)
The file was modified daemon/containerd/image_pull.go (diff)
The file was modified distribution/pull_v2.go (diff)
The file was modified distribution/manifest_test.go (diff)
Commit fc0e5401f2218f3a1c6c9fc2a42a548df69d468c by Paweł Gronowski
ci: Update `teststat` to v0.1.25

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The file was modified .github/workflows/.test.yml (diff)
The file was modified .github/workflows/.windows.yml (diff)
Commit 2af2496c8cc17c1407f5c1011369feb6a4cc23ef by Paweł Gronowski
Dockerfile: Update dev cli to v26.0.0-rc1

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The file was modified Dockerfile (diff)
Commit ebf3f8c7fe100253c19e3781ff8c4c6d2adfbfb8 by Sebastiaan van Stijn
distribution/xfer: fix pull progress message

This message accidentally changed in ac2a028dcc05532109e14f8af105ca42c0abf1f3
because my IDE's "refactor tool" was a bit over-enthusiastic. It also went and
updated the tests accordingly, so CI didn't catch this :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The file was modified distribution/xfer/download.go (diff)
The file was modified distribution/xfer/download_test.go (diff)
Commit 4f30a930ad02b31bb228ae2963072f107bdd7ed3 by Cory Snider
libn/cnmallocator: migrate tests to gotest.tools/v3

Apply command gotest.tools/v3/assert/cmd/gty-migrate-from-testify to the
cnmallocator package to be consistent with the assertion library used
elsewhere in moby.

Signed-off-by: Cory Snider <csnider@mirantis.com>
The file was modified libnetwork/cnmallocator/networkallocator_test.go (diff)
The file was modified vendor.mod (diff)
The file was modified libnetwork/cnmallocator/provider_test.go (diff)
Commit 7ebd88d2d9d499f606e56a567be8fe6a18f25258 by Cory Snider
hack: block imports of vendored testify packages

While github.com/stretchr/testify is not used directly by any of the
repository code, it is a transitive dependency via Swarmkit and
therefore still easy to use without having to revendor. Add lint rules
to ban importing testify packages to make sure nobody does.

Signed-off-by: Cory Snider <csnider@mirantis.com>
The file was modified .golangci.yml (diff)