Commit Graph

6025 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
93eb7962dc integration-cli: TestUserDefinedNetworkAlias: replace deprecated utils
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:51:26 +01:00
Sebastiaan van Stijn
83f17f77cf integration-cli: adjust some tests for API-specific event-types
Image create events were added in API 1.46, and filtered out in older
API versions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:51:26 +01:00
Sebastiaan van Stijn
35f1250685 integration-cli: use event-consts in some tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:51:23 +01:00
Sebastiaan van Stijn
33eb3b8d78 integration-cli: TestEventsFilterType: remove test for "build" events
Commit 6aea8c2591 updated this part of the
test to account for BuildKit now being used as default, which doesn't use
regular containers to "commit" to an image, and therefore doesn't produce
events as part of the build.

However, it changed it to filter for `build` type events, which .. don't
exist. The test passed because it only checked for number of events produced,
which is approximated by checking the number of lines in the output. In
this case, the output would be empty, so "events" was a slice of strings
with length 1; an empty string.

Given that BuildKit doesn't produce meaningful events to test for, we could
either disable BuildKit, to test the legacy builder, or just remove this
part of the test. Let's do the latter.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:50:45 +01:00
Sebastiaan van Stijn
fcb23060fc integration-cli: rewrite some tests depending on intermediate images
These tests used intermediate images (as produced by the classic builder)
as part of the test. When using BuildKit, such images are not produced,
and will only be in the build-cache.

From the tests, it looks like the extra checks were not critical to
verify the behavior, so let's simplify them to not depend on this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-09 17:04:49 +01:00
Sebastiaan van Stijn
751a6f9f33 integration-cli: improve TestBuildNoNamedVolume
Make sure the error is the one we expected, and slightly clarify
the behavior (named volumes not having a meaning in VOLUME, so will
be used as-is).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-09 17:01:53 +01:00
Sebastiaan van Stijn
5152c7c3ef integration-cli: DockerCLIBuildSuite: use more unique names for images
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-09 17:00:21 +01:00
Sebastiaan van Stijn
a39e866aa8 integration-cli: rename var that shadowed package-level const
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-09 17:00:21 +01:00
Aditya Mishra
87583c9029 integration: migrate TestAPIImagesSizeCompatibility to integration test
Signed-off-by: Aditya Mishra <mishraaditya675@gmail.com>
2025-11-29 00:28:44 +05:30
Rob Murray
5512eea3d0 Merge pull request #51559 from 2003Aditya/TestAPIImagesSaveAndLoad
migrate TestAPIImagesSaveAndLoad to integration test
2025-11-26 12:11:14 +00:00
Rob Murray
84a251d039 Allow configured address with no configured subnet
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-11-24 14:14:27 +00:00
Aditya Mishra
93825e00e8 migrate TestAPIImagesSaveAndLoad to integration test
Signed-off-by: Aditya Mishra <mishraaditya675@gmail.com>
2025-11-20 17:39:10 +05:30
Sebastiaan van Stijn
c36b8ddd57 Merge pull request #51550 from 2003Aditya/TestAPIGetEnabledCORS
integration: migrate TestAPIGetEnabledCORS to integration test
2025-11-18 13:25:10 +00:00
Aditya Mishra
9fbc9d6e6d integration: migrate TestAPIGetEnabledCORS to integration test
Signed-off-by: Aditya Mishra <mishraaditya675@gmail.com>
2025-11-18 12:20:20 +05:30
Paweł Gronowski
33e967575d Merge pull request #51549 from thaJeztah/rm_TestVolumeCLINoArgs
integration-cli: remove TestVolumeCLINoArgs
2025-11-17 17:03:43 +00:00
Sebastiaan van Stijn
cf7cc93529 Merge pull request #51498 from 2003Aditya/TestAPIImagesDelete
Test api images delete
2025-11-16 23:04:06 +01:00
Sebastiaan van Stijn
029770595d integration-cli: remove TestVolumeCLINoArgs
This test was only testing behavior of the CLI itself (or even basic
functionality provided by Cobra).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-16 21:21:56 +01:00
Aditya Mishra
8f1134b46d integration/image: migrate TestAPIImagesDelete to the new integration test framework
Migrated TestAPIImagesDelete from the legacy integration-cli suite
(docker_api_images_test.go) to the new integration test framework under
integration/image/remove_test.go.

This update:
- Fixes ENV instruction syntax to use "ENV FOO=bar"
- Adds error type check using errdefs.IsNotFound for cleaner assertions
- Ensures consistent cleanup handling

Signed-off-by: Aditya Mishra <mishraaditya675@gmail.com>
2025-11-14 22:00:15 +05:30
Sebastiaan van Stijn
dae3650dcc client: rename/deprecate WithVersion, WithVersionFromEnv
Add WithAPIVersion and WithAPIVersionFromEnv to be more clear on
the intent, and to align with other related options and fields.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-12 22:39:05 +01:00
Sebastiaan van Stijn
db71c6a914 api/types/container: make HealthStatus a concrete type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 16:08:15 +01:00
Sebastiaan van Stijn
fe1a505cbf simplify some commit tests, and work around change in CLI behavior
These tests were failing because the "docker run" did not print the
ID of the container, and instead detached immediately without printing;

```
=== Failed
=== FAIL: amd64.integration-cli TestDockerCLICommitSuite/TestCommitAfterContainerIsDone (0.27s)
    docker_cli_commit_test.go:32: assertion failed:
        Command:  /usr/local/cli-integration/docker wait
        ExitCode: 1
        Error:    exit status 1
        Stdout:
        Stderr:   invalid container name or ID: value is empty

        Failures:
        ExitCode was 1 expected 0
        Expected no error
    --- FAIL: TestDockerCLICommitSuite/TestCommitAfterContainerIsDone (0.27s)

=== FAIL: amd64.integration-cli TestDockerCLICommitSuite/TestCommitWithoutPause (0.20s)
    docker_cli_commit_test.go:47: assertion failed:
        Command:  /usr/local/cli-integration/docker wait
        ExitCode: 1
        Error:    exit status 1
        Stdout:
        Stderr:   invalid container name or ID: value is empty

        Failures:
        ExitCode was 1 expected 0
        Expected no error
    --- FAIL: TestDockerCLICommitSuite/TestCommitWithoutPause (0.20s)
```

What happens is that it starts a container with only `stdin` attached, but
no `stdout`, and the behavior changed between versions of the CLI, which
may be either a bugfix or a regression;

docker 28 cli doesn't stay attached:

```bash
Status: Downloaded newer image for docker:28-cli
/ # docker run -i -a stdin busybox echo foo
/ #
```

docker 27 cli stays attached, but has the "three strikes, you're out" handling:

```bash
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock docker:27-cli sh
Status: Downloaded newer image for docker:27-cli
/ # docker run -i -a stdin busybox echo foo
9dbb29080a72225593885bc4880d8f4f22f36803100179f9725468bda1d52b4f

^C^C^C
got 3 SIGTERM/SIGINTs, forcefully exiting
/ # ^C
```

docker 26 cli (and older) don't forward the signal to the container, and detach-keys don't work (or in this case, are handled by the CLI container)?:

```bash
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock docker:26-cli sh
Status: Downloaded newer image for docker:26-cli
/ # docker run -i -a stdin busybox echo foo
21963ce1b9a7bb7eccef3618693b09a106fb29084b484e31c69cd4a26ee44777
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C

<CTRL>p,q
```

As these tests were not testing that part, I simplified the tests, but
we should probably look into the change of behavior to see if it was
intentional (and if it was correct).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:14 +01:00
Sebastiaan van Stijn
c477a68fb9 TestBuildForceRm: use assert to help debugging failures
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:13 +01:00
Sebastiaan van Stijn
b0ab0b4078 TestBridgeIPIsExcludedFromAllocatorPool: don't use deprecated fields
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:13 +01:00
Sebastiaan van Stijn
9b7452e903 TestDockerNetworkValidateIP: relax string-matching errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:13 +01:00
Sebastiaan van Stijn
82a5eec1aa DockerSwarmSuite: relax string-matching errors and output
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:13 +01:00
Sebastiaan van Stijn
2e3c523579 TestAttachPausedContainer: relax error-message matching
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:12 +01:00
Sebastiaan van Stijn
598618b6f2 TestBuildWithInaccessibleFilesInContext: use sub-tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 12:40:12 +01:00
Sebastiaan van Stijn
c5aedacb4f client: Client.ContainerExport: close reader on context cancellation
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 00:07:57 +01:00
Sebastiaan van Stijn
d299e5be83 api/types/swarm: define type for UpdateOrder
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 12:50:51 +01:00
Sebastiaan van Stijn
b552b8b729 api/types/swarm: define type for FailureAction
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 12:50:48 +01:00
Paweł Gronowski
47edd80d97 integration-cli: Adjust nofile limits
runc v1.3.3 needs more file descriptors now.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-05 11:28:35 +01:00
Salim Dohri
9b749d7c85 integration-cli: migrate TestAPIStatsContainerNotFound to integration tests
Migrate TestAPIStatsContainerNotFound from the deprecated integration-cli
test suite to the modern integration test framework in integration/container.

