Bug 1420976 - - [platformmanagement_public_852]RreferencePolicy: Source/Local options parameters should be added to 'oc import-image' also
Summary: - [platformmanagement_public_852]RreferencePolicy: Source/Local options para...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image Registry
Version: 3.5.0
Hardware: x86_64
OS: Linux
Target Milestone: ---
: 3.6.z
Assignee: Maciej Szulik
QA Contact: Wei Sun
Depends On:
TreeView+ depends on / blocked
Reported: 2017-02-10 03:29 UTC by ge liu
Modified: 2020-08-13 08:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: Ability to set reference policy with oc import-image. Reason: Reference policy was added to oc tag and should be available on oc import-image, as well. Result: One can set reference policy using --reference-policy flag when invoking oc import-image. In case of importing all tags (--all flag being used) all tags will get passed reference policy, including overwriting already present one.
Clone Of:
Last Closed: 2017-09-08 03:15:23 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2642 0 normal SHIPPED_LIVE OpenShift Container Platform 3.6.1 bug fix and enhancement update 2017-09-08 07:14:52 UTC

Description ge liu 2017-02-10 03:29:57 UTC
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:

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
      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:

Comment 1 Michal Fojtik 2017-02-10 09:29:06 UTC
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

Comment 2 Maciej Szulik 2017-03-10 08:47:54 UTC
Fix in https://github.com/openshift/origin/pull/13339.

Comment 3 openshift-github-bot 2017-03-15 06:54:55 UTC
Commits pushed to master at https://github.com/openshift/origin

Bug 1420976 - Support passing reference-policy in import-image command

Merge pull request #13339 from soltysh/bug1420976

Merged by openshift-bot

Comment 4 ge liu 2017-03-17 02:58:06 UTC
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
      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

Comment 8 errata-xmlrpc 2017-09-08 03:15:23 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.