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

Add default serveraddress value in remote API /auth #22254

Merged
merged 1 commit into from
Apr 25, 2016

Conversation

yongtang
Copy link
Member

@yongtang yongtang commented Apr 22, 2016

- What I did

This fix tries to address the issue in #22244 where the remote API /auth will not set the default value of serveraddress if not provided. This behavior happens only after 1.11.0 and is a regression as in 1.10.3, serveraddress will be assigned with IndexServer if no value is provided.

- How I did it

The default value IndexServer is assigned to serveraddress if no value provided in this fix.

- How to verify it

An integration test TestAuthApi has been added to cover this change

- A picture of a cute animal (not mandatory but encouraged)

This fix fixes #22244.

Signed-off-by: Yong Tang yong.tang.github@outlook.com

This fix tries to address the issue in moby#22244 where the remote
API `/auth` will not set the default value of `serveraddress`
if not provided. This behavior happens after only in 1.11.0
and is a regression as in 1.10.3 `serveraddress` will be assigned
with `IndexServer` if no value is provided.

The default value `IndexServer` is assigned to `serveraddress` if
no value provided in this fix.

An integration test `TestAuthApi` has been added to cover this change

This fix fixes moby#22244.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@thaJeztah
Copy link
Member

ping @aaronlehmann @kencochrane can you have a look at this? Also if we need this for 1.11.1

@kencochrane
Copy link
Contributor

Seems reasonable to me

@thaJeztah thaJeztah added this to the 1.11.1 milestone Apr 23, 2016
@tiborvass
Copy link
Contributor

Can we find the PR that broke the behavior?

@thaJeztah
Copy link
Member

Possibly f2d481a, although that included a LookupPushEndpoints, which no longer is there

@yongtang
Copy link
Member Author

Hi @tiborvass it looks like the related commit is in:
f2d481a#diff-2b07b8a4e93be324f246494ec743cde2
The following lines was removed:

 -  if addr == "" {     
 -      // Use the official registry address if not specified.      
 -      addr = IndexServer      
 -  }

@kencochrane
Copy link
Contributor

@dmcgowan can you please review?

@dmcgowan
Copy link
Member

LGTM

@dmcgowan
Copy link
Member

@aaronlehmann I don't think we intended to remove this or change to something else, such as DefaultNamespace. The client will still end up using this value as the default from here https://github.com/docker/docker/blob/master/daemon/info.go#L103.

@aaronlehmann
Copy link
Contributor

The fix looks good.

I'm not sure how I feel about adding a unit test that involves communicating with Docker Hub. We already have some integration tests that do this, and they are inherently flaky because network glitches and hub issues cause failures. I don't know if there are any unit tests that depend on connecitivity to Docker Hub, but if not, adding this one would mean that unit tests can't run offline. Is there a way to cover this in a test without actually communicating with Docker Hub?

@tiborvass
Copy link
Contributor

Agree with Aaron, unit test should not communicate with hub. It should just check the string.

@aaronlehmann
Copy link
Contributor

Sorry, it's morning in my timezone and I didn't realize that this is actually an integration test, not a unit test. So I withdraw my objection.


// Test case for #22244
func (s *DockerSuite) TestAuthApi(c *check.C) {
config := types.AuthConfig{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add testRequires(c, Network)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaronlehmann would that work for the meantime? ^^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thaJeztah: Sounds good.

@aaronlehmann
Copy link
Contributor

LGTM

@aaronlehmann aaronlehmann merged commit e6df098 into moby:master Apr 25, 2016
@mlaventure mlaventure mentioned this pull request Apr 25, 2016
@mlaventure mlaventure modified the milestone: 1.11.1 Apr 25, 2016
@yongtang yongtang deleted the 22244-remote-api-auth-behavior branch April 28, 2016 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker remote api behavior changed from 1.10.3 to 1.11.0
8 participants