Bug 1412029
Summary: | [platformmanagement_public_852 ] Image streams usage(:referencePolicy=Local) doesn't work for build config triggers | ||
---|---|---|---|
Product: | OKD | Reporter: | ge liu <geliu> |
Component: | Build | Assignee: | Michal Fojtik <mfojtik> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Wang Haoran <haowang> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.x | CC: | aos-bugs, bparees, mfojtik |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-05-30 12:51:18 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
ge liu
2017-01-11 02:26:19 UTC
Ben: The BuildConfig Trigger should use the same mechanism for resolving the images as deployment config. Michal, all we do is ask the imagestreamtag for the current imagereference. Why is it not returning a local reference if that's the expected behavior? Can you point to the "correct" resolution code? The problem is basically that the resolveImageStreamReference() that sets the LastTriggeredImageID is not using the ResolveLatestTaggedImage() which was already plumbed to deal with reference policy... That said, the resolveImageStreamReference() just sets the DockerImageReference from the image (which does not take into account the reference policy). To fix this, we should have helpers to handle ImageStreamTag and ImageStreamImage as well (ResolveLatestTaggedImage() just resolves the IS), and then plumb the resolveImageStreamReference() to use this helpers. verified on env: openshift v1.5.0-alpha.2+71a4378-423 kubernetes v1.5.2+43a9be4 etcd 3.1.0 1).# oc import-image --confirm --from=centos/ruby-22-centos7 ruby-22-centos7:latest The import completed successfully. 2).# oc edit is ruby-22-centos7 change the referencePolicy: ‘type: Source‘ to ‘type: Local‘ 3).#oc new-build --image-stream=ruby-22-centos7 https://github.com/openshift/ruby-ex.git 4).# oc get bc ruby-ex -o json: "imageChange": { "lastTriggeredImageID": "172.xx.xx.xx:5000/lgproj/ruby-22-centos7@sha256:460730627b1c32c10368aa754e7075e447394b76c5a213a819a11297000edd2d" |