-
Notifications
You must be signed in to change notification settings - Fork 1.1k
implement new docker config file format for authentication #727
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
Codecov Report
@@ Coverage Diff @@
## master #727 +/- ##
==========================================
+ Coverage 61.58% 61.89% +0.31%
==========================================
Files 411 410 -1
Lines 8172 8152 -20
Branches 530 521 -9
==========================================
+ Hits 5033 5046 +13
+ Misses 2838 2809 -29
+ Partials 301 297 -4
Continue to review full report at Codecov.
|
Does this help solve bug #316 ? |
Yep, I use this changes to get the auth information from the new config.json file format. |
import com.github.dockerjava.api.model.AuthConfig; | ||
import com.github.dockerjava.api.model.AuthConfigurations; | ||
|
||
public class AuthConfigFile { |
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.
seems we can't remove public class in minor release :(
return withOptionalAuthConfig(authConfig); | ||
} | ||
|
||
private CreateContainerCmd withOptionalAuthConfig(AuthConfig authConfig) { |
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.
what is the difference?
return authConfig; | ||
} | ||
|
||
public CreateContainerCmd withAuthConfig(AuthConfig authConfig) { |
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.
and here
Frankly speaking i don't understand what docker did with all this changes, my use case is calls from jenkins/java code with custom credentials, so i'm passing auth for all commands without using login. I guess this configs are needed if docker-java is used as docker cli analogue? |
master is open for refactorings, but people added additional hotfixes for auth. could you rebase/review/propose now changes? |
Hi, yes I will rebase my pull request on weekend. Currently I do not have enough time for it. |
please wait.. i'm refactoring all tests for master. |
6732612
to
5f0abac
Compare
I have rebased my changes on the latest master, hope that this pull request is fine now |
5f0abac
to
c60b161
Compare
Are there any issues on my side, which cause the error? |
@@ -197,6 +200,8 @@ | |||
@CheckForNull | |||
Boolean isTty(); | |||
|
|||
CreateContainerCmd withAuthConfig(AuthConfig authConfig); |
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.
why it needed for create container?
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.
Because docker can pull the image while creating a container, if it is missing on the current host. The auth config is then needed if a private registry is used.
add auth option to create image command
c60b161
to
4fd7b8a
Compare
f9217a9
to
cc0b2e0
Compare
Ok, I have changed your last suggestions. Anything left? |
let's try |
Such use case existed before. related to docker-java#727
Maybe we should use a common implementation of the X-Registry-Auth header logic. Currently it is duplicated in each CommandImpl.
WDYT?
This change is