Skip to content

selfLink returned from ImageStreamImage and ImageStreamTag calls is not a valid link #1701

Closed

Description

@jwforres

It returns a URL like:

/osapi/v1beta1/imageStreamImages/b85d88371cd9f8189637e57d65844dc57547360f6aadf8b5bdd46a6e5b288505?namespace=

Which can't be retrieved because imageStreamImages expects the name to be @

Activity

  1. changed the title [-]selfLink returned from ImageStreamImage calls is not a valid link[/-] [+]selfLink returned from ImageStreamImage and ImageStreamTag calls is not a valid link[/+] on Apr 10, 2015
  2. ncdc commented on Apr 10, 2015

    @ncdc
    Contributor

    I think this comes from upstream. After we return the object in question (in this case, an image), I believe control goes to https://github.com/openshift/origin/blob/master/Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver/resthandler.go#L99, where it calls https://github.com/openshift/origin/blob/master/Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver/resthandler.go#L519-L521. I'm not familiar enough with this code at the moment to know if there's a way to override. Maybe instead of returning imageapi.Image we can just return ImageStreamTag or ImageStreamImage as appropriate, since they already embed Image. That would probably fix it, as well as making Kind and Name have the values you'd expect.

  3. ncdc commented on Apr 10, 2015

    @ncdc
    Contributor

    @smarterclayton thoughts?

  4. smarterclayton commented on Apr 13, 2015

    @smarterclayton
    Contributor

    We should be returning image stream tag and image stream image.

  5. jwforres commented on Apr 13, 2015

    @jwforres
    MemberAuthor

    @ncdc how much will this affect the response, other than kind/name?

  6. ncdc commented on Apr 13, 2015

    @ncdc
    Contributor

    @jwforres it shouldn't affect it at all; my plan is to set the embedded Image to inline the json.

  7. ncdc commented on Apr 13, 2015

    @ncdc
    Contributor

    Is this acceptable for ImageStreamTag? Note that it still returns what is actually an Image, but the kind is ImageStreamTag, and the metadata has name=busybox:latest and selfLink=/osapi/v1beta1/imageStreamTags/busybox:latest?namespace=p1. The contents of the image may change over time, but the name and selfLink will always stay the same.

    $ osc get -n p1 istag busybox:latest -o yaml
    
    apiVersion: v1beta1
    dockerImageMetadata:
      Architecture: amd64
      Author: "Jérôme Petazzoni <[email protected]>"
      Config:
        Cmd:
        - /bin/sh
        Env:
        - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        Hostname: 7f674915980d
        Image: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2
      Container: 83dcf36ad1042b90f4ea8b2ebb60e61b2f1a451a883e04b388be299ad382b259
      ContainerConfig:
        Cmd:
        - /bin/sh
        - -c
        - '#(nop) CMD [/bin/sh]'
        Env:
        - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        Hostname: 7f674915980d
        Image: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2
      Created: 2014-12-31T22:23:56Z
      DockerVersion: 1.4.1
      Id: 4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125
      Parent: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2
      apiVersion: "1.0"
      kind: DockerImage
    dockerImageMetadataVersion: "1.0"
    dockerImageReference: 172.30.221.126:5000/p1/busybox@sha256:05e90a5daafdca2a6508cde51651b19ca541d79f68d675a864b6cc745e54983c
    kind: ImageStreamTag
    metadata:
      creationTimestamp: 2015-04-10T20:14:01Z
      name: busybox:latest
      namespace: p1
      resourceVersion: "3130"
      selfLink: /osapi/v1beta1/imageStreamTags/busybox:latest?namespace=p1
      uid: 20bba079-dfbe-11e4-b304-001c422dcd49
  8. jwforres commented on Apr 13, 2015

    @jwforres
    MemberAuthor

    Yeah that is what I would expect for ImageStreamTag. ImageStreamImage I
    would not expect to change since it should be pointing to a specific image.

    On 04/13/2015 10:46 AM, Andy Goldstein wrote:

    Is this acceptable for |ImageStreamTag|? Note that it still returns
    what is actually an |Image|, but the |kind| is |ImageStreamTag|, and
    the metadata has |name=busybox:latest| and
    |selfLink=/osapi/v1beta1/imageStreamTags/busybox:latest?namespace=p1|.
    The contents of the image may change over time, but the |name| and
    |selfLink| will always stay the same.

    |$ osc get -n p1 istag busybox:latest -o yaml
    |
    apiVersion: v1beta1
    dockerImageMetadata:
    Architecture: amd64
    Author: "Jérôme Petazzoni [email protected]"
    Config:
    Cmd:
    -/bin/sh
    Env:
    -PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    Hostname: 7f674915980d
    Image: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2
    Container: 83dcf36ad1042b90f4ea8b2ebb60e61b2f1a451a883e04b388be299ad382b259
    ContainerConfig:
    Cmd:
    -/bin/sh
    --c
    -'#(nop) CMD [/bin/sh]'
    Env:
    -PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    Hostname: 7f674915980d
    Image: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2
    Created: 2014-12-31T22:23:56Z
    DockerVersion: 1.4.1
    Id: 4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125
    Parent: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2
    apiVersion: "1.0"
    kind: DockerImage
    dockerImageMetadataVersion: "1.0"
    dockerImageReference: 172.30.221.126:5000/p1/busybox@sha256:05e90a5daafdca2a6508cde51651b19ca541d79f68d675a864b6cc745e54983c
    kind: ImageStreamTag
    metadata:
    creationTimestamp: 2015-04-10T20:14:01Z
    name: busybox:latest
    namespace: p1
    resourceVersion: "3130"
    selfLink: /osapi/v1beta1/imageStreamTags/busybox:latest?namespace=p1
    uid: 20bba079-dfbe-11e4-b304-001c422dcd49

    —
    Reply to this email directly or view it on GitHub
    #1701 (comment).

  9. ncdc commented on Apr 13, 2015

    @ncdc
    Contributor

    @jwforres ImageStreamImage will change slightly to correct name and selfLink in a similar manner.

  10. added 4 commits that reference this issue on Apr 13, 2015
    b96708c
    2b0405f
    ca25def
    a94abf5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions