{"action":"created","comment":{"url":"https://api.github.com/repos/simon3z/image-inspector/pulls/comments/56130265","id":56130265,"diff_hunk":"@@ -103,11 +103,41 @@ func generateRandomName() string {\n \treturn fmt.Sprintf(\"image-inspector-%016x\", n)\n }\n \n+func getAuthConfigs(dockercfg, username, password_file *string) *docker.AuthConfigurations {\n+\timagePullAuths := &docker.AuthConfigurations{\n+\t\tmap[string]docker.AuthConfiguration{\"\": docker.AuthConfiguration{}}}\n+\tif *dockercfg != \"\" {\n+\t\treader, err := os.Open(*dockercfg)\n+\t\tif err != nil {\n+\t\t\tlog.Fatalf(\"Unable to open docker config file: %v\\n\", err)\n+\t\t}\n+\t\tif imagePullAuths, err = docker.NewAuthConfigurations(reader); err != nil {\n+\t\t\tlog.Fatalf(\"Unable to parse docker config file: %v\\n\", err)\n+\t\t}\n+\t\tif len(imagePullAuths.Configs) == 0 {\n+\t\t\tlog.Fatalf(\"No auths were found in the given dockercfg file\")","path":"image-inspector.go","position":25,"original_position":25,"commit_id":"c26b64d85989f5b446feed5981b7f2a75ae8192f","original_commit_id":"c26b64d85989f5b446feed5981b7f2a75ae8192f","user":{"login":"simon3z","id":130393,"avatar_url":"https://avatars.githubusercontent.com/u/130393?v=3","gravatar_id":"","url":"https://api.github.com/users/simon3z","html_url":"https://github.com/simon3z","followers_url":"https://api.github.com/users/simon3z/followers","following_url":"https://api.github.com/users/simon3z/following{/other_user}","gists_url":"https://api.github.com/users/simon3z/gists{/gist_id}","starred_url":"https://api.github.com/users/simon3z/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simon3z/subscriptions","organizations_url":"https://api.github.com/users/simon3z/orgs","repos_url":"https://api.github.com/users/simon3z/repos","events_url":"https://api.github.com/users/simon3z/events{/privacy}","received_events_url":"https://api.github.com/users/simon3z/received_events","type":"User","site_admin":false},"body":"@enoodle this is missing a `\\n`","created_at":"2016-03-15T08:46:38Z","updated_at":"2016-03-15T08:46:38Z","html_url":"https://github.com/simon3z/image-inspector/pull/1#discussion_r56130265","pull_request_url":"https://api.github.com/repos/simon3z/image-inspector/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/simon3z/image-inspector/pulls/comments/56130265"},"html":{"href":"https://github.com/simon3z/image-inspector/pull/1#discussion_r56130265"},"pull_request":{"href":"https://api.github.com/repos/simon3z/image-inspector/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/simon3z/image-inspector/pulls/1","id":61849568,"html_url":"https://github.com/simon3z/image-inspector/pull/1","diff_url":"https://github.com/simon3z/image-inspector/pull/1.diff","patch_url":"https://github.com/simon3z/image-inspector/pull/1.patch","issue_url":"https://api.github.com/repos/simon3z/image-inspector/issues/1","number":1,"state":"open","locked":false,"title":"authentication: Added an option to read from dockercfg file","user":{"login":"enoodle","id":3123328,"avatar_url":"https://avatars.githubusercontent.com/u/3123328?v=3","gravatar_id":"","url":"https://api.github.com/users/enoodle","html_url":"https://github.com/enoodle","followers_url":"https://api.github.com/users/enoodle/followers","following_url":"https://api.github.com/users/enoodle/following{/other_user}","gists_url":"https://api.github.com/users/enoodle/gists{/gist_id}","starred_url":"https://api.github.com/users/enoodle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enoodle/subscriptions","organizations_url":"https://api.github.com/users/enoodle/orgs","repos_url":"https://api.github.com/users/enoodle/repos","events_url":"https://api.github.com/users/enoodle/events{/privacy}","received_events_url":"https://api.github.com/users/enoodle/received_events","type":"User","site_admin":false},"body":"This will allow us to authenticate to local docker repository with credentials from the dockercfg file.","created_at":"2016-03-06T18:00:36Z","updated_at":"2016-03-15T08:46:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"387ce1251ef9da9c05136b0c301bcc08d0a44aca","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/simon3z/image-inspector/pulls/1/commits","review_comments_url":"https://api.github.com/repos/simon3z/image-inspector/pulls/1/comments","review_comment_url":"https://api.github.com/repos/simon3z/image-inspector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simon3z/image-inspector/issues/1/comments","statuses_url":"https://api.github.com/repos/simon3z/image-inspector/statuses/c26b64d85989f5b446feed5981b7f2a75ae8192f","head":{"label":"enoodle:add_docker_config_auth","ref":"add_docker_config_auth","sha":"c26b64d85989f5b446feed5981b7f2a75ae8192f","user":{"login":"enoodle","id":3123328,"avatar_url":"https://avatars.githubusercontent.com/u/3123328?v=3","gravatar_id":"","url":"https://api.github.com/users/enoodle","html_url":"https://github.com/enoodle","followers_url":"https://api.github.com/users/enoodle/followers","following_url":"https://api.github.com/users/enoodle/following{/other_user}","gists_url":"https://api.github.com/users/enoodle/gists{/gist_id}","starred_url":"https://api.github.com/users/enoodle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enoodle/subscriptions","organizations_url":"https://api.github.com/users/enoodle/orgs","repos_url":"https://api.github.com/users/enoodle/repos","events_url":"https://api.github.com/users/enoodle/events{/privacy}","received_events_url":"https://api.github.com/users/enoodle/received_events","type":"User","site_admin":false},"repo":{"id":52202851,"name":"image-inspector","full_name":"enoodle/image-inspector","owner":{"login":"enoodle","id":3123328,"avatar_url":"https://avatars.githubusercontent.com/u/3123328?v=3","gravatar_id":"","url":"https://api.github.com/users/enoodle","html_url":"https://github.com/enoodle","followers_url":"https://api.github.com/users/enoodle/followers","following_url":"https://api.github.com/users/enoodle/following{/other_user}","gists_url":"https://api.github.com/users/enoodle/gists{/gist_id}","starred_url":"https://api.github.com/users/enoodle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enoodle/subscriptions","organizations_url":"https://api.github.com/users/enoodle/orgs","repos_url":"https://api.github.com/users/enoodle/repos","events_url":"https://api.github.com/users/enoodle/events{/privacy}","received_events_url":"https://api.github.com/users/enoodle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/enoodle/image-inspector","description":"","fork":true,"url":"https://api.github.com/repos/enoodle/image-inspector","forks_url":"https://api.github.com/repos/enoodle/image-inspector/forks","keys_url":"https://api.github.com/repos/enoodle/image-inspector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enoodle/image-inspector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enoodle/image-inspector/teams","hooks_url":"https://api.github.com/repos/enoodle/image-inspector/hooks","issue_events_url":"https://api.github.com/repos/enoodle/image-inspector/issues/events{/number}","events_url":"https://api.github.com/repos/enoodle/image-inspector/events","assignees_url":"https://api.github.com/repos/enoodle/image-inspector/assignees{/user}","branches_url":"https://api.github.com/repos/enoodle/image-inspector/branches{/branch}","tags_url":"https://api.github.com/repos/enoodle/image-inspector/tags","blobs_url":"https://api.github.com/repos/enoodle/image-inspector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enoodle/image-inspector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enoodle/image-inspector/git/refs{/sha}","trees_url":"https://api.github.com/repos/enoodle/image-inspector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enoodle/image-inspector/statuses/{sha}","languages_url":"https://api.github.com/repos/enoodle/image-inspector/languages","stargazers_url":"https://api.github.com/repos/enoodle/image-inspector/stargazers","contributors_url":"https://api.github.com/repos/enoodle/image-inspector/contributors","subscribers_url":"https://api.github.com/repos/enoodle/image-inspector/subscribers","subscription_url":"https://api.github.com/repos/enoodle/image-inspector/subscription","commits_url":"https://api.github.com/repos/enoodle/image-inspector/commits{/sha}","git_commits_url":"https://api.github.com/repos/enoodle/image-inspector/git/commits{/sha}","comments_url":"https://api.github.com/repos/enoodle/image-inspector/comments{/number}","issue_comment_url":"https://api.github.com/repos/enoodle/image-inspector/issues/comments{/number}","contents_url":"https://api.github.com/repos/enoodle/image-inspector/contents/{+path}","compare_url":"https://api.github.com/repos/enoodle/image-inspector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enoodle/image-inspector/merges","archive_url":"https://api.github.com/repos/enoodle/image-inspector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enoodle/image-inspector/downloads","issues_url":"https://api.github.com/repos/enoodle/image-inspector/issues{/number}","pulls_url":"https://api.github.com/repos/enoodle/image-inspector/pulls{/number}","milestones_url":"https://api.github.com/repos/enoodle/image-inspector/milestones{/number}","notifications_url":"https://api.github.com/repos/enoodle/image-inspector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enoodle/image-inspector/labels{/name}","releases_url":"https://api.github.com/repos/enoodle/image-inspector/releases{/id}","deployments_url":"https://api.github.com/repos/enoodle/image-inspector/deployments","created_at":"2016-02-21T11:13:01Z","updated_at":"2016-02-21T11:13:02Z","pushed_at":"2016-03-11T13:43:50Z","git_url":"git://github.com/enoodle/image-inspector.git","ssh_url":"git@github.com:enoodle/image-inspector.git","clone_url":"https://github.com/enoodle/image-inspector.git","svn_url":"https://github.com/enoodle/image-inspector","homepage":null,"size":406,"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":"simon3z:master","ref":"master","sha":"c0e5fcd139df83110c5464ba99d54029c0d7f16c","user":{"login":"simon3z","id":130393,"avatar_url":"https://avatars.githubusercontent.com/u/130393?v=3","gravatar_id":"","url":"https://api.github.com/users/simon3z","html_url":"https://github.com/simon3z","followers_url":"https://api.github.com/users/simon3z/followers","following_url":"https://api.github.com/users/simon3z/following{/other_user}","gists_url":"https://api.github.com/users/simon3z/gists{/gist_id}","starred_url":"https://api.github.com/users/simon3z/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simon3z/subscriptions","organizations_url":"https://api.github.com/users/simon3z/orgs","repos_url":"https://api.github.com/users/simon3z/repos","events_url":"https://api.github.com/users/simon3z/events{/privacy}","received_events_url":"https://api.github.com/users/simon3z/received_events","type":"User","site_admin":false},"repo":{"id":36006291,"name":"image-inspector","full_name":"simon3z/image-inspector","owner":{"login":"simon3z","id":130393,"avatar_url":"https://avatars.githubusercontent.com/u/130393?v=3","gravatar_id":"","url":"https://api.github.com/users/simon3z","html_url":"https://github.com/simon3z","followers_url":"https://api.github.com/users/simon3z/followers","following_url":"https://api.github.com/users/simon3z/following{/other_user}","gists_url":"https://api.github.com/users/simon3z/gists{/gist_id}","starred_url":"https://api.github.com/users/simon3z/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simon3z/subscriptions","organizations_url":"https://api.github.com/users/simon3z/orgs","repos_url":"https://api.github.com/users/simon3z/repos","events_url":"https://api.github.com/users/simon3z/events{/privacy}","received_events_url":"https://api.github.com/users/simon3z/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/simon3z/image-inspector","description":"","fork":false,"url":"https://api.github.com/repos/simon3z/image-inspector","forks_url":"https://api.github.com/repos/simon3z/image-inspector/forks","keys_url":"https://api.github.com/repos/simon3z/image-inspector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simon3z/image-inspector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simon3z/image-inspector/teams","hooks_url":"https://api.github.com/repos/simon3z/image-inspector/hooks","issue_events_url":"https://api.github.com/repos/simon3z/image-inspector/issues/events{/number}","events_url":"https://api.github.com/repos/simon3z/image-inspector/events","assignees_url":"https://api.github.com/repos/simon3z/image-inspector/assignees{/user}","branches_url":"https://api.github.com/repos/simon3z/image-inspector/branches{/branch}","tags_url":"https://api.github.com/repos/simon3z/image-inspector/tags","blobs_url":"https://api.github.com/repos/simon3z/image-inspector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simon3z/image-inspector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simon3z/image-inspector/git/refs{/sha}","trees_url":"https://api.github.com/repos/simon3z/image-inspector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simon3z/image-inspector/statuses/{sha}","languages_url":"https://api.github.com/repos/simon3z/image-inspector/languages","stargazers_url":"https://api.github.com/repos/simon3z/image-inspector/stargazers","contributors_url":"https://api.github.com/repos/simon3z/image-inspector/contributors","subscribers_url":"https://api.github.com/repos/simon3z/image-inspector/subscribers","subscription_url":"https://api.github.com/repos/simon3z/image-inspector/subscription","commits_url":"https://api.github.com/repos/simon3z/image-inspector/commits{/sha}","git_commits_url":"https://api.github.com/repos/simon3z/image-inspector/git/commits{/sha}","comments_url":"https://api.github.com/repos/simon3z/image-inspector/comments{/number}","issue_comment_url":"https://api.github.com/repos/simon3z/image-inspector/issues/comments{/number}","contents_url":"https://api.github.com/repos/simon3z/image-inspector/contents/{+path}","compare_url":"https://api.github.com/repos/simon3z/image-inspector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simon3z/image-inspector/merges","archive_url":"https://api.github.com/repos/simon3z/image-inspector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simon3z/image-inspector/downloads","issues_url":"https://api.github.com/repos/simon3z/image-inspector/issues{/number}","pulls_url":"https://api.github.com/repos/simon3z/image-inspector/pulls{/number}","milestones_url":"https://api.github.com/repos/simon3z/image-inspector/milestones{/number}","notifications_url":"https://api.github.com/repos/simon3z/image-inspector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simon3z/image-inspector/labels{/name}","releases_url":"https://api.github.com/repos/simon3z/image-inspector/releases{/id}","deployments_url":"https://api.github.com/repos/simon3z/image-inspector/deployments","created_at":"2015-05-21T10:21:57Z","updated_at":"2016-03-14T16:38:16Z","pushed_at":"2016-03-11T13:43:24Z","git_url":"git://github.com/simon3z/image-inspector.git","ssh_url":"git@github.com:simon3z/image-inspector.git","clone_url":"https://github.com/simon3z/image-inspector.git","svn_url":"https://github.com/simon3z/image-inspector","homepage":null,"size":404,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":1,"forks":6,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simon3z/image-inspector/pulls/1"},"html":{"href":"https://github.com/simon3z/image-inspector/pull/1"},"issue":{"href":"https://api.github.com/repos/simon3z/image-inspector/issues/1"},"comments":{"href":"https://api.github.com/repos/simon3z/image-inspector/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/simon3z/image-inspector/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/simon3z/image-inspector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simon3z/image-inspector/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/simon3z/image-inspector/statuses/c26b64d85989f5b446feed5981b7f2a75ae8192f"}}}}