Repository navigation
Closed
Labels
Description
Version
openshift v1.1.6-3-g9cc9434-dirty
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5
$ oc get svc docker-registry -o yaml |grep clusterIP
clusterIP: 172.30.167.183
$ docker tag docker.io/busybox 172.30.167.183:5000/tmp/hello-world:latest
$ oc import-image --from=172.30.167.183:5000/tmp/hello-world:latest tmp/foo:v1 --confirm --insecure
The import completed successfully.
Name: foo
Created: Less than a second ago
Labels: <none>
Annotations: openshift.io/image.dockerRepositoryCheck=2016-04-11T12:49:56Z
Docker Pull Spec: 172.30.167.183:5000/tmp/foo
Tag Spec Created PullSpec Image
v1 172.30.167.183:5000/tmp/hello-world:latest Less than a second ago import failed: dockerimage "172.30.167.183:5000/tmp/hello-world:lat...
! tag is insecure and can be imported over HTTP or self-signed HTTPS
In docker-registry log you can see:
time="2016-04-11T12:49:56.619139746Z" level=debug msg=GetImageManifest go.version=go1.5.3 http.request.host="172.30.167.183:5000" http.request.id=e165235e-a9e9-466b-a30d-b65adc8b215a http.request.method=GET http.request.remoteaddr="10.34.129.157:41794" http.request.uri="/v2/tmp/hello-world/manifests/latest" http.request.useragent="Go-http-client/1.1" instance.id=9e296c46-bc6b-4a56-8cd5-0c18ddf4e0b1 vars.name="tmp/hello-world" vars.reference=latest
time="2016-04-11T12:49:56.620518905Z" level=error msg="Error getting ImageStreamTag \"latest\": imagestreams \"hello-world\" not found" go.version=go1.5.3 http.request.host="172.30.167.183:5000" http.request.id=e165235e-a9e9-466b-a30d-b65adc8b215a http.request.method=GET http.request.remoteaddr="10.34.129.157:41794" http.request.uri="/v2/tmp/hello-world/manifests/latest" http.request.useragent="Go-http-client/1.1" instance.id=9e296c46-bc6b-4a56-8cd5-0c18ddf4e0b1 vars.name="tmp/hello-world" vars.reference=latest
time="2016-04-11T12:49:56.620607189Z" level=error msg="response completed with error" err.code="MANIFEST_UNKNOWN" err.detail="imagestreams \"hello-world\" not found" err.message="manifest unknown" go.version=go1.5.3 http.request.host="172.30.167.183:5000" http.request.id=e165235e-a9e9-466b-a30d-b65adc8b215a http.request.method=GET http.request.remoteaddr="10.34.129.157:41794" http.request.uri="/v2/tmp/hello-world/manifests/latest" http.request.useragent="Go-http-client/1.1" http.response.contenttype="application/json; charset=utf-8" http.response.duration=6.840234ms http.response.status=404 http.response.written=299 instance.id=9e296c46-bc6b-4a56-8cd5-0c18ddf4e0b1 vars.name="tmp/hello-world" vars.reference=latest
but imagestream will be created:
$ oc get -n tmp is
NAME DOCKER REPO TAGS UPDATED
foo 172.30.167.183:5000/tmp/foo v1
$ oc get -n tmp is/foo -o yaml
apiVersion: v1
kind: ImageStream
metadata:
annotations:
openshift.io/image.dockerRepositoryCheck: 2016-04-11T12:49:56Z
creationTimestamp: 2016-04-11T12:49:56Z
generation: 1
name: foo
namespace: tmp
resourceVersion: "1345"
selfLink: /oapi/v1/namespaces/tmp/imagestreams/foo
uid: e4d0bcf5-ffe3-11e5-87ce-507b9d472d2b
spec:
tags:
- annotations: null
from:
kind: DockerImage
name: 172.30.167.183:5000/tmp/hello-world:latest
generation: 1
importPolicy:
insecure: true
name: v1
status:
dockerImageRepository: 172.30.167.183:5000/tmp/foo
tags:
- conditions:
- generation: 1
lastTransitionTime: 2016-04-11T12:49:56Z
message: dockerimage "172.30.167.183:5000/tmp/hello-world:latest" not found
reason: NotFound
status: "False"
type: ImportSuccess
items: null
tag: v1
Activity
legionus commentedon Apr 12, 2016
https://github.com/openshift/origin/blob/master/pkg/image/importer/importer.go#L305-L307
legionus commentedon Apr 12, 2016
New output:
Return an error importing images if unable to obtain a single tag and…
soltysh commentedon Apr 12, 2016
@legionus in which way the newly created IS is invalid? It's pointing to exactly that tag you've specified in the import-image command. If you're talking about the error - that's working as expected.
legionus commentedon Apr 12, 2016
But the resulting imagestream is not suitable for anything. What's the point to create an image if all of tags and digests failed to import ?
@miminar
soltysh commentedon Apr 12, 2016
If there will be temporary error in the import (network down, temporary remote registry misbehavior) re-importing the image will fix the problem. You can't assume the spec is wrong. Only user upon verification will know that. @smarterclayton intentionally pushed this solution to do as much as we can during import and let the user identify those single errors.
miminar commentedon Apr 12, 2016
What I consider wrong is the message
The import completed successfully.showing up regardless of the number of tags imported successfully.legionus commentedon Apr 12, 2016
You right I can't. But result of
oc import-image ...shouldn't be successful because we failed when importing. At the time of the command execution is the actual execution result.I'm wrong that don't show detailed information about the imagestream.
smarterclayton commentedon Apr 12, 2016
The message is wrong, but even more than that, I don't think the output of import-image is even really well suited to the use case anymore. There's three cases:
All of those could be either successful or failed. For the latter two, we should be showing a more succinct output - what the newest tag is, the id, and when. The other data is useless. For creation, we should show a bit more info (help orient the user that we created an image stream).
soltysh commentedon Apr 12, 2016
Agree with @smarterclayton. Created #8485 to track it. This issue and accompanying PR can be safely closed.