Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import image binary content to internal docker registry via REST API #10011

Closed
MarkRx opened this issue Jul 25, 2016 · 1 comment
Closed

Import image binary content to internal docker registry via REST API #10011

MarkRx opened this issue Jul 25, 2016 · 1 comment

Comments

@MarkRx
Copy link

MarkRx commented Jul 25, 2016

Per #7226 the imagestreamimport REST API endpoint was added in 1.1.2 to allow importing images via the rest API. I've been trying it but it seems that this endpoint only imports the image metadata and tags and does not import actual image content. Per the enterprise version release notes this is called "image pullthrough" and acts as a reference to the private registry.(https://docs.openshift.com/enterprise/3.2/release_notes/ose_3_2_release_notes.html)

Comparing a pushed image with the docker CLI to one imported via the REST API in the UI reveals:

Image pushed with docker CLI:

4.6.8.20160725-084659I pushed bf91b4 an hour ago 172.30.19.120:5000/helloworld-dev/helloworld@sha256:bf91b42f6415d169e3a84df4b9eac1c09e502ff8f72d080f1f10228b89c68b8c

Image pulled with ImageStreamImport Rest API:

4.6.9.20160725-090850I private.registry.com/privatenamespace/helloworld:4.6.9.20160725-090850I 464876 35 minutes ago private.registry.com/privatenamespace/helloworld@sha256:46487662ab2cffc4887db77a77017ea4702b4b1627a59a8b2339b7f226a3bc39

Is it possible to import the image metadata and binary content through the OpenShift REST API? The use case is to always have the image available in the local OpenShift docker registry when deploying or spinning up pods so that it can still be used even if an external registry goes down.

Version

OpenShift Master: v3.2.0.46-1-g3fab54d (based on origin 1.2)
Kubernetes Master: v1.2.0-36-g4a3f9c5

Steps To Reproduce
  1. Docker push:
    docker push openshift.internal.registry.com/helloworld-dev/helloworld:4.6.8.20160725- 084659I
  2. Rest API:
{
    "apiVersion": "v1",
    "kind": "ImageStreamImport",
    "metadata": {
        "name": "helloworld",
        "namespace": "helloworld-dev"
    },
    "spec": {
        "import": true,
        "images": [
            {
                "from": {
                    "kind": "DockerImage",
                    "name": "private.registry.com/privatenamespace/helloworld:4.6.9.20160725-090850I"
                }
            }
        ]
    }
}
Current Result

The image metadata is imported via the rest API. The actual image content and layers are not.

Expected Result

The REST API provides a way to import the image binary content along with the image metadata.

@soltysh
Copy link
Contributor

soltysh commented Jul 26, 2016

Your usecase is perfectly valid and we're already tracking this request as part of this trello card.

@soltysh soltysh closed this as completed Jul 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants