openshift-dd-ext icon indicating copy to clipboard operation
openshift-dd-ext copied to clipboard

Container Registry shown on openshift extension is different to the actually environment

Open hofriendly opened this issue 3 years ago • 5 comments

The container registry of the current project context seems to get by "oc registry info" which is different to the docker registry actually used in my environment. Is there any way to change the container registry field by myself?

I am using the following command to upload a docker image to openshift image stream: docker build -t docker-registry-default.xxxxxx.xxxxxx.org/<project_name>/<image_name>: . docker login -u -p docker-registry-default.xxxxxx.xxxxxx.org docker push docker-registry-default.xxxxxx.xxxxxx.org/<project_name>/<image_name>:

Docker Desktop Openshift extension: Logging to docker-registry.default.svc:5000... info: Using internal registry hostname docker-registry.default.svc:5000 W0812 12:17:15.903195 8796 helpers.go:151] Defaulting of registry auth file to "${HOME}/.docker/config.json" is deprecated. The default will be switched to podman config locations in the future version. Saved credentials for docker-registry.default.svc:5000 Creating image stream <image_name>... Image stream <image_name> already exists, proceeding... Tagging docker-registry.default.svc:5000/<project_name>/<image_name>:... Pushing docker-registry.default.svc:5000/<project_name>/<image_name>: to remote registry... The push refers to repository [docker-registry.default.svc:5000/<project_name>/<image_name>] Get "https://docker-registry.default.svc:5000/v2/": Gateway Timeout docker push failed: Get "https://docker-registry.default.svc:5000/v2/": Gateway Timeout

hofriendly avatar Aug 12 '22 04:08 hofriendly

I have indeed noticed oc registry info returns docker-registry.default.svc:5000 for some contexts, which is never going to work. We cannot yet set a custom registry URL but we'll certainly work on it. Can your docker-registry-default.xxxxxx.xxxxxx.org be inferred by any other command?

fbricon avatar Aug 12 '22 13:08 fbricon

No. The Docker registry is provided by my Openshift administrator. I haven't found any command to display the correct docker registry.

hofriendly avatar Aug 15 '22 01:08 hofriendly

Hey @fbricon I'd like to work on this, but it kinda looks like a dead-end. Do you recommend this issue for a first-time contributor?

Ajax-Light avatar Oct 17 '22 14:10 Ajax-Light

Well I wonder if brutally ignoring all "docker-registry.default.svc" registries would be OK. i.e. Is there a legit case where OpenShift clusters (maybe local ones?) would use docker-registry.default.svc? @dgolovin WDYT? If that's the case that'd be an easy solution

fbricon avatar Oct 17 '22 15:10 fbricon

@fbricon TLDR we should provide the way to override registry host:port no matter if .svc domains are legit or are not. There should be mapping in config cluster-url => registry url.

I am not a OpenShift/Kubernetes admin to rule out using anything containing .cvs as a internal dns record for service. It seams a legit way to to use oc registry info to get default value for a registry host name. CRC for example returns default-route-openshift-image-registry.apps-crc.testing and it has no .cvs in it.

I would say we let user to judge if manual configuration required and provide the way to override registry host:port for specific cluster URL.

dgolovin avatar Oct 17 '22 23:10 dgolovin