The test verifies that the container stats API returns a NotFound error
for non-existent containers, testing both streaming and non-streaming modes.

Changes made:
- Migrated test to integration/container/stats_test.go using standard
  Go testing patterns
- Refactored to use test array pattern for better test organization
- Removed test from integration-cli/docker_api_stats_test.go
- Removed unused imports from integration-cli file
- Removed Windows skip as it may not be necessary

Signed-off-by: Salim Dohri <dohri.salim@gmail.com>
2025-11-02 10:46:22 +01:00
Sebastiaan van Stijn
455e4e523f Merge pull request #51269 from austinvazquez/refactor-client-network
client: refactor create network api implementation to define options/result struct
2025-10-31 15:46:53 +01:00
Sebastiaan van Stijn
6aea8c2591 Dockerfile: update integration-cli CLI to v25.0.5
Now that we're raising the minimum API version, we can also update
the CLI used in our integration-cli tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 09:22:40 +01:00
Austin Vazquez
a087d03e0c client: refactor create network api implementation to wrap options/results
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-30 23:45:18 -05:00
Sebastiaan van Stijn
d1f70d4f54 client: deprecate NewClientWithOpts in favor of New
Use a more idiomatic name so that it can be used as `client.New()`.

We should look if we want `New()` to have different / updated defaults
i.e., enable `WithEnv` as default, and have an opt-out and have API-
version negotiation enabled by default (with an opt-out option).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 18:09:44 +01:00
Austin Vazquez
860307c4ea client: refactor ServerVersion to return ServerVersionResult
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 14:22:41 +01:00
Austin Vazquez
c5e318dbde Merge pull request #51328 from vvoland/client-containercopy-structs
client/container_copy: Wrap options and result struct
2025-10-29 10:44:59 -05:00
Paweł Gronowski
1cc2ab16ce client/container_copy: Wrap options and result struct
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-29 14:34:19 +01:00
Sebastiaan van Stijn
e9631b507e Merge pull request #51323 from thaJeztah/container_wait_nits
client: ContainerWait: touch-up GoDoc, and remove legacy code, and use singular for channels (ContainerWaitResult)
2025-10-29 13:41:02 +01:00
Paweł Gronowski
c755b9635d Merge pull request #51322 from vvoland/client-fixup
client: Rename ContainerUnPause* to ContainerUnpause*
2025-10-29 12:56:32 +01:00
Paweł Gronowski
f708214dbf Merge pull request #51324 from thaJeztah/network_connect_disconnect
api/types/network: define `ConnectRequest` and `DisconnectRequest`
2025-10-29 12:56:15 +01:00
Sebastiaan van Stijn
29ad05b130 client: ContainerWaitResult: use singular for channels
These channels should ever only return a single result, so rename
them to match that expectation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 12:37:46 +01:00
Sebastiaan van Stijn
7041c02abd Merge pull request #51320 from thaJeztah/refactor_client_system_step1
client: refactor Events, Info, RegistryLogin
2025-10-29 12:25:28 +01:00
Austin Vazquez
bae45f766d api/types/network: define ConnectRequest and DisconnectRequest
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-29 11:44:18 +01:00
Paweł Gronowski
fc97a2ff0d client: Rename ContainerUnPause* to ContainerUnpause*
To better match the method name itself

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-29 11:32:32 +01:00
Sebastiaan van Stijn
d3eb04fe59 Merge pull request #51312 from austinvazquez/refactor-client-container-wait
client: refactor ContainerWait to use client defined options/results structs
2025-10-29 11:12:52 +01:00
Sebastiaan van Stijn
a0f877d1b3 Merge pull request #51316 from austinvazquez/refactor-client-container-export
client: refactor `ContainerExport` to wrap options/result structs
2025-10-29 10:01:07 +01:00
Austin Vazquez
e46058cbae client: refactor Events, Info, RegistryLogin
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-29 09:36:23 +01:00
Sebastiaan van Stijn
c438b3fbbf Merge pull request #51314 from austinvazquez/refactor-client-container-list
client: refactor `ContainerList` to wrap result
2025-10-29 08:31:22 +01:00