OpenShift internal registry does not work when user set container registry credentials #19999
Closed
5 tasks done
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.
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 asimagePullSecrets
(https://kubernetes.io/docs/concepts/configuration/secret/#using-imagepullsecrets). On OpenShift, when there is noimagePullSecrets
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
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
oc version
)Screenshots
Installation method
Environment
Eclipse Che Logs
Additional context
https://issues.redhat.com/browse/CRW-1925
devfile/devworkspace-operator#459
The text was updated successfully, but these errors were encountered: