-
Couldn't load subscription status.
- Fork 62
fetch: annotate originally requested name #224
Conversation
lib/tests/v22_test.go
Outdated
| Name: *types.MustACIdentifier("variant"), | ||
| Labels: []types.Label{ | ||
| types.Label{ | ||
| *types.MustACIdentifier("arch"), |
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.
tediously, you'll need to key these to shut up govet
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.
Whoops, sloppy rebase I think.
lib/common/common.go
Outdated
| ) | ||
|
|
||
| const ( | ||
| // AppcDockerImageName is the unmodified name this image was original |
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.
originally
d4f1ccd to
61e0e70
Compare
lib/tests/v22_test.go
Outdated
| for _, ann := range manifest.Annotations { | ||
| ea, ok := expected.Annotations.Get(ann.Name.String()) | ||
| if ea == "variant" { | ||
| // Unknown value, always okay |
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.
I'm dumb, can you explain this to me?
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.
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.
|
LGTM though I don't get the tests thing. |
lib/common/common.go
Outdated
| // "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" |
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.
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?
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.
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.
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.
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.
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.
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.
61e0e70 to
0f9c437
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
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