-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add reference. ParseDockerRef utility function #2786
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
Conversation
|
ping @dmcgowan @Random-Liu PTAL (I'm open to better suggestions if we don't want to add this utility here) |
1cd766c to
1051a2c
Compare
09ff6ed to
0f3ff4a
Compare
|
Updated; also slightly rewrite the test to use subtests. PTAL |
Codecov Report
@@ Coverage Diff @@
## master #2786 +/- ##
==========================================
+ Coverage 60.24% 60.37% +0.13%
==========================================
Files 103 103
Lines 8022 8036 +14
==========================================
+ Hits 4833 4852 +19
+ Misses 2546 2537 -9
- Partials 643 647 +4
Continue to review full report at Codecov.
|
0f3ff4a to
6719dac
Compare
|
@dmcgowan nudge 🤗 |
|
LGTM after small typo fix in test |
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 <[email protected]>
6719dac to
0ac367f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This copies the
NormalizeImageRefutility function that was added in containerd/cri https://github.com/containerd/cri/blob/0e42438e7a157f6aec41cd808a85bc883d646ff3/pkg/util/image.go#L23-L50Reason for this PR is that starting with containerd/containerd@bce20b7 (containerd/containerd#2633), containerd now adds containerd/cri as a new dependency when vendoring in docker/cli (because of this utility which is mainly a small wrapper for other functions in docker/distribution);
If this patch is accepted, I'll open a PR in containerd/cri to remove the utility there.
ParseDockerRefnormalizes the image reference following the dockerconvention. 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.
will be returned as