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

Gitlab private registries not working with Knative v1.2 #12642

Closed
ms1515 opened this issue Feb 17, 2022 · 3 comments
Closed

Gitlab private registries not working with Knative v1.2 #12642

ms1515 opened this issue Feb 17, 2022 · 3 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@ms1515
Copy link

ms1515 commented Feb 17, 2022

Not able to fetch private images from gitlab on Knative v1.2. I can fetch private images from Docker with Knative v1.2, but not gitlab.

I can confirm that this is not a secrets issue, as I can pull images from Gitlab with my secret with earlier versions of Knative: v1.1.1, v1.1.0 etc.

In what area(s)?

Private Registries

What version of Knative?

1.2

Expected Behavior

Knative v1.2 should pull images from private registries in Gitlab with appropriate secrets provided.

Actual Behavior

Knative v1.2 cannot pull private images from Gitlab registries.

Steps to Reproduce the Problem

  1. Setup a private container registry on Gitlab in your project.
  2. Push an example image to it.
  3. Setup a secret for gitlab-registry in Kubernetes environment with your credentials.
kubectl create secret docker-registry gitlab-auth \
  --docker-server=https://registry.gitlab.com \
  --docker-email=YOUR-GITLAB-EMAIL \
  --docker-username=YOUR-GITLAB-USERNAME \
  --docker-password=YOUR-GITLAB-ACCESS-TOKEN
  1. Then either specify that secret in Knative-service.yaml file for your example project, or patch your service account with it.
  2. Apply your example Knative-service.yaml using kn and you will get the following error:
Error: RevisionFailed: Revision "example-service" failed with message: Unable to fetch image "registry.gitlab.com/example-image-url": failed to resolve image to digest: GET https://gitlab.com/jwt/auth?scope=repository%!A(MISSING)example%!F(MISSING) example%!F(MISSING) example%!F(MISSING) example%!F(MISSING) example%!F(MISSING) example%!F(MISSING) example%!A(MISSING)pull&service=container_registry: DENIED: access forbidden.
Run 'kn --help' for usage

Note: I can confirm that this is not a secrets issue, as I can pull images from Gitlab with my secret with earlier versions of Knative: v1.1.1, v1.1.0 etc.

@ms1515 ms1515 added the kind/bug Categorizes issue or PR as related to a bug. label Feb 17, 2022
@dprotaso dprotaso added this to the v1.3.0 milestone Feb 19, 2022
@dprotaso
Copy link
Member

dprotaso commented Feb 19, 2022

Confirmed the difference in behaviour. I think as a workaround for now you can use registry.gitlab.com as your docker server name - so drop the scheme (https).

@dprotaso
Copy link
Member

/assign @dprotaso

@dprotaso
Copy link
Member

dprotaso commented Mar 1, 2022

@ms1515 this should be fixed in the latest 1.2 patch release

thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants