Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli/registry/client: remove unused types, and deprecate RepoNameForReference #5882

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

thaJeztah
Copy link
Member

cli/registry/client: remove unused PutManifestOptions

This type was added in 02719bd, but was
never used;

git rev-parse --verify HEAD
02719bdbb5fb47389e47575bb006509da86df344

git grep 'PutManifestOptions'
cli/registry/client/client.go:// PutManifestOptions is the data sent to push a manifest
cli/registry/client/client.go:type PutManifestOptions struct {

This patch removes it, because it's not used.

cli/registry/client: un-export ErrHTTPProto

This type was added in 02719bd, but was
never used outside of the package itself. This patch un-exports it.

cli/registry/client: deprecate RepoNameForReference

This function was added in 02719bd, and
used newDefaultRepositoryEndpoint to get repository info for the given
image-reference.

newDefaultRepositoryEndpoint uses registry.ParseRepositoryInfo under the
hood, but the only information used from the result was the Name field,
which is set using reference.TrimNamed(name). The possible error returned
was based on the domain-name of the image, and only checked for the domain
to not start, or end with a hyphen ("-").

This patch removes the use of RepoNameForReference, deprecates it, and
inlines the code used by it.

There are no known consumers of this function, so we can consider removing
it in the first possible release after this (which can be a minor release).

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

This type was added in 02719bd, but was
never used;

    git rev-parse --verify HEAD
    02719bd

    git grep 'PutManifestOptions'
    cli/registry/client/client.go:// PutManifestOptions is the data sent to push a manifest
    cli/registry/client/client.go:type PutManifestOptions struct {

This patch removes it, because it's not used.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This type was added in 02719bd, but was
never used outside of the package itself. This patch un-exports it.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This function was added in 02719bd, and
used newDefaultRepositoryEndpoint to get repository info for the given
image-reference.

newDefaultRepositoryEndpoint uses registry.ParseRepositoryInfo under the
hood, but the only information used from the result was the Name field,
which is set using `reference.TrimNamed(name)`. The possible error returned
was based on the domain-name of the image, and only checked for the domain
to not start, or end with a hyphen ("-").

This patch removes the use of RepoNameForReference, deprecates it, and
inlines the code used by it.

There are no known consumers of this function, so we can consider removing
it in the first possible release after this (which can be a minor release).

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

codecov-commenter commented Mar 3, 2025

Codecov Report

Attention: Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 59.27%. Comparing base (43a2fcf) to head (6f46cd2).
Report is 4 commits behind head on master.

❌ Your patch status has failed because the patch coverage (25.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5882      +/-   ##
==========================================
- Coverage   59.31%   59.27%   -0.04%     
==========================================
  Files         353      353              
  Lines       29735    29726       -9     
==========================================
- Hits        17637    17620      -17     
- Misses      11117    11134      +17     
+ Partials      981      972       -9     

@thaJeztah thaJeztah requested review from vvoland and Benehiko March 4, 2025 12:29
@thaJeztah thaJeztah merged commit d962a90 into docker:master Mar 4, 2025
110 checks passed
@thaJeztah thaJeztah deleted the regclient_cleanup branch March 4, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/manifest 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