{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/82935240","pull_request_review_id":3807137,"id":82935240,"diff_hunk":"@@ -83,7 +83,7 @@ func (d *defaultDockerConfigProvider) Enabled() bool {\n // Provide implements dockerConfigProvider\n func (d *defaultDockerConfigProvider) Provide() DockerConfig {\n \t// Read the standard Docker credentials from .dockercfg\n-\tif cfg, err := ReadDockerConfigFile(); err == nil {\n+\tif cfg, err := ReadDockerConfigFile(nil); err == nil {","path":"pkg/credentialprovider/provider.go","position":5,"original_position":5,"commit_id":"72dbcada3f698e7b423e928ab7ea9a70891179ce","original_commit_id":"72dbcada3f698e7b423e928ab7ea9a70891179ce","user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"body":"don't change this invocation","created_at":"2016-10-12T04:40:30Z","updated_at":"2016-10-12T04:40:30Z","html_url":"https://github.com/kubernetes/kubernetes/pull/31881#discussion_r82935240","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/31881","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/82935240"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/31881#discussion_r82935240"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/31881"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/31881","id":83640699,"html_url":"https://github.com/kubernetes/kubernetes/pull/31881","diff_url":"https://github.com/kubernetes/kubernetes/pull/31881.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/31881.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/31881","number":31881,"state":"open","locked":false,"title":"make function ReadDockerConfigFile more flexible","user":{"login":"guangxuli","id":17472298,"avatar_url":"https://avatars.githubusercontent.com/u/17472298?v=3","gravatar_id":"","url":"https://api.github.com/users/guangxuli","html_url":"https://github.com/guangxuli","followers_url":"https://api.github.com/users/guangxuli/followers","following_url":"https://api.github.com/users/guangxuli/following{/other_user}","gists_url":"https://api.github.com/users/guangxuli/gists{/gist_id}","starred_url":"https://api.github.com/users/guangxuli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guangxuli/subscriptions","organizations_url":"https://api.github.com/users/guangxuli/orgs","repos_url":"https://api.github.com/users/guangxuli/repos","events_url":"https://api.github.com/users/guangxuli/events{/privacy}","received_events_url":"https://api.github.com/users/guangxuli/received_events","type":"User","site_admin":false},"body":"In our code, the public function `ReadDockerConfigFile` looks like not enough flexible:\r\nwhen I want to use this function to get docker config info from a specific path, I have to call  `SetPreferredDockercfgPath`, and then the setting preferredPath will be valid in function  `ReadDockerConfigFile`.  I know in our code, we call  `SetPreferredDockercfgPath` in one place ,then call `ReadDockerConfigFile` in another place, it was not in same context. But it looks like not thread safety. \r\n I think if user who use our code want to get docker config from a specific path, it is reasonable to call directly `ReadDockerConfigFile ` with a dockerconfigPath argument, and it can avoid some scenarios that thread is not safety . \r\nI add a test case for this function.\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.kubernetes.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/31881)\r\n<!-- Reviewable:end -->\r\n","created_at":"2016-09-01T14:15:32Z","updated_at":"2016-10-12T04:40:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6557d80649c015b61304f65f4051bcce9ded1198","assignee":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"assignees":[{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/31881/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/31881/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/31881/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/72dbcada3f698e7b423e928ab7ea9a70891179ce","head":{"label":"guangxuli:get_docker_auth","ref":"get_docker_auth","sha":"72dbcada3f698e7b423e928ab7ea9a70891179ce","user":{"login":"guangxuli","id":17472298,"avatar_url":"https://avatars.githubusercontent.com/u/17472298?v=3","gravatar_id":"","url":"https://api.github.com/users/guangxuli","html_url":"https://github.com/guangxuli","followers_url":"https://api.github.com/users/guangxuli/followers","following_url":"https://api.github.com/users/guangxuli/following{/other_user}","gists_url":"https://api.github.com/users/guangxuli/gists{/gist_id}","starred_url":"https://api.github.com/users/guangxuli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guangxuli/subscriptions","organizations_url":"https://api.github.com/users/guangxuli/orgs","repos_url":"https://api.github.com/users/guangxuli/repos","events_url":"https://api.github.com/users/guangxuli/events{/privacy}","received_events_url":"https://api.github.com/users/guangxuli/received_events","type":"User","site_admin":false},"repo":{"id":64767317,"name":"kubernetes","full_name":"guangxuli/kubernetes","owner":{"login":"guangxuli","id":17472298,"avatar_url":"https://avatars.githubusercontent.com/u/17472298?v=3","gravatar_id":"","url":"https://api.github.com/users/guangxuli","html_url":"https://github.com/guangxuli","followers_url":"https://api.github.com/users/guangxuli/followers","following_url":"https://api.github.com/users/guangxuli/following{/other_user}","gists_url":"https://api.github.com/users/guangxuli/gists{/gist_id}","starred_url":"https://api.github.com/users/guangxuli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guangxuli/subscriptions","organizations_url":"https://api.github.com/users/guangxuli/orgs","repos_url":"https://api.github.com/users/guangxuli/repos","events_url":"https://api.github.com/users/guangxuli/events{/privacy}","received_events_url":"https://api.github.com/users/guangxuli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/guangxuli/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/guangxuli/kubernetes","forks_url":"https://api.github.com/repos/guangxuli/kubernetes/forks","keys_url":"https://api.github.com/repos/guangxuli/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guangxuli/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guangxuli/kubernetes/teams","hooks_url":"https://api.github.com/repos/guangxuli/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/guangxuli/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/guangxuli/kubernetes/events","assignees_url":"https://api.github.com/repos/guangxuli/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/guangxuli/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/guangxuli/kubernetes/tags","blobs_url":"https://api.github.com/repos/guangxuli/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guangxuli/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guangxuli/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/guangxuli/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guangxuli/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/guangxuli/kubernetes/languages","stargazers_url":"https://api.github.com/repos/guangxuli/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/guangxuli/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/guangxuli/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/guangxuli/kubernetes/subscription","commits_url":"https://api.github.com/repos/guangxuli/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/guangxuli/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/guangxuli/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/guangxuli/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/guangxuli/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/guangxuli/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guangxuli/kubernetes/merges","archive_url":"https://api.github.com/repos/guangxuli/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guangxuli/kubernetes/downloads","issues_url":"https://api.github.com/repos/guangxuli/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/guangxuli/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/guangxuli/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/guangxuli/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guangxuli/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/guangxuli/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/guangxuli/kubernetes/deployments","created_at":"2016-08-02T15:10:16Z","updated_at":"2016-08-02T15:11:32Z","pushed_at":"2016-10-11T16:51:35Z","git_url":"git://github.com/guangxuli/kubernetes.git","ssh_url":"git@github.com:guangxuli/kubernetes.git","clone_url":"https://github.com/guangxuli/kubernetes.git","svn_url":"https://github.com/guangxuli/kubernetes","homepage":"http://kubernetes.io","size":333713,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"ead65fc25fe309464b40d0ba212f83ae256725da","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-10-12T03:59:44Z","pushed_at":"2016-10-12T04:23:29Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":591765,"stargazers_count":17464,"watchers_count":17464,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5675,"mirror_url":null,"open_issues_count":4942,"forks":5675,"open_issues":4942,"watchers":17464,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/31881"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/31881"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/31881"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/31881/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/31881/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/31881/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/72dbcada3f698e7b423e928ab7ea9a70891179ce"}}}}
{"actor":{"display_login":"liggitt"}}