Skip to content

BUG : registryv1.RegistryServiceAPI // Images().InspectImage() throws an error if the inspected image is in the global icr.io image registry  #341

@almasry

Description

@almasry

Hello Bluemix go team,

We are using the RegistryServiceAPI to inspect some images. The RegistryServiceAPI works just fine for any image (at any region) expect for images in the global icr.io registry.

We tried solving this by unsetting the region or setting the region to "GLOBAL" but it still doesn't work.

We still get an error when we inspect an image in the icr.io or private.icr.io registry.

The error received is something like :

 {
    "code": "CRI0106E",
    "message": "The registry in the supplied image name doesn't match the registry that the request was sent to. Correct the image name, and try again.",
    "request-id": "61373bca-f318-4066-9fb7-eba642dcd3b3"
}

We know for sure that the image name is correct and the image is already in the registry and is accessible to the given API key - as we run the ibmcloud cr image-inspect to inspect the exact same image and it doesn't throw any error.

$ ibmcloud cr  image-inspect icr.io/obs/team-name/image:1.11.1

The output is something like :

Inspecting image 'icr.io/obs/team-name/image:1.11.1'...

{
	"Id": "sha256:6a03a21e44f68xxxxxxxxxxxxxxxxxxxxxxx",
	"Parent": "",
	"Comment": "",
	"Created": "2021-11-17T09:06:33.94142403Z",
	"Container": "",
	"ContainerConfig": {
		"Hostname": "",
		"Domainname": "",
		"User": "",
		"AttachStdin": false,
		"AttachStdout": false,
		"AttachStderr": false,
		"Tty": false,
		"OpenStdin": false,
		"StdinOnce": false,
		"Env": null,
		"Cmd": null,
		"Image": "",
		"Volumes": {},
		"WorkingDir": "",
		"Entrypoint": null,
		"OnBuild": null,
		"Labels": null
	},
	"DockerVersion": "",
	"Author": "",
	"Config": {
		"Hostname": "",
		"Domainname": "",
		"User": "1337:1337",
		"AttachStdin": false,
		"AttachStdout": false,
		"AttachStderr": false,
		"Tty": false,
		"OpenStdin": false,
		"StdinOnce": false,
		"Env": [
			"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
			"container=oci"
		],
		"Cmd": null,
		"ArgsEscaped": true,
		"Image": "",
		"Volumes": {},
		"WorkingDir": "",
		"Entrypoint": [
			"/usr/local/bin/pilot-discovery"
		],
		"OnBuild": null,
	"ManifestType": "application/vnd.docker.distribution.manifest.v2+json"
}

OK


How to reproduce this bug ?

  1. Create an image in the global icr.io registry

  2. Login to ibmcloud and Inspect the image with ibmcloud cr image-inspect .. it will work just fine.

  3. Try to inspect the exact same image with the bluemix-go api - you will get an error similar to the one in the description.

Thanks in advance for your support.

Metadata

Metadata

Assignees

No one assigned

    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