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

expose config credentials without needing the Cli #227

Merged
merged 5 commits into from
Jun 29, 2017

Conversation

dnephin
Copy link
Contributor

@dnephin dnephin commented Jun 21, 2017

Related to moby/moby#30817

Move GetAllCredentials(), and CredentialsStore() from the DockerCli to the ConfigFile struct, so that are easier to use externally.

@codecov-io
Copy link

codecov-io commented Jun 21, 2017

Codecov Report

Merging #227 into master will increase coverage by 0.13%.
The diff coverage is 51.89%.

@@            Coverage Diff             @@
##           master     #227      +/-   ##
==========================================
+ Coverage   46.85%   46.98%   +0.13%     
==========================================
  Files         172      172              
  Lines       11692    11693       +1     
==========================================
+ Hits         5478     5494      +16     
+ Misses       5902     5882      -20     
- Partials      312      317       +5

func LoadDefaultConfigFile(err io.Writer) *configfile.ConfigFile {
configFile, e := Load(Dir())
if e != nil {
fmt.Fprintf(err, "WARNING: Error loading config file:%v\n", e)
Copy link
Contributor

Choose a reason for hiding this comment

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

I realize this code is only moved, but it looks like a space is missing between : and %v.

@dnephin
Copy link
Contributor Author

dnephin commented Jun 22, 2017

Fixed the string format and added a couple more unit tests.

Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -53,6 +53,15 @@ type ProxyConfig struct {
FTPProxy string `json:"ftpProxy,omitempty"`
}

// NewConfigFile initializes an empty configuration file for the given filename 'fn'
func NewConfigFile(fn string) *ConfigFile {
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe in the context of this pkg it should just be called New

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🦁 with @tonistiigi comment 👼

@thaJeztah
Copy link
Member

Given that @dnephin is on PTO this week, perhaps someone can carry those nits?

@vdemeester
Copy link
Collaborator

I'll carry this one 😉

@vdemeester vdemeester force-pushed the expose-config branch 2 times, most recently from 379623e to fda6366 Compare June 27, 2017 14:25
expected := types.AuthConfig{
Username: "foo",
Password: "bar",
Email: "[email protected]",
Copy link
Member

Choose a reason for hiding this comment

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

Do we still have to test for the Email field here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe not but could be handled in a follow-up 👼

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the credential helper stores email, I think we should still test for it.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

had one question, but LGTM overall

ping @tonistiigi PTAL

@dnephin
Copy link
Contributor Author

dnephin commented Jun 29, 2017

@vdemeester thanks for making that New() change. Last commit LGTM

@vdemeester vdemeester merged commit 74af31b into docker:master Jun 29, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.07.0 milestone Jun 29, 2017
@dnephin dnephin deleted the expose-config branch June 29, 2017 17:14
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.

8 participants