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

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

Open
almasry opened this issue Dec 9, 2021 · 1 comment

Comments

@almasry
Copy link

almasry commented Dec 9, 2021

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.

@almasry almasry changed the title BUG : registryv1.RegistryServiceAPI // Images().InspectImage() throws an error if the inspected is in the global icr.io image registry BUG : registryv1.RegistryServiceAPI // Images().InspectImage() throws an error if the inspected image is in the global icr.io image registry Dec 9, 2021
@hkantare
Copy link
Collaborator

hkantare commented Dec 9, 2021

@almasry We prefer to use the service specific go sdk than bluemix-go because the priority of issues on this project is very less...Can you please use https://github.com/IBM/container-registry-go-sdk this SDK since its handled by respective service team and will always be up to date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants