Skip to content

expose config credentials without needing the Cli - #227

Merged
vdemeester merged 5 commits into
docker:masterfrom
dnephin:expose-config
Jun 29, 2017
Merged

expose config credentials without needing the Cli#227
vdemeester merged 5 commits into
docker:masterfrom
dnephin:expose-config

Conversation

@dnephin

Copy link
Copy Markdown
Contributor

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

codecov-io commented Jun 21, 2017

Copy link
Copy Markdown

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

Comment threadcli/config/config.go Outdated
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
Copy Markdown

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
Copy Markdown
ContributorAuthor

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

@tonistiigitonistiigi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment threadcli/config/configfile/file.go Outdated
}

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

Copy link
Copy Markdown
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

@vdemeestervdemeester left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Member

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

@vdemeester

Copy link
Copy Markdown
Collaborator

I'll carry this one 😉

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
@vdemeester
vdemeesterforce-pushed the expose-config branch 2 times, most recently from 379623e to fda6366CompareJune 27, 2017 14:25
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
expected := types.AuthConfig{
Username: "foo",
Password: "bar",
Email: "foo@example.com",

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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.

@thaJeztahthaJeztah left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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

@vdemeester
vdemeester merged commit 74af31b into docker:masterJun 29, 2017
@GordonTheTurtleGordonTheTurtle added this to the 17.07.0 milestone Jun 29, 2017
@dnephin
dnephin deleted the expose-config branch June 29, 2017 17:14
nobiit pushed a commit to nobidev/docker-cli that referenced this pull request Nov 19, 2025
[17.09] bump version to 17.09.0-ce-rc2
Sign up for freeto 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

@dnephin@codecov-io@thaJeztah@vdemeester@tonistiigi@aaronlehmann@kolyshkin@GordonTheTurtle