Repository navigation
chore(deps): migrate Docker client from docker/docker to moby/moby/client - #150
Merged
christophrj merged 5 commits intoSep 30, 2026
Merged
Conversation
n-losse
force-pushed
the
add-retrieveDigest-tests
branch
from
September 29, 2026 14:37
ee50f47 to
75084b3
Compare
n-losse
marked this pull request as draft
September 29, 2026 14:40
n-losse
marked this pull request as ready for review
September 29, 2026 14:49
Extract a narrow imageInspector interface and newDockerClient var so the Docker client can be stubbed in tests without a real daemon. Covers the four meaningful cases: digest extracted, empty RepoDigests, ImageInspect error, and client construction error. This also makes the function's behaviour explicit ahead of the planned github.com/docker/docker → github.com/moby/moby/client migration. Signed-off-by: Nikolas Losse <nikolas.losse@sap.com>
…ient
Replace github.com/docker/docker v28.5.2+incompatible with the new
standalone module github.com/moby/moby/client v0.6.0. The old monorepo
dep is fully removed from go.mod.
Code changes in pkg/xpenvfuncs:
- Import paths updated to github.com/moby/moby/{client,api/types/image}
- imageInspector interface and newDockerClient var updated to use the new
ImageInspectResult return type (which embeds image.InspectResponse, so
RepoDigests access is unchanged)
- newDockerClient uses mobbyclient.New() replacing the deprecated
NewClientWithOpts+WithAPIVersionNegotiation (negotiation is now the default)
Signed-off-by: Nikolas Losse <nikolas.losse@sap.com>
Signed-off-by: Nikolas Losse <nikolas.losse@sap.com>
n-losse
force-pushed
the
add-retrieveDigest-tests
branch
from
September 30, 2026 07:53
56e2364 to
1317c13
Compare
christophrj
reviewed
Sep 30, 2026
christophrj
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @n-losse ❤️ I have only one question regarding the replacement, please see my comment.
mobyclient.New() does not read DOCKER_HOST, DOCKER_API_VERSION, DOCKER_CERT_PATH or DOCKER_TLS_VERIFY unless FromEnv is passed. WithAPIVersionNegotiation stays dropped as it is a deprecated no-op. Signed-off-by: Nikolas Losse <nikolas.losse@sap.com>
Signed-off-by: Nikolas Losse <nikolas.losse@sap.com>
christophrj
approved these changes
Sep 30, 2026
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.
Summary
retrieveDigestby extracting a narrowimageInspectorinterface and anewDockerClientvar (same stub pattern already used ininternal/docker), allowing the Docker daemon to be replaced with a fake in testsgithub.com/docker/docker v28.5.2+incompatible→github.com/moby/moby/client v0.6.0(the new standalone module); the old monorepo dep is fully removed fromgo.modmobbyclient.New()replacing the deprecatedNewClientWithOpts+WithAPIVersionNegotiation(negotiation is now the default in the new client)Why
Sec scan on repo using xp-testing got vulns in docker.
[High] Security violation: Vulnerabilities detected in docker/docker@v28.5.2
Test plan
go test ./pkg/xpenvfuncs/... -run TestRetrieveDigest— all 4 new cases passgo build ./...— compiles cleango test ./...— no regressions