portieris: Error retrieving OAuth token from repositories that do not support it
What commit ID of Portieris did you experience the problem with?
939c65b4e121c778d97f5dd1384484f5fcb078f1
What went wrong?
I am unable to deploy images from Docker Hub or a self-hosted Artifactory. When deploying an image from either registry Portieris queries https://<registry>/oauth/token. As far as I am aware this endpoint only exists for IBM Container Registry. So when Docker Hub is queried a 404 and large amount of HTML (probably the Docker 404 page) is returned. For Artifactory we receive an x509 error from our self-signed cert. This causes both deployments to fail despite being signed images with correct registry credentials.
These errors happen when querying the registry, before it gets as far as communicating with our self-hosted Notary.
We can deploy images hosted in IBM Container Registry just fine. Even when we host the signing information in our self-hosted Notary.
What should have happened differently?
Portieris should not query https://<registry>/oauth/token for non-IBM registries.
Portieris should be able to handle registries using self-signed TLS certificates.
How can it be reproduced?
Install Portieris and attempt to any Docker Hub pod with a valid pull secret.
Any other relevant information
We are running Portieris on an EKS cluster so we have deployed with the IBMContainerService option set to false.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 68 (51 by maintainers)
Looks good to me. In my opinion there isn’t any need to block this on using a fake registry for the test cases, so I hope that it can merge soon.
So, if I wanted to access, for example, https://abc.azurecr.io/v2/foo/bar, the flow would be:
glad to hear that! thanks for the quick answer @jerrinss5 😃
@jerrinss5 I think you’re going to the registry to get responses on those APIs. We should use the Notary API to be sure that we get the correct data back.
Notary’s API is a little different to Registry’s, but in short a sensible URL to call would be:
GET https://<notary-domain>:<port>/v2/<image_repository>/_trust/tuf/root.jsonFor example:
GET https://us.icr.io:4443/v2/us.icr.io/molepigeon/testimage/_trust/tuf/root.jsonDon’t forget that the API could return something other than a 401 - for example, if you make an unauthenticated request to IBM’s notary asking for a Docker Hub image, you’ll get a 404 even without auth: