Replace docker/docker with moby/moby client+api modules - #1534
Open
Slach wants to merge 1 commit into
Open
Conversation
The github.com/docker/docker module path is frozen at v28.5.2+incompatible
and will never receive patched releases; security fixes now land only in the
split-out github.com/moby/moby/{client,api} modules. Four permanently-open
Dependabot alerts (GHSA-rg2x-37c3-w2rh, GHSA-vp62-88p7-qqf5,
GHSA-x86f-5xw2-fm2r, GHSA-pxq6-2prw-chj9) are daemon-side bugs that cannot be
resolved on the old path, so switch the only importer -
test/integration/containers.go, a test-only dependency - to the new modules.
API differences adapted:
- option structs moved from api/types/* into the client package
(container.ListOptions -> client.ContainerListOptions, etc.)
- api/types/filters replaced by client.Filters ("make(Filters).Add(...)")
- list/inspect/create calls now return result wrappers
(ContainerListResult.Items, ContainerInspectResult.Container, ...)
- mutating calls return (Result, error) instead of just error
- ContainerCreate takes a single ContainerCreateOptions struct
- ContainerInspect takes an explicit options argument
- go-connections/nat port types replaced by api/types/network Port/PortSet/
PortMap; Port is now opaque (ParsePort/MustParsePort) and PortBinding.HostIP
is a netip.Addr
- container State.Status / Health.Status are now named string types
Coverage Report for CI Build 33949555037Coverage increased (+0.02%) to 66.803%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions11 previously-covered lines in 3 files lost coverage.
Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
test/integration/containers.go(build tagintegration, the only importer of the Docker SDK in this repo) now usesgithub.com/moby/moby/clientv0.6.0 +github.com/moby/moby/apiv1.56.0 instead ofgithub.com/docker/dockerv28.5.2+incompatible.github.com/docker/go-connectionsdrops to an indirect dependency (thenatport types are no longer used).grep docker/docker go.modis now empty.Why
The
github.com/docker/dockermodule path is frozen atv28.5.2+incompatibleand will never get a patched release — security fixes only land in the split-outgithub.com/moby/moby/{client,api}modules. That leaves four Dependabot alerts permanently open against this repo:All four are daemon-side bugs (we only ship a client, and only in tests — the dependency is not part of the
clickhouse-backupbinary, soTHIRD_PARTY_NOTICES.mdis unaffected), but they cannot be dismissed by bumping the old module path. Moving to the maintained modules removes them.API differences adapted
docker/docker)moby/moby)container.ListOptions,container.StopOptions,container.RemoveOptions,container.StartOptions,container.LogsOptions,network.ListOptions,network.CreateOptions,volume.ListOptions,volume.CreateOptions,image.PullOptionsclientpackage asclient.Container*Options/client.Network*Options/client.Volume*Options/client.ImagePullOptionsapi/types/filters(filters.NewArgs(filters.Arg(...)))client.Filters(make(client.Filters).Add("name", "tc_"))ContainerList→[]container.Summary,NetworkList→[]network.Summary,VolumeList→.Volumes.ItemsContainerInspect(ctx, id)→container.InspectResponseContainerInspect(ctx, id, client.ContainerInspectOptions{})→ContainerInspectResult, payload under.ContainerContainerStop/Remove/Start/Restart,NetworkRemove,VolumeRemovereturnederror(Result, error)ContainerCreate(ctx, cfg, hostCfg, netCfg, platform, name)ContainerCreate(ctx, client.ContainerCreateOptions{Config, HostConfig, NetworkingConfig, Name})NetworkRemove(ctx, id)/VolumeRemove(ctx, id, force bool)NetworkRemoveOptions{},VolumeRemoveOptions{Force: true})go-connections/nat:nat.Port("8123/tcp"),nat.PortSet,nat.PortMap,nat.PortBinding{HostIP: "0.0.0.0"}api/types/network:network.ParsePort/network.MustParsePort(Portis now an opaque struct, not a string),network.PortSet,network.PortMap,network.PortBinding{HostIP: netip.IPv4Unspecified()}(HostIPis anetip.Addr)inspect.State.Status,inspect.State.Health.Statuswerestringcontainer.ContainerState/container.HealthStatus, need explicitstring(...)conversion for concatenationGetMappedPortnow resolves the host IP vianetip.Addr.IsValid()/IsUnspecified()instead of comparing against""/"0.0.0.0".Verification
go run ./cmd/clickhouse-backup --help— OKgo vet -tags=integration ./test/integration/...— cleanGOFLAGS= make test(unit tests) — all passThese exercise network create/remove, named volume create/remove, image inspect/pull, container create/start/inspect/healthcheck-poll/logs/stop/remove, and the host port mapping lookup.
Second run, covering the
ContainerRestartpath (TestChangeReplicationPathIfReplicaExistsrestartsclickhouse,TestLongListRemoterestartsminio), which the first batch did not touch:Both restarts came back healthy on the first attempt (no "restarting again" / "not healthy after" warnings), so
ContainerRestart+ thepollHealthyinspect loop are confirmed against the new client.Full local integration run
RUN_PARALLEL=10 ./test/integration/run.sh(macOS/OrbStack, ClickHouse 26.8): 117 PASS, 4 FAIL in 39 min. None of the failures is in container lifecycle code; all happen insideclickhouse-backuprunning in the container:TestBwLimitEmbeddedGCS,TestEmbeddedGCSOverS3:read /etc/clickhouse-backup/credentials.json: is a directory— no local GCS credentials file, docker bind-mounts a directory instead (same onmasterlocally).TestResumeOperationsAfterRestartCOS:timeout waiting for resumed operationunder 10-way load (known flaky, real COS streaming upload).TestWatchScheduleServerMetrics:expect at least 3 scheduled full backups on remote, got 0 under 10-way load.Isolated rerun
RUN_TESTS='TestResumeOperationsAfterRestartCOS|TestWatchScheduleServerMetrics' RUN_PARALLEL=2 ./test/integration/run.sh:🤖 Generated with Claude Code