Description of problem: this bug's background is: https://bugzilla.redhat.com/show_bug.cgi?id=1412050, regarding to this card: an image stream author request that build config and deployment config change triggers use pullthrough (by specifying the Local TagReferencePolicyType, the bug:1412050 add the --reference-policy to command 'oc tag', but missed to add it to 'oc import-image'. Version-Release number of selected component (if applicable): # openshift version openshift v1.5.0-alpha.2+98ad752-493 kubernetes v1.5.2+43a9be4 etcd 3.1.0 How reproducible: always Steps to Reproduce: 1. #oc import-image --confirm --from=centos/ruby-22-centos7 ruby-22-centos7:latest 2. #oc get is ruby-22-centos7 -o yaml .......... referencePolicy: type: Source ..... 3. #oc new-build --image-stream=ruby-22-centos7 https://github.com/openshift/ruby-ex.git 4. # oc get bc ruby-ex -o yaml ................ lastTriggeredImageID: centos/ruby-22-centos7@sha256:460730627b1c32c10368aa754e7075e447394b76c5a213a819a11297000edd2d ..... Actual results: 'oc import-image' havent't option '--reference-policy' Expected results: 'oc import-image' should support option '--reference-policy' Additional info:
For 1.5, you can use `oc tag` to change the reference policy, the import-image is far more complex (as it have to be plumbed via REST API). I'm moving to as RFE to upcoming release and we will deal with this for 1.6
Fix in https://github.com/openshift/origin/pull/13339.
Commits pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/aa80c856a9244dd624c9829c14238231c8410d2d Bug 1420976 - Support passing reference-policy in import-image command https://github.com/openshift/origin/commit/0009bfa6972b0c17f405a3c53b8965456a9cdbdc Merge pull request #13339 from soltysh/bug1420976 Merged by openshift-bot
Verified in origin env: openshift v1.5.0-alpha.3+9be07d7-397 kubernetes v1.5.2+43a9be4 etcd 3.1.0 # oc import-image --confirm --from=centos/ruby-22-centos7 ruby-22-centos7:latest --reference-policy='source' The import completed successfully. ............ # oc get is ruby-22-centos7 -o yaml apiVersion: v1 ....... referencePolicy: type: Source ..... # oc get bc ruby-ex -o yaml - imageChange: lastTriggeredImageID: centos/ruby-22-centos7@sha256:9182cb1502d5967bbc727488586ee4b52da9d509f0d7d01bf14c3fb2faa39c43 # oc import-image --confirm --from=centos/ruby-22-centos7 ruby-22-centos7:latest --reference-policy='local' The import completed successfully. ............. # oc get is ruby-22-centos7 -o yaml .............. - imageChange: lastTriggeredImageID: 172.x.78.x:5000/lgproj/ruby-22-centos7@sha256:9182cb1502d5967bbc727488586ee4b52da9d509f0d7d01bf14c3fb2faa39c43 type: ImageChange .................
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2642