Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 14, 2020. It is now read-only.

Conversation

@euank
Copy link
Contributor

@euank euank commented Nov 4, 2016

Currently, there's no lossless way to actually recover this information.

e.g. if the user fetches: nginx:latest vs library/nginx:latest, the two
outputs are identical.

This provides a way to recover that input.

cc @lucab

Name: *types.MustACIdentifier("variant"),
Labels: []types.Label{
types.Label{
*types.MustACIdentifier("arch"),
Copy link
Contributor

Choose a reason for hiding this comment

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

tediously, you'll need to key these to shut up govet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, sloppy rebase I think.

)

const (
// AppcDockerImageName is the unmodified name this image was original
Copy link
Contributor

Choose a reason for hiding this comment

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

originally

@euank euank force-pushed the annotate-pull-name branch 2 times, most recently from d4f1ccd to 61e0e70 Compare November 4, 2016 19:09
for _, ann := range manifest.Annotations {
ea, ok := expected.Annotations.Get(ann.Name.String())
if ea == "variant" {
// Unknown value, always okay
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm dumb, can you explain this to me?

Copy link
Contributor Author

@euank euank Nov 7, 2016

Choose a reason for hiding this comment

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

Before, it only asserted on a subset of values (which didn't include appc.io/docker/imageid.. probably because the test image generated doesn't appear to be idempotent so this varies per test.

The expected value is set to this arbitrary value to skip asserting on it. Alternatives would be to set the expected annotation from the real aci before comparing, but that seems like a slightly less obvious and reusable cheat.

@jonboulle
Copy link
Contributor

LGTM though I don't get the tests thing.

// "quay.io/user/image:latest" This is identical in most cases to
// 'registryurl/repository:tag' but will differ for the Dockerhub registry or
// if the tag was inferred as latest.
AppcDockerImageName = "appc.io/docker/imagename"
Copy link
Contributor

Choose a reason for hiding this comment

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

I find this a bit confusing, as we already use ImageName for something else as a field name. Can we mirror more closely the RawName field name here?

Copy link
Contributor Author

@euank euank Nov 7, 2016

Choose a reason for hiding this comment

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

rawname seems less clear, but I agree it's confusing. What about pulled-name? Something else? With pulled-name I'd rename the struct field too.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm open to whatever renaming you think fits here, as long as it can be used consistently in consumer code and we don't step into existing names. I'm non-native, so some of those may be a bit off, but here are some possibilities: originalname, externalname, intialname, nativename or such.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I picked appc.io/docker/originalname. Thanks for the suggestions!

Currently, there's no lossless way to actually recover this information.

e.g. if the user fetches: nginx:latest vs library/nginx:latest, the two
outputs are identical.

This provides a way to recover that input.
Copy link
Contributor

@lucab lucab left a comment

Choose a reason for hiding this comment

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

LGTM

@lucab lucab merged commit f0e70f6 into appc:master Nov 8, 2016
@lucab lucab mentioned this pull request Nov 8, 2016
@lucab lucab added this to the 0.14.0 milestone Nov 8, 2016
@euank euank deleted the annotate-pull-name branch November 8, 2016 18:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants