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

OpenShift internal registry does not work when user set container registry credentials #19999

Closed
5 tasks done
sparkoo opened this issue Jun 18, 2021 · 0 comments · Fixed by eclipse-che/che-server#49
Closed
5 tasks done
Assignees
Labels
area/che-server kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.

Comments

@sparkoo
Copy link
Member

sparkoo commented Jun 18, 2021

Describe the bug

In case workspace has an image from OpenShift internal registry and at the same time user has defined some container registry credentials, workspace won't start with error Error reading manifest latest in image-registry.openshift-image-registry.svc:5000/crw-image/crw: unauthorized: authentication required'.

Analysis

The pull image credentials are defined in kubernetes with dockercfg secret (https://kubernetes.io/docs/concepts/configuration/secret/#docker-config-secrets) and it's set in Pod spec as imagePullSecrets (https://kubernetes.io/docs/concepts/configuration/secret/#using-imagepullsecrets). On OpenShift, when there is no imagePullSecrets defined, OpenShift will add the default one for the used ServiceAccount, so that it can authenticate against internal OpenShift registry. However, when there is at least one secret explicitly defined, OpenShift do nothing.

When user set container registry credentials, we put it into the workspace deployment and thus OpenShift does NOT add the default one for internal registry and we fail with unauthorized error.

I believe that fix will be to include the service account's dockercfg secret all the time in our code.

Che version

  • latest

Steps to reproduce

The steps are nicely described here https://issues.redhat.com/browse/CRW-1925
One shortcut is to tag locally any docker image and push it into user's namespace registry, so you don't have to bother with permissions and build.

Expected behavior

Workspace should start with image from internal registry.

Runtime

  • Openshift (include output of oc version)

Screenshots

Installation method

  • chectl

Environment

  • Cloud
    • rhpds

Eclipse Che Logs

Additional context

https://issues.redhat.com/browse/CRW-1925
devfile/devworkspace-operator#459

@sparkoo sparkoo added kind/bug Outline of a bug - must adhere to the bug report template. team/platform area/che-server labels Jun 18, 2021
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Jun 18, 2021
@skabashnyuk skabashnyuk added sprint/next severity/P1 Has a major impact to usage or development of the system. sprint/current and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/che-server kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants