Skip to content

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Sep 26, 2025

cli/trust: Server: accept registry hostname

The IndexInfo was only used to detect if the target was an official
image, which we can deduct from the hostname. Adding some normalizing
just in case (but we should only get "docker.io" here).

cli/command/image: notaryClientProvider: don't require arguments

This interface is used in tests to provide a dummy notary client,
but none of the tests require any arguments, so let's remove them.

cli/command/image: imagePullPrivileged: don't use ImageRefAndAuth

This function is a wrapper around apiClient.ImagePull; the use of
trust.ImageRefAndAuth was out of convenience because it's also called
when using content trust (through the trustedPull utility).

Let's pull away the layers to separate it from trust code.

cli/command/image: imagePullPrivileged: move to non-trust file

This function is a wrapper around apiClient.ImagePull and not directly
related to docker content trust; it just happens to also be called
when using content trust (through the trustedPull utility).

Move it together with the runPull function to separate it from
trust-related code.

The IndexInfo was only used to detect if the target was an official
image, which we can deduct from the hostname. Adding some normalizing
just in case (but we should only get "docker.io" here).

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added this to the 29.0.0 milestone Sep 26, 2025
@thaJeztah thaJeztah added status/2-code-review area/trust kind/refactor PR's that refactor, or clean-up code labels Sep 26, 2025
@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 55.00000% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/command/image/pull.go 68.18% 4 Missing and 3 partials ⚠️
internal/test/notary/client.go 0.00% 5 Missing ⚠️
cli/command/image/trust.go 50.00% 3 Missing ⚠️
internal/test/cli.go 0.00% 2 Missing ⚠️
cli/trust/trust.go 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@thaJeztah thaJeztah force-pushed the less_trust branch 4 times, most recently from c97216b to f45dab0 Compare September 26, 2025 17:50
This interface is used in tests to provide a dummy notary client,
but none of the tests require any arguments, so let's remove them.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This function is a wrapper around apiClient.ImagePull; the use of
trust.ImageRefAndAuth was out of convenience because it's also called
when using content trust (through the trustedPull utility).

Let's pull away the layers to separate it from trust code.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This function is a wrapper around apiClient.ImagePull and not directly
related to docker content trust; it just happens to also be called
when using content trust (through the trustedPull utility).

Move it together with the `runPull` function to separate it from
trust-related code.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah marked this pull request as ready for review September 26, 2025 18:39
@austinvazquez austinvazquez merged commit 1b467f9 into docker:master Sep 29, 2025
86 checks passed
@thaJeztah thaJeztah deleted the less_trust branch September 30, 2025 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/trust kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants