Describe the bug
When using a self hosted registry, credentials are provided which are used to retrieve a token. If the registry does not implement a token service, the endpoint returns a 404 and version-checker cannot authenticate to the registry.
$ k plogs -n version-checker -p version-checker-7db59c4996-8hj99 -c version-checker
...
error: failed to setup image registry clients: failed to create selfhosted client "http://docker-registry.registry.svc.cluster.local:5000": failed to setup token auth (404): 404 page not found
Describe the bug When using a self hosted registry, credentials are provided which are used to retrieve a token. If the registry does not implement a token service, the endpoint returns a 404 and version-checker cannot authenticate to the registry.
This could be an edge case, and there should be a token endpoint in which case a 404 is the right response and basic auth shouldn't be used.
To Reproduce Steps to reproduce the behavior:
Expected behavior Basic auth should be used when token endpoint returns 404 so version-checker can authenticate with the registry.
Environment (please complete the following information):