{"action":"created","comment":{"url":"https://api.github.com/repos/pachyderm/pachyderm/pulls/comments/34960400","id":34960400,"diff_hunk":"@@ -89,3 +89,23 @@ func waitContainer(id string) (int, error) {\n \n \treturn client.WaitContainer(id)\n }\n+\n+func isImageLocal(image string) bool {\n+\trepository := strings.Split(image, \":\")\n+\tclient, err := docker.NewClientFromEnv()\n+\tif err != nil {\n+\t\treturn false\n+\t}\n+\timages, err := client.ListImages(docker.ListImagesOptions{All: true, Digests: false})\n+\tif err != nil {\n+\t\treturn false\n+\t}\n+\n+\tfor _, image := range images {\n+\t\tif image.ID == repository[0] {\n+\t\t\treturn true\n+\t\t}\n+\t}\n+","path":"src/pipeline/container.go","position":21,"original_position":21,"commit_id":"b3abdc2157de8b02ecfdb0f92b2d91813e0c3d4b","original_commit_id":"62d253f2b15a38adb5716c51404aa909ca43351c","user":{"login":"peter-edge","id":4228796,"avatar_url":"https://avatars.githubusercontent.com/u/4228796?v=3","gravatar_id":"","url":"https://api.github.com/users/peter-edge","html_url":"https://github.com/peter-edge","followers_url":"https://api.github.com/users/peter-edge/followers","following_url":"https://api.github.com/users/peter-edge/following{/other_user}","gists_url":"https://api.github.com/users/peter-edge/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-edge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-edge/subscriptions","organizations_url":"https://api.github.com/users/peter-edge/orgs","repos_url":"https://api.github.com/users/peter-edge/repos","events_url":"https://api.github.com/users/peter-edge/events{/privacy}","received_events_url":"https://api.github.com/users/peter-edge/received_events","type":"User","site_admin":false},"body":"Nit: not a fan of the extra newlines, can you remove them :)","created_at":"2015-07-19T18:02:23Z","updated_at":"2015-07-19T18:02:23Z","html_url":"https://github.com/pachyderm/pachyderm/pull/124#discussion_r34960400","pull_request_url":"https://api.github.com/repos/pachyderm/pachyderm/pulls/124","_links":{"self":{"href":"https://api.github.com/repos/pachyderm/pachyderm/pulls/comments/34960400"},"html":{"href":"https://github.com/pachyderm/pachyderm/pull/124#discussion_r34960400"},"pull_request":{"href":"https://api.github.com/repos/pachyderm/pachyderm/pulls/124"}}},"pull_request":{"url":"https://api.github.com/repos/pachyderm/pachyderm/pulls/124","id":40312165,"html_url":"https://github.com/pachyderm/pachyderm/pull/124","diff_url":"https://github.com/pachyderm/pachyderm/pull/124.diff","patch_url":"https://github.com/pachyderm/pachyderm/pull/124.patch","issue_url":"https://api.github.com/repos/pachyderm/pachyderm/issues/124","number":124,"state":"open","locked":false,"title":"Check if image is local","user":{"login":"phacops","id":336345,"avatar_url":"https://avatars.githubusercontent.com/u/336345?v=3","gravatar_id":"","url":"https://api.github.com/users/phacops","html_url":"https://github.com/phacops","followers_url":"https://api.github.com/users/phacops/followers","following_url":"https://api.github.com/users/phacops/following{/other_user}","gists_url":"https://api.github.com/users/phacops/gists{/gist_id}","starred_url":"https://api.github.com/users/phacops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phacops/subscriptions","organizations_url":"https://api.github.com/users/phacops/orgs","repos_url":"https://api.github.com/users/phacops/repos","events_url":"https://api.github.com/users/phacops/events{/privacy}","received_events_url":"https://api.github.com/users/phacops/received_events","type":"User","site_admin":false},"body":"We need to check if the image is local in case it's not pullage from the registry. This fixes https://github.com/pachyderm/pachyderm/issues/105.\r\n\r\nI'm using docker client to list all images and make a check against the list. If the image is in the list, we're up for business, otherwise, I throw an error saying we couldn't find the image.\r\n\r\nI don't think there is any test about this so I may have to add one.","created_at":"2015-07-19T17:53:24Z","updated_at":"2015-07-19T18:02:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2458766f58d892c6efb8c0b1e86a40bfa55f43d0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pachyderm/pachyderm/pulls/124/commits","review_comments_url":"https://api.github.com/repos/pachyderm/pachyderm/pulls/124/comments","review_comment_url":"https://api.github.com/repos/pachyderm/pachyderm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pachyderm/pachyderm/issues/124/comments","statuses_url":"https://api.github.com/repos/pachyderm/pachyderm/statuses/b3abdc2157de8b02ecfdb0f92b2d91813e0c3d4b","head":{"label":"phacops:check-if-image-is-local","ref":"check-if-image-is-local","sha":"b3abdc2157de8b02ecfdb0f92b2d91813e0c3d4b","user":{"login":"phacops","id":336345,"avatar_url":"https://avatars.githubusercontent.com/u/336345?v=3","gravatar_id":"","url":"https://api.github.com/users/phacops","html_url":"https://github.com/phacops","followers_url":"https://api.github.com/users/phacops/followers","following_url":"https://api.github.com/users/phacops/following{/other_user}","gists_url":"https://api.github.com/users/phacops/gists{/gist_id}","starred_url":"https://api.github.com/users/phacops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phacops/subscriptions","organizations_url":"https://api.github.com/users/phacops/orgs","repos_url":"https://api.github.com/users/phacops/repos","events_url":"https://api.github.com/users/phacops/events{/privacy}","received_events_url":"https://api.github.com/users/phacops/received_events","type":"User","site_admin":false},"repo":{"id":37227361,"name":"pachyderm","full_name":"phacops/pachyderm","owner":{"login":"phacops","id":336345,"avatar_url":"https://avatars.githubusercontent.com/u/336345?v=3","gravatar_id":"","url":"https://api.github.com/users/phacops","html_url":"https://github.com/phacops","followers_url":"https://api.github.com/users/phacops/followers","following_url":"https://api.github.com/users/phacops/following{/other_user}","gists_url":"https://api.github.com/users/phacops/gists{/gist_id}","starred_url":"https://api.github.com/users/phacops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phacops/subscriptions","organizations_url":"https://api.github.com/users/phacops/orgs","repos_url":"https://api.github.com/users/phacops/repos","events_url":"https://api.github.com/users/phacops/events{/privacy}","received_events_url":"https://api.github.com/users/phacops/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phacops/pachyderm","description":"A git-like distributed file system for a Dockerized world.","fork":true,"url":"https://api.github.com/repos/phacops/pachyderm","forks_url":"https://api.github.com/repos/phacops/pachyderm/forks","keys_url":"https://api.github.com/repos/phacops/pachyderm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phacops/pachyderm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phacops/pachyderm/teams","hooks_url":"https://api.github.com/repos/phacops/pachyderm/hooks","issue_events_url":"https://api.github.com/repos/phacops/pachyderm/issues/events{/number}","events_url":"https://api.github.com/repos/phacops/pachyderm/events","assignees_url":"https://api.github.com/repos/phacops/pachyderm/assignees{/user}","branches_url":"https://api.github.com/repos/phacops/pachyderm/branches{/branch}","tags_url":"https://api.github.com/repos/phacops/pachyderm/tags","blobs_url":"https://api.github.com/repos/phacops/pachyderm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phacops/pachyderm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phacops/pachyderm/git/refs{/sha}","trees_url":"https://api.github.com/repos/phacops/pachyderm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phacops/pachyderm/statuses/{sha}","languages_url":"https://api.github.com/repos/phacops/pachyderm/languages","stargazers_url":"https://api.github.com/repos/phacops/pachyderm/stargazers","contributors_url":"https://api.github.com/repos/phacops/pachyderm/contributors","subscribers_url":"https://api.github.com/repos/phacops/pachyderm/subscribers","subscription_url":"https://api.github.com/repos/phacops/pachyderm/subscription","commits_url":"https://api.github.com/repos/phacops/pachyderm/commits{/sha}","git_commits_url":"https://api.github.com/repos/phacops/pachyderm/git/commits{/sha}","comments_url":"https://api.github.com/repos/phacops/pachyderm/comments{/number}","issue_comment_url":"https://api.github.com/repos/phacops/pachyderm/issues/comments{/number}","contents_url":"https://api.github.com/repos/phacops/pachyderm/contents/{+path}","compare_url":"https://api.github.com/repos/phacops/pachyderm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phacops/pachyderm/merges","archive_url":"https://api.github.com/repos/phacops/pachyderm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phacops/pachyderm/downloads","issues_url":"https://api.github.com/repos/phacops/pachyderm/issues{/number}","pulls_url":"https://api.github.com/repos/phacops/pachyderm/pulls{/number}","milestones_url":"https://api.github.com/repos/phacops/pachyderm/milestones{/number}","notifications_url":"https://api.github.com/repos/phacops/pachyderm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phacops/pachyderm/labels{/name}","releases_url":"https://api.github.com/repos/phacops/pachyderm/releases{/id}","created_at":"2015-06-10T23:06:38Z","updated_at":"2015-07-08T18:49:57Z","pushed_at":"2015-07-19T18:00:48Z","git_url":"git://github.com/phacops/pachyderm.git","ssh_url":"git@github.com:phacops/pachyderm.git","clone_url":"https://github.com/phacops/pachyderm.git","svn_url":"https://github.com/phacops/pachyderm","homepage":"","size":2141,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pachyderm:master","ref":"master","sha":"b93444be799a92b9f71e298054de104959f05019","user":{"login":"pachyderm","id":10432478,"avatar_url":"https://avatars.githubusercontent.com/u/10432478?v=3","gravatar_id":"","url":"https://api.github.com/users/pachyderm","html_url":"https://github.com/pachyderm","followers_url":"https://api.github.com/users/pachyderm/followers","following_url":"https://api.github.com/users/pachyderm/following{/other_user}","gists_url":"https://api.github.com/users/pachyderm/gists{/gist_id}","starred_url":"https://api.github.com/users/pachyderm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pachyderm/subscriptions","organizations_url":"https://api.github.com/users/pachyderm/orgs","repos_url":"https://api.github.com/users/pachyderm/repos","events_url":"https://api.github.com/users/pachyderm/events{/privacy}","received_events_url":"https://api.github.com/users/pachyderm/received_events","type":"Organization","site_admin":false},"repo":{"id":23653453,"name":"pachyderm","full_name":"pachyderm/pachyderm","owner":{"login":"pachyderm","id":10432478,"avatar_url":"https://avatars.githubusercontent.com/u/10432478?v=3","gravatar_id":"","url":"https://api.github.com/users/pachyderm","html_url":"https://github.com/pachyderm","followers_url":"https://api.github.com/users/pachyderm/followers","following_url":"https://api.github.com/users/pachyderm/following{/other_user}","gists_url":"https://api.github.com/users/pachyderm/gists{/gist_id}","starred_url":"https://api.github.com/users/pachyderm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pachyderm/subscriptions","organizations_url":"https://api.github.com/users/pachyderm/orgs","repos_url":"https://api.github.com/users/pachyderm/repos","events_url":"https://api.github.com/users/pachyderm/events{/privacy}","received_events_url":"https://api.github.com/users/pachyderm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pachyderm/pachyderm","description":"Containerized Data Analytics","fork":false,"url":"https://api.github.com/repos/pachyderm/pachyderm","forks_url":"https://api.github.com/repos/pachyderm/pachyderm/forks","keys_url":"https://api.github.com/repos/pachyderm/pachyderm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pachyderm/pachyderm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pachyderm/pachyderm/teams","hooks_url":"https://api.github.com/repos/pachyderm/pachyderm/hooks","issue_events_url":"https://api.github.com/repos/pachyderm/pachyderm/issues/events{/number}","events_url":"https://api.github.com/repos/pachyderm/pachyderm/events","assignees_url":"https://api.github.com/repos/pachyderm/pachyderm/assignees{/user}","branches_url":"https://api.github.com/repos/pachyderm/pachyderm/branches{/branch}","tags_url":"https://api.github.com/repos/pachyderm/pachyderm/tags","blobs_url":"https://api.github.com/repos/pachyderm/pachyderm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pachyderm/pachyderm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pachyderm/pachyderm/git/refs{/sha}","trees_url":"https://api.github.com/repos/pachyderm/pachyderm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pachyderm/pachyderm/statuses/{sha}","languages_url":"https://api.github.com/repos/pachyderm/pachyderm/languages","stargazers_url":"https://api.github.com/repos/pachyderm/pachyderm/stargazers","contributors_url":"https://api.github.com/repos/pachyderm/pachyderm/contributors","subscribers_url":"https://api.github.com/repos/pachyderm/pachyderm/subscribers","subscription_url":"https://api.github.com/repos/pachyderm/pachyderm/subscription","commits_url":"https://api.github.com/repos/pachyderm/pachyderm/commits{/sha}","git_commits_url":"https://api.github.com/repos/pachyderm/pachyderm/git/commits{/sha}","comments_url":"https://api.github.com/repos/pachyderm/pachyderm/comments{/number}","issue_comment_url":"https://api.github.com/repos/pachyderm/pachyderm/issues/comments{/number}","contents_url":"https://api.github.com/repos/pachyderm/pachyderm/contents/{+path}","compare_url":"https://api.github.com/repos/pachyderm/pachyderm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pachyderm/pachyderm/merges","archive_url":"https://api.github.com/repos/pachyderm/pachyderm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pachyderm/pachyderm/downloads","issues_url":"https://api.github.com/repos/pachyderm/pachyderm/issues{/number}","pulls_url":"https://api.github.com/repos/pachyderm/pachyderm/pulls{/number}","milestones_url":"https://api.github.com/repos/pachyderm/pachyderm/milestones{/number}","notifications_url":"https://api.github.com/repos/pachyderm/pachyderm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pachyderm/pachyderm/labels{/name}","releases_url":"https://api.github.com/repos/pachyderm/pachyderm/releases{/id}","created_at":"2014-09-04T07:50:02Z","updated_at":"2015-07-16T20:30:12Z","pushed_at":"2015-07-19T18:00:48Z","git_url":"git://github.com/pachyderm/pachyderm.git","ssh_url":"git@github.com:pachyderm/pachyderm.git","clone_url":"https://github.com/pachyderm/pachyderm.git","svn_url":"https://github.com/pachyderm/pachyderm","homepage":"Http://www.pachyderm.io","size":6322,"stargazers_count":775,"watchers_count":775,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":22,"forks":40,"open_issues":22,"watchers":775,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pachyderm/pachyderm/pulls/124"},"html":{"href":"https://github.com/pachyderm/pachyderm/pull/124"},"issue":{"href":"https://api.github.com/repos/pachyderm/pachyderm/issues/124"},"comments":{"href":"https://api.github.com/repos/pachyderm/pachyderm/issues/124/comments"},"review_comments":{"href":"https://api.github.com/repos/pachyderm/pachyderm/pulls/124/comments"},"review_comment":{"href":"https://api.github.com/repos/pachyderm/pachyderm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pachyderm/pachyderm/pulls/124/commits"},"statuses":{"href":"https://api.github.com/repos/pachyderm/pachyderm/statuses/b3abdc2157de8b02ecfdb0f92b2d91813e0c3d4b"}}}}