Skip to content

Conversation

@saurabh-gupta-pingsafe
Copy link

No description provided.

@bahamat
Copy link
Contributor

bahamat commented Oct 23, 2023

Hi @saurabh-gupta-pingsafe and @nishant-pingsafe, could you provide some context as to why this change is being requested?

I'd also like to see a test case showing the current behavior with any error messages produced, along with the new behavior showing success.

@saurabh-gupta-pingsafe
Copy link
Author

saurabh-gupta-pingsafe commented Oct 25, 2023

Hi @bahamat ,

When we run docker login V2 on azure container registry, it throws the following error

        if (fields.err) {
                   ^

TypeError: Cannot read properties of null (reading 'err')
    at UnauthorizedError._DockerRegistryClientBaseError (/Users/myrepo/node_modules/docker-registry-client/lib/errors.js:101:20)
    at new UnauthorizedError (/Users/myrepo/node_modules/docker-registry-client/lib/errors.js:161:36)
    at /Users/myrepo/node_modules/docker-registry-client/lib/registry-client-v2.js:349:23
    at IncomingMessage.finish (/Users/myrepo/node_modules/docker-registry-client/lib/docker-json-client.js:171:13)

This is because azure container registry returns token in the field called "access_token" but currently we are only checking on "token".

I have added support for "access_token" as well.

With access token, the login works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants