A project without a repository cannot push to its container registry (401 on push)
On a up2date (15.7.0) self-hosted gitlab AND on gitlab.com I setup a project and disabled all features except the container registry. The gitlab.com project is here: gitlab.com/n_g/test-registry
I then tried to push an image to it by using my user's login:
$ podman login registry.gitlab.com
Username: n_g
Password:
Login Succeeded!
$ podman push registry.gitlab.com/n_g/test-registry:latest
Getting image source signatures
Error: trying to reuse blob sha256:82ddcdfc00a78afedc2c05cde3fa959f94f5590764cbade42e2280f21eadf719 at destination: checking whether a blob sha256:82ddcdfc00a78afedc2c05cde3fa959f94f5590764cbade42e2280f21eadf719 exists in registry.gitlab.com/n_g/test-registry: errors:
denied: requested access to the resource is denied
error parsing HTTP 401 response body: unexpected end of JSON input: ""
Since I am using my user's credentials and they have been validated, it must be the correct ones.
I get the same results though when using project access tokens with (read_registry & write_registry)
Now as soon as I enable the repository feature, I am able to push:
$ podman push registry.gitlab.com/n_g/test-registry:latest
Getting image source signatures
Copying blob 4cd00368ad40 done
Copying blob 82ddcdfc00a7 done
Copying config 08a971b4a1 done
Writing manifest to image destination
Storing signatures
$
Somehow the repository feature seems to be mandatory when you want to use the container registry. But that is not visible nor expected and I think it would be nice to setup projects that are just container registries.
The issue can easily be reproduced by creating a project, disabling all features except the container registry and trying to push to it.