Red Hat Bugzilla – Bug 1268000
sometimes two builds are started when using "add to project" from web console
Last modified: 2015-11-23 09:43:53 EST
See attached files.
Created attachment 1079140 [details]
build configuration json
Created attachment 1079141 [details]
json output of two builds
Created attachment 1079143 [details]
last 1000 lines of master's log at loglevel 5
build was was the initial build for a configchange trigger:
Oct 01 10:17:59 ose3-master.example.com openshift-master: I1001 10:17:59.145781 16062 generator.go:167] Generating Build from BuildConfig: tooz/sinatra-example, LastVersion: 0
build 2 was due to an image change trigger:
Oct 01 10:19:31 ose3-master.example.com openshift-master: I1001 10:19:31.841295 16062 generator.go:167] Generating Build from BuildConfig: tooz/sinatra-example, TriggeredBy: DockerImage/registry.access.redhat.com/openshift3/ruby-20-rhel7:latest with stream: ImageStreamTag/ruby:2.0
the question is why build 2 wasn't prevented by the logic that should be checking if we already ran a build for a given imagestreamtag. i'm guessing the imagestreamtag didn't exist at the time the configchange triggered build was created.
so initially we resolve the from reference as:
Resolved ImageStreamTag ruby:2.0 to image ea16bfe0829377fb1c0191d2953a1e104c9eb05d3691bfe9443bf6a12931fe25 with reference registry.access.redhat.com/openshift3/ruby-20-rhel7:v188.8.131.52 in namespace openshift
then we later get a trigger for:
TriggeredBy: DockerImage/registry.access.redhat.com/openshift3/ruby-20-rhel7:latest with stream: ImageStreamTag/ruby:2.0
which means the IST for ruby:2.0 changed, which doesn't make much sense to me.
when I just imported the imagestreams now, i get only:
which is what i'd expect. over to the registry team to see if they can shed some light on why we'd be seeing the IST change here.
I'm currently reworking our import code as part of . Unfortunately current implementation (as well as my PR) does not contain valuable logs, will work on adding them. I'll try to analyze the code though and figure out what might be the problem.
This is applicable only to rhel7 images, I can't reproduce the problem with centos7 counterparts. It's still relevant in current master 814c05e869d16a1252855bab7244b72989e1857c, though.
The problem is following, first execution of build saves wrong image in LastTriggeredImageID (registry.access.redhat.com/openshift3/ruby-20-rhel7:v184.108.40.206). When the imagechange trigger is fired it checks that against registry.access.redhat.com/openshift3/ruby-20-rhel7:latest to find it's different and kick another build.
The problem seems to be in  which returns wrong istag. It should return .../ruby-20-rhel7:latest but for some reason returns ruby-20-rhel7:v220.127.116.11 instead. I'm looking what is causing this.
The fix is in https://github.com/openshift/origin/pull/5495.
Commits pushed to master at https://github.com/openshift/origin
Bug 1268000 - replace Image.DockerImageReference with value from status.
Merge pull request #5495 from soltysh/bug1268000
Merged by openshift-bot
Created new app sinatra-example on web console using the latest ose env (openshift v18.104.22.1685) today,did not see two builds.
So verified this bug.