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

[release/2.7 backport] Add reference.ParseDockerRef utility function #3002

Merged

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Sep 4, 2019

backport of #2786 for the release/2.7 branch
to address containerd/containerd#3031 if included in a 2.7.x patch release

ParseDockerRef normalizes the image reference following the docker
convention. This is added mainly for backward compatibility. The reference
returned can only be either tagged or digested. For reference contains both tag
and digest, the function returns digested reference, e.g.

docker.io/library/busybox:latest@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa

will be returned as

docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa.

@thaJeztah
Copy link
Member Author

@dmcgowan @caervs - no idea if there's plans to do a 2.7.2 release, but thought I'd open a backport (in case there are plans)

Copy link
Contributor

@caervs caervs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @thaJeztah! LGTM.

@thaJeztah
Copy link
Member Author

ping @dmcgowan PTAL

ParseDockerRef normalizes the image reference following the docker
convention. This is added mainly for backward compatibility. The reference
returned can only be either tagged or digested. For reference contains both tag
and digest, the function returns digested reference, e.g.

    docker.io/library/busybox:latest@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa

will be returned as

    docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0ac367f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the 2.7_backport_add_normalize_util branch from ad4fa05 to fad36ed Compare December 20, 2019 12:50
@thaJeztah
Copy link
Member Author

rebased to make the vendor-check pass (which should be fixed by #3001)

@codecov
Copy link

codecov bot commented Dec 20, 2019

Codecov Report

Merging #3002 into release/2.7 will increase coverage by 0.13%.
The diff coverage is 57.14%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release/2.7    #3002      +/-   ##
===============================================
+ Coverage        60.25%   60.38%   +0.13%     
===============================================
  Files              103      103              
  Lines             8024     8038      +14     
===============================================
+ Hits              4835     4854      +19     
+ Misses            2546     2537       -9     
- Partials           643      647       +4
Flag Coverage Δ
#linux 60.38% <57.14%> (+0.13%) ⬆️
Impacted Files Coverage Δ
reference/normalize.go 82.02% <57.14%> (+2.02%) ⬆️
reference/helpers.go 89.47% <0%> (+31.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfd1309...fad36ed. Read the comment docs.

@thaJeztah
Copy link
Member Author

ping @dmcgowan @manishtomar @stevvooe PTAL

@thaJeztah thaJeztah added this to the Registry/2.7.2 milestone Jan 28, 2020
@dmcgowan
Copy link
Collaborator

LGTM

@dmcgowan dmcgowan merged commit be75da0 into distribution:release/2.7 Feb 21, 2020
@thaJeztah thaJeztah deleted the 2.7_backport_add_normalize_util branch February 21, 2020 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants