Bug 1373332 - [atomic registry]When creating "Pull specific tags from another image repository" image streams will pull all tags
Summary: [atomic registry]When creating "Pull specific tags from another image reposit...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Registry Console
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.11.0
Assignee: Martin Pitt
QA Contact: Yanping Zhang
URL: https://github.com/cockpit-project/co...
Whiteboard:
Depends On:
Blocks: 1512440
TreeView+ depends on / blocked
 
Reported: 2016-09-06 03:06 UTC by Yadan Pei
Modified: 2018-10-11 07:19 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-10-11 07:19:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2652 0 None None None 2018-10-11 07:19:41 UTC

Description Yadan Pei 2016-09-06 03:06:30 UTC
Description of problem:
When create a image stream and set "Pull specific tags from another image repository", finally it will pull all tags of this image

Version-Release number of selected component (if applicable):
openshift3/registry-console:3.3

How reproducible:
Always

Steps to Reproduce:
1.Login to registry-console and create a new project "test"
2.Click "New image stream" on Overview 
3.Set following values 
Name: test-pull-specific-tag
Project: select "test" project from list
Populate: select "Pull specific tags from another image repository"
Pull from: docker.io/yapei/ruby-20-rhel7
Tags: user1001
4. Hit on "Create"
5. Check image streams info on Overview page
6. Check image streams info on Images page


Actual results:
5. All tags(onbuild-user0,user0,user1001,userdefault) about container image docker.io/yapei/ruby-20-rhel7 were imported
6. 4 tags are listed for image stream "test-pull-specific-tag"

Expected results:
5,6 Should only pull tag :user1001 from container image yapei/ruby-20-rhel7

Additional info:

Comment 2 Martin Pitt 2017-04-27 13:08:25 UTC
Confirming this bug on latest Cockpit 139. I wrote some tests to cover image stream import, https://github.com/cockpit-project/cockpit/pull/6398 contains a reproducer.

Comment 3 Martin Pitt 2017-05-03 15:32:53 UTC
I'm afraid this is at least a documentation, if not a functional bug in Openshift itself. Cockpit is more or less doing this, assuming that you have a project called "marmalade":

$ cat <<EOF | oc create -f - -n marmalade
{   
    "apiVersion": "v1",
    "kind": "ImageStream",
    "metadata": {
        "name": "test"
    },
    "spec": {
        "dockerImageRepository": "docker.io/prom/busybox",
        "tags": [ { "name": "latest" } ]
    }
}
EOF

But this  pulls in all tags, in particularly also the "glibc" tag:

$ oc get imagestreams -n marmalade

NAME      DOCKER REPO                           TAGS                         UPDATED
test      docker.io/prom/busybox                latest,glibc                 2 minutes ago

I also tried the "full" syntax from https://docs.openshift.com/enterprise/3.0/architecture/core_concepts/builds_and_image_streams.html#tag-tracking:

   "spec": {
        "dockerImageRepository": "docker.io/prom/busybox",
        "tags": [ { "name": "latest", "from": { "kind": "ImageStreamTag", "name": "latest" } } ]
    }

with the same result.

Use this to clean up after each iteration:

oc delete image $(oc get images -n marmalade|grep prom | awk '{print $1}')
oc delete imagestream test -n marmalade

https://docs.openshift.com/enterprise/3.0/architecture/infrastructure_components/image_registry.html is another relevant page, but it doesn't talk about tag import at all.

So I'm afraid importing only a given (set of) tags is not actually working properly, or Cockpit creates the wrong JSON for this. Can Openshift developers weigh in here, please?

Comment 4 Ian McLeod 2017-07-03 17:28:15 UTC
This has been perpetually bumped.  I've no reason to think this should actually block release.  Changing severity to low.  Feel free to push back if needed, but I'm trying to get things in order for 3.6.

Also adding a NEEDINFO for Paul based on Martin's Comment 3 - since it looks as Cockpit really does need some OpenShift specific guidance to move forward on this.

Paul, feel free to bounce the NEEDINFO to whomever you think can help.

Comment 6 Martin Pitt 2018-03-05 21:33:02 UTC
As long as OpenShift does not provide an API to actually do this, there's nothing we can do on the Cockpit side. So the needsinfo still stands, and moving to 3.10.

Comment 7 Martin Pitt 2018-06-05 14:29:45 UTC
Moving component, as this is *still* not supported in the OpenShift API. Once it does, we can use bug 1512440 to track the cockpit side.

Comment 8 Ben Parees 2018-06-05 14:54:33 UTC
If you want to import a specific tag, then you do not specify dockerImageRepository.  The syntax for importing specific tags looks like this:


https://github.com/openshift/library/blob/master/community/wildfly/imagestreams/wildfly-centos7.json#L42-L45

Martin, I am not entirely clear on what the issue is here, does that api enable you to do what is being asked here?

Marking 3.11 for the moment as this is not a blocker, but more likely it will turn into an RFE if my above suggestion is not sufficient.

Comment 9 Martin Pitt 2018-06-08 08:00:51 UTC
Thanks Ben! I'll try that syntax ASAP and report back here.

Would be nice to describe this in https://docs.openshift.com/enterprise/latest/architecture/core_concepts/builds_and_image_streams.html, as it's really not obvious.

Comment 10 Ben Parees 2018-06-08 15:31:49 UTC
Martin, fixing the docs here: https://github.com/openshift/openshift-docs/pull/9923

Comment 11 Ben Parees 2018-06-13 21:28:11 UTC
Any luck, Martin?

Comment 12 Martin Pitt 2018-06-15 09:54:15 UTC
Indeed it does help. With this JSON:

{   
    "apiVersion": "v1",
    "kind": "ImageStream",
    "metadata": {
        "name": "test"
    },
    "spec": {
        "tags": [
            { "name": "glibc",
              "from": { "kind": "DockerImage", "name": "docker.io/prom/busybox:glibc" }
            }
        ]
    }
}

it works as expected:

test      172.30.88.58:5000/marmalade/test      glibc                        About a minute ago

So "all tags" and "some tags" have quite a different syntax. I reassign this back to Cockpit, and will work on using that.

Thank you!

Comment 13 Martin Pitt 2018-07-31 08:40:32 UTC
This is being fixed in https://github.com/cockpit-project/cockpit/pull/9682

Comment 15 Yanping Zhang 2018-08-24 02:18:18 UTC
# oc rsh registry-console-1-fv5xv rpm -qa|grep cockpit
cockpit-bridge-155-1.el7.x86_64
cockpit-kubernetes-155-1.el7.x86_64
cockpit-ws-155-1.el7.x86_64
cockpit-dashboard-172-2.el7.x86_64
cockpit-system-155-1.el7.noarch

openshift v3.11.0-0.20.0
kubernetes v1.11.0+d4cacc0

Checked on OCP v3.11.0-0.20.0, there is no new cockpit package, and the bug still exists.

Comment 17 Yadan Pei 2018-09-10 03:04:12 UTC
Verification steps:

When creatint ImageStream, set following parameters:
Populate: Pull specific tags from another image repository
Pull from: docker.io/yapei/ruby-20-rhel7
Tags: user1001,user0

Only specified tags will be pulled down.

Verified on openshift v3.11.0-0.32.0 and cockpit 176

# oc rsh -n default registry-console-1-v5pqm
sh-4.2$ rpm -qa | grep cockpit
cockpit-bridge-176-2.el7.x86_64
cockpit-kubernetes-176-2.el7.x86_64
cockpit-ws-176-2.el7.x86_64
cockpit-dashboard-176-2.el7.x86_64
cockpit-system-176-2.el7.noarch

Comment 19 errata-xmlrpc 2018-10-11 07:19:06 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.

https://access.redhat.com/errata/RHBA-2018:2652


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