{"action":"created","comment":{"url":"https://api.github.com/repos/rancherio/cattle/pulls/comments/31562887","id":31562887,"diff_hunk":"@@ -47,4 +68,46 @@ public HandlerResult handle(ProcessState state, ProcessInstance process) {\n \n         return new HandlerResult(InstanceConstants.FIELD_NETWORK_IDS, Arrays.asList(network.getId())).withShouldContinue(true);\n     }\n+\n+    private void createImageAndPickCredential(Instance instance) {\n+        String uuid = (String) DataAccessor.fields(instance).withKey(InstanceConstants.FIELD_IMAGE_UUID).get();\n+        Image image = storageService.registerRemoteImage(uuid);\n+        if (image != null) {\n+            instance.setImageId(image.getId());\n+        }\n+        pickRegCredential(instance);","path":"code/implementation/docker/compute/src/main/java/io/cattle/platform/docker/process/instance/DockerInstancePreCreate.java","position":67,"original_position":67,"commit_id":"e666ae195da3502c504c9b73ce7b5de59ebe776d","original_commit_id":"e666ae195da3502c504c9b73ce7b5de59ebe776d","user":{"login":"ibuildthecloud","id":1754002,"avatar_url":"https://avatars.githubusercontent.com/u/1754002?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuildthecloud","html_url":"https://github.com/ibuildthecloud","followers_url":"https://api.github.com/users/ibuildthecloud/followers","following_url":"https://api.github.com/users/ibuildthecloud/following{/other_user}","gists_url":"https://api.github.com/users/ibuildthecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuildthecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuildthecloud/subscriptions","organizations_url":"https://api.github.com/users/ibuildthecloud/orgs","repos_url":"https://api.github.com/users/ibuildthecloud/repos","events_url":"https://api.github.com/users/ibuildthecloud/events{/privacy}","received_events_url":"https://api.github.com/users/ibuildthecloud/received_events","type":"User","site_admin":false},"body":"only call pickRegCred is image != null","created_at":"2015-06-02T19:46:07Z","updated_at":"2015-06-02T19:46:07Z","html_url":"https://github.com/rancherio/cattle/pull/525#discussion_r31562887","pull_request_url":"https://api.github.com/repos/rancherio/cattle/pulls/525","_links":{"self":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/comments/31562887"},"html":{"href":"https://github.com/rancherio/cattle/pull/525#discussion_r31562887"},"pull_request":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/525"}}},"pull_request":{"url":"https://api.github.com/repos/rancherio/cattle/pulls/525","id":36528554,"html_url":"https://github.com/rancherio/cattle/pull/525","diff_url":"https://github.com/rancherio/cattle/pull/525.diff","patch_url":"https://github.com/rancherio/cattle/pull/525.patch","issue_url":"https://api.github.com/repos/rancherio/cattle/issues/525","number":525,"state":"open","locked":false,"title":"Create images on instance precreate and pick credentials.","user":{"login":"hibooboo2","id":1197823,"avatar_url":"https://avatars.githubusercontent.com/u/1197823?v=3","gravatar_id":"","url":"https://api.github.com/users/hibooboo2","html_url":"https://github.com/hibooboo2","followers_url":"https://api.github.com/users/hibooboo2/followers","following_url":"https://api.github.com/users/hibooboo2/following{/other_user}","gists_url":"https://api.github.com/users/hibooboo2/gists{/gist_id}","starred_url":"https://api.github.com/users/hibooboo2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hibooboo2/subscriptions","organizations_url":"https://api.github.com/users/hibooboo2/orgs","repos_url":"https://api.github.com/users/hibooboo2/repos","events_url":"https://api.github.com/users/hibooboo2/events{/privacy}","received_events_url":"https://api.github.com/users/hibooboo2/received_events","type":"User","site_admin":false},"body":"Do not do a mapping of images to hostmaps. Still validate instance uuid in ExternalTemplateInstanceFilter.","created_at":"2015-05-29T17:45:45Z","updated_at":"2015-06-02T19:46:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70fd6eb0e094b3a15a49ee3e5406d48294fff915","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rancherio/cattle/pulls/525/commits","review_comments_url":"https://api.github.com/repos/rancherio/cattle/pulls/525/comments","review_comment_url":"https://api.github.com/repos/rancherio/cattle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rancherio/cattle/issues/525/comments","statuses_url":"https://api.github.com/repos/rancherio/cattle/statuses/e666ae195da3502c504c9b73ce7b5de59ebe776d","head":{"label":"hibooboo2:pick_registry_credential_on_instance_create","ref":"pick_registry_credential_on_instance_create","sha":"e666ae195da3502c504c9b73ce7b5de59ebe776d","user":{"login":"hibooboo2","id":1197823,"avatar_url":"https://avatars.githubusercontent.com/u/1197823?v=3","gravatar_id":"","url":"https://api.github.com/users/hibooboo2","html_url":"https://github.com/hibooboo2","followers_url":"https://api.github.com/users/hibooboo2/followers","following_url":"https://api.github.com/users/hibooboo2/following{/other_user}","gists_url":"https://api.github.com/users/hibooboo2/gists{/gist_id}","starred_url":"https://api.github.com/users/hibooboo2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hibooboo2/subscriptions","organizations_url":"https://api.github.com/users/hibooboo2/orgs","repos_url":"https://api.github.com/users/hibooboo2/repos","events_url":"https://api.github.com/users/hibooboo2/events{/privacy}","received_events_url":"https://api.github.com/users/hibooboo2/received_events","type":"User","site_admin":false},"repo":{"id":29162693,"name":"cattle","full_name":"hibooboo2/cattle","owner":{"login":"hibooboo2","id":1197823,"avatar_url":"https://avatars.githubusercontent.com/u/1197823?v=3","gravatar_id":"","url":"https://api.github.com/users/hibooboo2","html_url":"https://github.com/hibooboo2","followers_url":"https://api.github.com/users/hibooboo2/followers","following_url":"https://api.github.com/users/hibooboo2/following{/other_user}","gists_url":"https://api.github.com/users/hibooboo2/gists{/gist_id}","starred_url":"https://api.github.com/users/hibooboo2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hibooboo2/subscriptions","organizations_url":"https://api.github.com/users/hibooboo2/orgs","repos_url":"https://api.github.com/users/hibooboo2/repos","events_url":"https://api.github.com/users/hibooboo2/events{/privacy}","received_events_url":"https://api.github.com/users/hibooboo2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hibooboo2/cattle","description":"Infrastructure orchestration platform","fork":true,"url":"https://api.github.com/repos/hibooboo2/cattle","forks_url":"https://api.github.com/repos/hibooboo2/cattle/forks","keys_url":"https://api.github.com/repos/hibooboo2/cattle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hibooboo2/cattle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hibooboo2/cattle/teams","hooks_url":"https://api.github.com/repos/hibooboo2/cattle/hooks","issue_events_url":"https://api.github.com/repos/hibooboo2/cattle/issues/events{/number}","events_url":"https://api.github.com/repos/hibooboo2/cattle/events","assignees_url":"https://api.github.com/repos/hibooboo2/cattle/assignees{/user}","branches_url":"https://api.github.com/repos/hibooboo2/cattle/branches{/branch}","tags_url":"https://api.github.com/repos/hibooboo2/cattle/tags","blobs_url":"https://api.github.com/repos/hibooboo2/cattle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hibooboo2/cattle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hibooboo2/cattle/git/refs{/sha}","trees_url":"https://api.github.com/repos/hibooboo2/cattle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hibooboo2/cattle/statuses/{sha}","languages_url":"https://api.github.com/repos/hibooboo2/cattle/languages","stargazers_url":"https://api.github.com/repos/hibooboo2/cattle/stargazers","contributors_url":"https://api.github.com/repos/hibooboo2/cattle/contributors","subscribers_url":"https://api.github.com/repos/hibooboo2/cattle/subscribers","subscription_url":"https://api.github.com/repos/hibooboo2/cattle/subscription","commits_url":"https://api.github.com/repos/hibooboo2/cattle/commits{/sha}","git_commits_url":"https://api.github.com/repos/hibooboo2/cattle/git/commits{/sha}","comments_url":"https://api.github.com/repos/hibooboo2/cattle/comments{/number}","issue_comment_url":"https://api.github.com/repos/hibooboo2/cattle/issues/comments{/number}","contents_url":"https://api.github.com/repos/hibooboo2/cattle/contents/{+path}","compare_url":"https://api.github.com/repos/hibooboo2/cattle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hibooboo2/cattle/merges","archive_url":"https://api.github.com/repos/hibooboo2/cattle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hibooboo2/cattle/downloads","issues_url":"https://api.github.com/repos/hibooboo2/cattle/issues{/number}","pulls_url":"https://api.github.com/repos/hibooboo2/cattle/pulls{/number}","milestones_url":"https://api.github.com/repos/hibooboo2/cattle/milestones{/number}","notifications_url":"https://api.github.com/repos/hibooboo2/cattle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hibooboo2/cattle/labels{/name}","releases_url":"https://api.github.com/repos/hibooboo2/cattle/releases{/id}","created_at":"2015-01-12T23:33:21Z","updated_at":"2015-05-05T18:29:09Z","pushed_at":"2015-06-02T19:15:12Z","git_url":"git://github.com/hibooboo2/cattle.git","ssh_url":"git@github.com:hibooboo2/cattle.git","clone_url":"https://github.com/hibooboo2/cattle.git","svn_url":"https://github.com/hibooboo2/cattle","homepage":"","size":19979,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"drone-slack"}},"base":{"label":"rancherio:master","ref":"master","sha":"7192b6d9f58863126903817b0e4159c4b1f00a88","user":{"login":"rancherio","id":9343010,"avatar_url":"https://avatars.githubusercontent.com/u/9343010?v=3","gravatar_id":"","url":"https://api.github.com/users/rancherio","html_url":"https://github.com/rancherio","followers_url":"https://api.github.com/users/rancherio/followers","following_url":"https://api.github.com/users/rancherio/following{/other_user}","gists_url":"https://api.github.com/users/rancherio/gists{/gist_id}","starred_url":"https://api.github.com/users/rancherio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rancherio/subscriptions","organizations_url":"https://api.github.com/users/rancherio/orgs","repos_url":"https://api.github.com/users/rancherio/repos","events_url":"https://api.github.com/users/rancherio/events{/privacy}","received_events_url":"https://api.github.com/users/rancherio/received_events","type":"Organization","site_admin":false},"repo":{"id":18023059,"name":"cattle","full_name":"rancherio/cattle","owner":{"login":"rancherio","id":9343010,"avatar_url":"https://avatars.githubusercontent.com/u/9343010?v=3","gravatar_id":"","url":"https://api.github.com/users/rancherio","html_url":"https://github.com/rancherio","followers_url":"https://api.github.com/users/rancherio/followers","following_url":"https://api.github.com/users/rancherio/following{/other_user}","gists_url":"https://api.github.com/users/rancherio/gists{/gist_id}","starred_url":"https://api.github.com/users/rancherio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rancherio/subscriptions","organizations_url":"https://api.github.com/users/rancherio/orgs","repos_url":"https://api.github.com/users/rancherio/repos","events_url":"https://api.github.com/users/rancherio/events{/privacy}","received_events_url":"https://api.github.com/users/rancherio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rancherio/cattle","description":"Infrastructure orchestration platform","fork":false,"url":"https://api.github.com/repos/rancherio/cattle","forks_url":"https://api.github.com/repos/rancherio/cattle/forks","keys_url":"https://api.github.com/repos/rancherio/cattle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rancherio/cattle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rancherio/cattle/teams","hooks_url":"https://api.github.com/repos/rancherio/cattle/hooks","issue_events_url":"https://api.github.com/repos/rancherio/cattle/issues/events{/number}","events_url":"https://api.github.com/repos/rancherio/cattle/events","assignees_url":"https://api.github.com/repos/rancherio/cattle/assignees{/user}","branches_url":"https://api.github.com/repos/rancherio/cattle/branches{/branch}","tags_url":"https://api.github.com/repos/rancherio/cattle/tags","blobs_url":"https://api.github.com/repos/rancherio/cattle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rancherio/cattle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rancherio/cattle/git/refs{/sha}","trees_url":"https://api.github.com/repos/rancherio/cattle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rancherio/cattle/statuses/{sha}","languages_url":"https://api.github.com/repos/rancherio/cattle/languages","stargazers_url":"https://api.github.com/repos/rancherio/cattle/stargazers","contributors_url":"https://api.github.com/repos/rancherio/cattle/contributors","subscribers_url":"https://api.github.com/repos/rancherio/cattle/subscribers","subscription_url":"https://api.github.com/repos/rancherio/cattle/subscription","commits_url":"https://api.github.com/repos/rancherio/cattle/commits{/sha}","git_commits_url":"https://api.github.com/repos/rancherio/cattle/git/commits{/sha}","comments_url":"https://api.github.com/repos/rancherio/cattle/comments{/number}","issue_comment_url":"https://api.github.com/repos/rancherio/cattle/issues/comments{/number}","contents_url":"https://api.github.com/repos/rancherio/cattle/contents/{+path}","compare_url":"https://api.github.com/repos/rancherio/cattle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rancherio/cattle/merges","archive_url":"https://api.github.com/repos/rancherio/cattle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rancherio/cattle/downloads","issues_url":"https://api.github.com/repos/rancherio/cattle/issues{/number}","pulls_url":"https://api.github.com/repos/rancherio/cattle/pulls{/number}","milestones_url":"https://api.github.com/repos/rancherio/cattle/milestones{/number}","notifications_url":"https://api.github.com/repos/rancherio/cattle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rancherio/cattle/labels{/name}","releases_url":"https://api.github.com/repos/rancherio/cattle/releases{/id}","created_at":"2014-03-23T00:19:52Z","updated_at":"2015-05-24T03:36:22Z","pushed_at":"2015-06-02T19:27:50Z","git_url":"git://github.com/rancherio/cattle.git","ssh_url":"git@github.com:rancherio/cattle.git","clone_url":"https://github.com/rancherio/cattle.git","svn_url":"https://github.com/rancherio/cattle","homepage":"","size":28665,"stargazers_count":138,"watchers_count":138,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":93,"forks":33,"open_issues":93,"watchers":138,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/525"},"html":{"href":"https://github.com/rancherio/cattle/pull/525"},"issue":{"href":"https://api.github.com/repos/rancherio/cattle/issues/525"},"comments":{"href":"https://api.github.com/repos/rancherio/cattle/issues/525/comments"},"review_comments":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/525/comments"},"review_comment":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rancherio/cattle/pulls/525/commits"},"statuses":{"href":"https://api.github.com/repos/rancherio/cattle/statuses/e666ae195da3502c504c9b73ce7b5de59ebe776d"}}}}