{"action":"closed","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/5481","labels_url":"https://api.github.com/repos/openshift/origin/issues/5481/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/5481/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/5481/events","html_url":"https://github.com/openshift/origin/issues/5481","id":114002603,"number":5481,"title":"Proposal to add DockerImageReference to ImageStreamTag","user":{"login":"soltysh","id":576341,"avatar_url":"https://avatars.githubusercontent.com/u/576341?v=3","gravatar_id":"","url":"https://api.github.com/users/soltysh","html_url":"https://github.com/soltysh","followers_url":"https://api.github.com/users/soltysh/followers","following_url":"https://api.github.com/users/soltysh/following{/other_user}","gists_url":"https://api.github.com/users/soltysh/gists{/gist_id}","starred_url":"https://api.github.com/users/soltysh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soltysh/subscriptions","organizations_url":"https://api.github.com/users/soltysh/orgs","repos_url":"https://api.github.com/users/soltysh/repos","events_url":"https://api.github.com/users/soltysh/events{/privacy}","received_events_url":"https://api.github.com/users/soltysh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openshift/origin/labels/priority/P2","name":"priority/P2","color":"fbca04"}],"state":"closed","locked":false,"assignee":{"login":"soltysh","id":576341,"avatar_url":"https://avatars.githubusercontent.com/u/576341?v=3","gravatar_id":"","url":"https://api.github.com/users/soltysh","html_url":"https://github.com/soltysh","followers_url":"https://api.github.com/users/soltysh/followers","following_url":"https://api.github.com/users/soltysh/following{/other_user}","gists_url":"https://api.github.com/users/soltysh/gists{/gist_id}","starred_url":"https://api.github.com/users/soltysh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soltysh/subscriptions","organizations_url":"https://api.github.com/users/soltysh/orgs","repos_url":"https://api.github.com/users/soltysh/repos","events_url":"https://api.github.com/users/soltysh/events{/privacy}","received_events_url":"https://api.github.com/users/soltysh/received_events","type":"User","site_admin":false},"milestone":null,"comments":15,"created_at":"2015-10-29T08:35:27Z","updated_at":"2015-11-02T13:39:30Z","closed_at":"2015-11-02T13:39:30Z","body":"This idea came from tackling https://bugzilla.redhat.com/show_bug.cgi?id=1268000. The general flow is as follows: \r\n1. Image import controller imports images in non-deterministic order, which for v1 registries with multiple tags pointing to the same id means, that the first seen image will be imported, all the others will always point to this one. This also means that the `Image.DockerImageReference` will always point to that first imported image.\r\n2. First build occurs, triggered by ConfigChange trigger, this build saves the `DockerImageReference` returned from `Image.DockerImageReference` (`GetImageStreamTag` call in `generator.go`).\r\n3. ImageChange controller notices change to ruby:2.0 image, resolves that, but since it's reading straight from stream, it uses `LatestTaggedImage(stream, tag)` which returns `TagEvent` which has `DockerImageReference` that might be different from `Image.DockerImageReference` from 1 and might sometimes trigger the 2nd build. Usually the `DockerImageReference` in `TagEvent` is similar to what was specified in image spec.\r\n\r\nThere are two solutions to this problem:\r\n1. Rework `resolveImageStreamReference` so that for `ImageStreamTag` it reads the stream and then uses `LatestTaggedImage(stream, tag)` to get the same value we do in ImageChange controller (step 3).\r\n2. Extend `ImageStreamTag` with `DockerImageReference`, especially that under the cover (see [imagestreamtag.Get](https://github.com/openshift/origin/blob/master/pkg/image/registry/imagestreamtag/rest.go#L64) is using `LatestTaggedImage(stream, tag)` and has that information.\r\n\r\nMy preference, as the title points to, is no 2. Because this will also fix the problem of getting proper information when doing `oc get istag/ruby:2.0`. Additionally we'll have consistent behavior all over the places. The former solution is a quick fix for this particular place and not the whole problem. When I was talking to @ncdc he also mentioned removing (or at least trying to) `Image.DockerImageReference` field, which the latter could help with. This would also allow better address the problem in #5391 where we return 404 for tags that are references. We could return empty image, but still provide valid metadata information about it.\r\n\r\n@miminar @ncdc @bparees @smarterclayton opinions?"}}