Skip to content

Use distribution's reference.ParseDockerRef#2986

Merged
dmcgowan merged 2 commits intocontainerd:masterfrom
thaJeztah:remove_normalize_image_ref
Feb 8, 2019
Merged

Use distribution's reference.ParseDockerRef#2986
dmcgowan merged 2 commits intocontainerd:masterfrom
thaJeztah:remove_normalize_image_ref

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Using the cri utility caused other project to have containerd/cri as a dependency, only for this utility.

The new reference.ParseDockerRef function does the same (other than having a different name).

relates to distribution/distribution#2786 and docker/cli#1561 (comment)

Using the cri utility caused other project to have
containerd/cri as a dependency, only for this utility.

The new `reference.ParseDockerRef` function does the
same (other than having a different name).

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Copy Markdown
Member Author

ping @dmcgowan @Random-Liu PTAL

I'll open a cherry-pick for the release/1.2 branch if this is accepted and merged 👍

/cc @silvin-lubecki

@thaJeztah
Copy link
Copy Markdown
Member Author

could someone restart travis-ci? Don't think it should be related to my changes (stalled at the vendor step)

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -69,7 +69,7 @@ func isImagePrefix(s, prefix string) bool {

func normalizeReference(ref string) (string, error) {
// TODO: Replace this function to not depend on reference package
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this comment makes us not want to depend on this package?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Confusing given that the CRI utility function definitely depends on the reference package as well. @dmcgowan ?

Copy link
Copy Markdown
Member Author

@thaJeztah thaJeztah Feb 7, 2019

Choose a reason for hiding this comment

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

Yes, this is not the "final state" of this I guess, but this was at least a step to prevent introducing get rid of an additional dependency in the CLI.

From distribution/distribution#2786 (comment)

Just as a note, I want to split the reference package out of this repository and explicitly have a Docker referencing package for all projects to use which make use of this referencing logic. Ironically this reference package is least useful to this repository since the reference format used by the registry can be vastly simplified as a superset of what Docker uses. I don't have time to refactor this, but it is not harmful to have this functionality along side all the other Docker-specific normalization functions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I still agree with this comment, but I also agree with @thaJeztah about cutting out the middleman dependency. This makes it much more clear where we need to replace this functionality, in both CRI and containerd.

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #2986 into master will increase coverage by 2.78%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2986      +/-   ##
==========================================
+ Coverage   41.18%   43.96%   +2.78%     
==========================================
  Files          71      102      +31     
  Lines        9531    10881    +1350     
==========================================
+ Hits         3925     4784     +859     
- Misses       5044     5362     +318     
- Partials      562      735     +173
Flag Coverage Δ
#linux 47.58% <ø> (?)
#windows 41.18% <ø> (ø) ⬆️
Impacted Files Coverage Δ
mount/temp_unix.go 0% <0%> (ø)
sys/reaper_linux.go 0% <0%> (ø)
services/server/server_linux.go 0% <0%> (ø)
sys/env.go 100% <0%> (ø)
sys/stat_unix.go 0% <0%> (ø)
runtime/v2/shim/shim_unix.go 0% <0%> (ø)
sys/reaper.go 0% <0%> (ø)
sys/fds.go 0% <0%> (ø)
runtime/v2/shim/reaper_unix.go 0% <0%> (ø)
sys/proc.go 0% <0%> (ø)
... and 27 more

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 0b89d42...525802f. Read the comment docs.

@dmcgowan
Copy link
Copy Markdown
Member

dmcgowan commented Feb 8, 2019

LGTM

@dmcgowan dmcgowan merged commit 4543e32 into containerd:master Feb 8, 2019
@thaJeztah thaJeztah deleted the remove_normalize_image_ref branch February 8, 2019 15:05
@SvenDowideit SvenDowideit mentioned this pull request Mar 7, 2019
16 tasks
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.

5 participants