-
Notifications
You must be signed in to change notification settings - Fork 395
Be benevolent to .docker/config.json file #96
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
Conversation
|
yeah, that behavior was totally wrong and I've already fixed that upstream in 1.13-dev moby/moby#23100 - from now on only hostname[:port] |
|
BUT, this is breaking CI in skopeo... |
|
we need some unit test here also... |
docker/docker_client.go
Outdated
| if err != nil { | ||
| continue | ||
| } | ||
| normalizedAuths[u.Host] = v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should contain host[:post] - CI fails on localhost:5000 for instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does. Nevertheless, I reworked it completely.
da53d12 to
6b3ac99
Compare
|
Reworked according to @runcom's changes in moby/moby#23100. And added unit tests. |
|
Ahh, one more thing, I need to return |
right, that's how it works in docker - but we really need to have a way to specify the config location (not in this PR ofc) |
| } | ||
|
|
||
| // bad luck; let's normalize the entries first | ||
| registry = normalizeRegistry(registry) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, this whole method's logic comes from docker and I don't want to mess with it because it's actually working, can you move this code here and below to another function/method instead?
|
@miminar tests failing though: |
Docker can store auth entries with schema prefix or even path suffix.
See an example:
{
"auths": {
"10.3.10.88:5000": {
...
},
"http://10.3.10.88:5000/v2/": {
...
},
"https://10.3.10.88:5000": {
...
},
"https://index.docker.io/v1/": {
...
}
}
}
The entries were created using command `docker login` of upstream Docker
1.12. Let's normalize the auth keys before trying to match against
hostname.
Signed-off-by: Michal Minář <[email protected]>
6b3ac99 to
d30079f
Compare
|
@runcom fixed. |
|
LGTM thanks for the tests @miminar ! |
Shifted a number of auth-getting unit tests from docker_client_test.go into config_test.go, since they only excercise config.go logic. They'd been in their previous location since landing in d30079f (Be benevolent to .docker/config.json file, 2016-09-20, containers#96). Signed-off-by: W. Trevor King <[email protected]>
Shifted a number of auth-getting unit tests from docker_client_test.go into config_test.go, since they only excercise config.go logic. They'd been in their previous location since landing in d30079f (Be benevolent to .docker/config.json file, 2016-09-20, containers#96). Signed-off-by: W. Trevor King <[email protected]>
Shifted a number of auth-getting unit tests from docker_client_test.go into config_test.go, since they only excercise config.go logic. They'd been in their previous location since landing in d30079f (Be benevolent to .docker/config.json file, 2016-09-20, containers#96). Signed-off-by: W. Trevor King <[email protected]>
Docker can store auth entries with schema prefix or even path suffix.
See an example:
The entries were created using command
docker loginof upstream Docker1.12. Let's normalize the auth keys before trying to match against
hostname.
Signed-off-by: Michal Minář [email protected]