Repository navigation
Bug 1277046 - fixed tagging ImageStreamImage - #5931
Conversation
|
does this change the output of the API? can you give a before/after sample output? |
|
@liggitt this doesn't have any UI changes |
There was a problem hiding this comment.
Why is ResolveImageID not sufficient? If resolveImageID is not sufficient, add a new method in api that provides it, don't create new code here.
There was a problem hiding this comment.
We need to pull spec, which ResolveImageID doesn't provide.
There was a problem hiding this comment.
Create a new method in api/helpers.go that does this - no ugly propagation of util code outside of api.
There was a problem hiding this comment.
Since this is almost identical to ResolveImageID method, I'll just extend that method with that parameter? Does it make sense? I'm somehow reluctant in duplicating this code, so I agree with you entirely.
There was a problem hiding this comment.
ResolveImageID is only used in 2 places currently: here, and in imagestreamimage/rest.go. We know what it's used for here. In rest.go, we use it to get the image ID (sha256:...), which we then use to get the actual Image (which obviously assumes that the image has been imported into etcd).
Let's see if there's a way to modify this method to suit both purposes...
There was a problem hiding this comment.
Actually both of these places expect single result, others (0 or 2+) are interpreted as errors. What if ResolveImageID would actually return the tagevent rather than just the ID, it does now? Additionally returning error, but since rest.go needs distinction between 0 and 2+, we could return NotFound and Conflict errors appropriately, wdyt?
There was a problem hiding this comment.
I had that thought as well. One question I have is about the errors - we use fmt.Errorf in one place vs specific error types in the other. If we can resolve what to do about that, +1 for this.
There was a problem hiding this comment.
Cool, I'll rework this part. I don't worry about errors, the method will return specialized errors and it'll be caller decision what to do about them.
|
still not clear, does this change the output of the API? |
|
No output changes. Without this change, you get this, which has an incorrect status:
tags:
- items:
- created: 2015-11-13T18:40:31Z
dockerImageReference: 172.30.138.254:5000/default/recreate-example@sha256:1318f08b141aa6a4cdca8c09fe8754b6c9f7802f8fc24e4e39ebf93e9d58472b
image: sha256:1318f08b141aa6a4cdca8c09fe8754b6c9f7802f8fc24e4e39ebf93e9d58472b
tag: whateverWith this change, you get this: status:
tags:
- items:
- created: 2015-11-13T18:40:31Z
dockerImageReference: openshift/deployment-example@sha256:1318f08b141aa6a4cdca8c09fe8754b6c9f7802f8fc24e4e39ebf93e9d58472b
image: sha256:1318f08b141aa6a4cdca8c09fe8754b6c9f7802f8fc24e4e39ebf93e9d58472b
tag: whatever |
|
I'm pretty sure the UI is using the resolved dockerImageReference to correlate an image with a container. @jwforres can confirm or correct |
|
This change makes it so the resolved |
|
In other words, without this fix, you'll never be able to start a container that has |
|
I thought container |
|
That is correct for builds/deployments. But the pull spec is still invalid with the specific use case this PR is fixing (see the bz) |
|
I still am having a hard time understanding how the unresolved pull spec is correct output. Will container images also change to use that format? |
|
talked on IRC. to clarify, this PR should only affect the output |
|
Correct |
|
I've refactored |
|
We don't create new tag (although methods returns new TagEvent object), but rather returning information about a tag. That's why I'll stay with current naming. The formatting was fixed, from what I see we have gofmt check disabled for go1.5. I'll create a separate PR to address that problem, though. |
|
I've also checked that the methods using |
|
[test] |
to point to original pull spec instead of the internal registry.
|
@ncdc fixed |
|
LGTM |
|
re-[test] and if it's green I'll merge this upon getting approval. |
|
I got strange flake in re-[test] |
|
Evaluated for origin test up to 1b71e4e |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/7347/) |
|
That's what I was waiting for. [merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/4112/) (Image: devenv-rhel7_2779) |
|
Evaluated for origin merge up to 1b71e4e |
Merged by openshift-bot
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1277046.
The general take-away is we were unnecessarily expanding docker spec to point to internal registry, instead of pointing to the pull spec from the tag which is the source of the new tag.
@miminar ptal
@ncdc fyi