{"action":"created","comment":{"url":"https://api.github.com/repos/containership/containership.scheduler/pulls/comments/88652774","pull_request_review_id":9207187,"id":88652774,"diff_hunk":"@@ -0,0 +1,50 @@\n+const _ = require('lodash');\n+\n+function updateContainerMyriadState(core, options, cb) {\n+    if(_.has(options, \"respawn\") && !options.respawn) {\n+        deleteContainer(core, options, cb);\n+    } else {\n+        //Get the container -\n+        core.cluster.myriad.persistence.get(_.join([core.constants.myriad.CONTAINERS_PREFIX, options.application_name, options.container_id], '::'), {local: false}, (err, container) => {\n+            if(err) {\n+                return cb(err);\n+            } else {\n+                try {\n+                    container = JSON.parse(container);\n+                    \n+                    //Update fields\n+                    container = _.merge(container, \n+                        _.pick(options, ['host', 'start_time', 'tags', 'engine', 'host_port', 'container_port']),\n+                        {host_port: options.status === \"unloaded\" && container.random_host_port ? null : container.host_port});\n+\n+                    //And persist.\n+                    core.cluster.myriad.persistence.set(_.join([core.constants.myriad.CONTAINERS_PREFIX, options.application_name, options.container_id], '::'), JSON.stringify(container), cb);\n+\n+                } catch(err) {\n+                    return cb(err);\n+                }\n+            }\n+        });\n+    }\n+}\n+\n+function deleteContainerMyriadState(core, options, cb) {\n+    core.cluster.myriad.persistence.delete(_.join([core.constants.myriad.CONTAINERS_PREFIX, options.application_name, options.container_id], '::'), cb);","path":"lib/utils.js","position":32,"original_position":32,"commit_id":"e0036d961eb65a1e5e63d2cbfdb6af9176190eb4","original_commit_id":"e0036d961eb65a1e5e63d2cbfdb6af9176190eb4","user":{"login":"normanjoyner","id":237732,"avatar_url":"https://avatars.githubusercontent.com/u/237732?v=3","gravatar_id":"","url":"https://api.github.com/users/normanjoyner","html_url":"https://github.com/normanjoyner","followers_url":"https://api.github.com/users/normanjoyner/followers","following_url":"https://api.github.com/users/normanjoyner/following{/other_user}","gists_url":"https://api.github.com/users/normanjoyner/gists{/gist_id}","starred_url":"https://api.github.com/users/normanjoyner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanjoyner/subscriptions","organizations_url":"https://api.github.com/users/normanjoyner/orgs","repos_url":"https://api.github.com/users/normanjoyner/repos","events_url":"https://api.github.com/users/normanjoyner/events{/privacy}","received_events_url":"https://api.github.com/users/normanjoyner/received_events","type":"User","site_admin":false},"body":"use myriad delimiter rather than hardcoded `::`","created_at":"2016-11-18T13:01:41Z","updated_at":"2016-11-18T13:06:04Z","html_url":"https://github.com/containership/containership.scheduler/pull/80#discussion_r88652774","pull_request_url":"https://api.github.com/repos/containership/containership.scheduler/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/containership/containership.scheduler/pulls/comments/88652774"},"html":{"href":"https://github.com/containership/containership.scheduler/pull/80#discussion_r88652774"},"pull_request":{"href":"https://api.github.com/repos/containership/containership.scheduler/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/containership/containership.scheduler/pulls/80","id":94195276,"html_url":"https://github.com/containership/containership.scheduler/pull/80","diff_url":"https://github.com/containership/containership.scheduler/pull/80.diff","patch_url":"https://github.com/containership/containership.scheduler/pull/80.patch","issue_url":"https://api.github.com/repos/containership/containership.scheduler/issues/80","number":80,"state":"open","locked":false,"title":"Removed forever monitor, refactored docker engine.","user":{"login":"jeremykross","id":1480064,"avatar_url":"https://avatars.githubusercontent.com/u/1480064?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremykross","html_url":"https://github.com/jeremykross","followers_url":"https://api.github.com/users/jeremykross/followers","following_url":"https://api.github.com/users/jeremykross/following{/other_user}","gists_url":"https://api.github.com/users/jeremykross/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremykross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremykross/subscriptions","organizations_url":"https://api.github.com/users/jeremykross/orgs","repos_url":"https://api.github.com/users/jeremykross/repos","events_url":"https://api.github.com/users/jeremykross/events{/privacy}","received_events_url":"https://api.github.com/users/jeremykross/received_events","type":"User","site_admin":false},"body":"@nicktate  @normanjoyner \r\n\r\nSo, it became relatively clear that I couldn't remove forever-monitor without doing an uncomfortable amount of violence to the structure of the standing code, so I decided to take the opportunity to clean up and modernize the docker engine.\r\n\r\nLet me know what you guys think.  ","created_at":"2016-11-17T15:58:53Z","updated_at":"2016-11-18T13:06:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00b9d94f853bc962401d42460567551e382c8f86","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/containership/containership.scheduler/pulls/80/commits","review_comments_url":"https://api.github.com/repos/containership/containership.scheduler/pulls/80/comments","review_comment_url":"https://api.github.com/repos/containership/containership.scheduler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/containership/containership.scheduler/issues/80/comments","statuses_url":"https://api.github.com/repos/containership/containership.scheduler/statuses/e0036d961eb65a1e5e63d2cbfdb6af9176190eb4","head":{"label":"jeremykross:REMOVE_FOREVER_MONITOR","ref":"REMOVE_FOREVER_MONITOR","sha":"e0036d961eb65a1e5e63d2cbfdb6af9176190eb4","user":{"login":"jeremykross","id":1480064,"avatar_url":"https://avatars.githubusercontent.com/u/1480064?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremykross","html_url":"https://github.com/jeremykross","followers_url":"https://api.github.com/users/jeremykross/followers","following_url":"https://api.github.com/users/jeremykross/following{/other_user}","gists_url":"https://api.github.com/users/jeremykross/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremykross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremykross/subscriptions","organizations_url":"https://api.github.com/users/jeremykross/orgs","repos_url":"https://api.github.com/users/jeremykross/repos","events_url":"https://api.github.com/users/jeremykross/events{/privacy}","received_events_url":"https://api.github.com/users/jeremykross/received_events","type":"User","site_admin":false},"repo":{"id":68231483,"name":"containership.scheduler","full_name":"jeremykross/containership.scheduler","owner":{"login":"jeremykross","id":1480064,"avatar_url":"https://avatars.githubusercontent.com/u/1480064?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremykross","html_url":"https://github.com/jeremykross","followers_url":"https://api.github.com/users/jeremykross/followers","following_url":"https://api.github.com/users/jeremykross/following{/other_user}","gists_url":"https://api.github.com/users/jeremykross/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremykross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremykross/subscriptions","organizations_url":"https://api.github.com/users/jeremykross/orgs","repos_url":"https://api.github.com/users/jeremykross/repos","events_url":"https://api.github.com/users/jeremykross/events{/privacy}","received_events_url":"https://api.github.com/users/jeremykross/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeremykross/containership.scheduler","description":"The default scheduler for ContainerShip","fork":true,"url":"https://api.github.com/repos/jeremykross/containership.scheduler","forks_url":"https://api.github.com/repos/jeremykross/containership.scheduler/forks","keys_url":"https://api.github.com/repos/jeremykross/containership.scheduler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeremykross/containership.scheduler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeremykross/containership.scheduler/teams","hooks_url":"https://api.github.com/repos/jeremykross/containership.scheduler/hooks","issue_events_url":"https://api.github.com/repos/jeremykross/containership.scheduler/issues/events{/number}","events_url":"https://api.github.com/repos/jeremykross/containership.scheduler/events","assignees_url":"https://api.github.com/repos/jeremykross/containership.scheduler/assignees{/user}","branches_url":"https://api.github.com/repos/jeremykross/containership.scheduler/branches{/branch}","tags_url":"https://api.github.com/repos/jeremykross/containership.scheduler/tags","blobs_url":"https://api.github.com/repos/jeremykross/containership.scheduler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeremykross/containership.scheduler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeremykross/containership.scheduler/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeremykross/containership.scheduler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeremykross/containership.scheduler/statuses/{sha}","languages_url":"https://api.github.com/repos/jeremykross/containership.scheduler/languages","stargazers_url":"https://api.github.com/repos/jeremykross/containership.scheduler/stargazers","contributors_url":"https://api.github.com/repos/jeremykross/containership.scheduler/contributors","subscribers_url":"https://api.github.com/repos/jeremykross/containership.scheduler/subscribers","subscription_url":"https://api.github.com/repos/jeremykross/containership.scheduler/subscription","commits_url":"https://api.github.com/repos/jeremykross/containership.scheduler/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeremykross/containership.scheduler/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeremykross/containership.scheduler/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeremykross/containership.scheduler/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeremykross/containership.scheduler/contents/{+path}","compare_url":"https://api.github.com/repos/jeremykross/containership.scheduler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeremykross/containership.scheduler/merges","archive_url":"https://api.github.com/repos/jeremykross/containership.scheduler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeremykross/containership.scheduler/downloads","issues_url":"https://api.github.com/repos/jeremykross/containership.scheduler/issues{/number}","pulls_url":"https://api.github.com/repos/jeremykross/containership.scheduler/pulls{/number}","milestones_url":"https://api.github.com/repos/jeremykross/containership.scheduler/milestones{/number}","notifications_url":"https://api.github.com/repos/jeremykross/containership.scheduler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeremykross/containership.scheduler/labels{/name}","releases_url":"https://api.github.com/repos/jeremykross/containership.scheduler/releases{/id}","deployments_url":"https://api.github.com/repos/jeremykross/containership.scheduler/deployments","created_at":"2016-09-14T18:17:49Z","updated_at":"2016-09-14T18:17:50Z","pushed_at":"2016-11-17T15:42:23Z","git_url":"git://github.com/jeremykross/containership.scheduler.git","ssh_url":"git@github.com:jeremykross/containership.scheduler.git","clone_url":"https://github.com/jeremykross/containership.scheduler.git","svn_url":"https://github.com/jeremykross/containership.scheduler","homepage":"containership.io","size":249,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"containership:master","ref":"master","sha":"317f91efb423f913008db0c239446ca5613fe856","user":{"login":"containership","id":7675252,"avatar_url":"https://avatars.githubusercontent.com/u/7675252?v=3","gravatar_id":"","url":"https://api.github.com/users/containership","html_url":"https://github.com/containership","followers_url":"https://api.github.com/users/containership/followers","following_url":"https://api.github.com/users/containership/following{/other_user}","gists_url":"https://api.github.com/users/containership/gists{/gist_id}","starred_url":"https://api.github.com/users/containership/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containership/subscriptions","organizations_url":"https://api.github.com/users/containership/orgs","repos_url":"https://api.github.com/users/containership/repos","events_url":"https://api.github.com/users/containership/events{/privacy}","received_events_url":"https://api.github.com/users/containership/received_events","type":"Organization","site_admin":false},"repo":{"id":31297939,"name":"containership.scheduler","full_name":"containership/containership.scheduler","owner":{"login":"containership","id":7675252,"avatar_url":"https://avatars.githubusercontent.com/u/7675252?v=3","gravatar_id":"","url":"https://api.github.com/users/containership","html_url":"https://github.com/containership","followers_url":"https://api.github.com/users/containership/followers","following_url":"https://api.github.com/users/containership/following{/other_user}","gists_url":"https://api.github.com/users/containership/gists{/gist_id}","starred_url":"https://api.github.com/users/containership/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containership/subscriptions","organizations_url":"https://api.github.com/users/containership/orgs","repos_url":"https://api.github.com/users/containership/repos","events_url":"https://api.github.com/users/containership/events{/privacy}","received_events_url":"https://api.github.com/users/containership/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/containership/containership.scheduler","description":"The default scheduler for ContainerShip","fork":false,"url":"https://api.github.com/repos/containership/containership.scheduler","forks_url":"https://api.github.com/repos/containership/containership.scheduler/forks","keys_url":"https://api.github.com/repos/containership/containership.scheduler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/containership/containership.scheduler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/containership/containership.scheduler/teams","hooks_url":"https://api.github.com/repos/containership/containership.scheduler/hooks","issue_events_url":"https://api.github.com/repos/containership/containership.scheduler/issues/events{/number}","events_url":"https://api.github.com/repos/containership/containership.scheduler/events","assignees_url":"https://api.github.com/repos/containership/containership.scheduler/assignees{/user}","branches_url":"https://api.github.com/repos/containership/containership.scheduler/branches{/branch}","tags_url":"https://api.github.com/repos/containership/containership.scheduler/tags","blobs_url":"https://api.github.com/repos/containership/containership.scheduler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/containership/containership.scheduler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/containership/containership.scheduler/git/refs{/sha}","trees_url":"https://api.github.com/repos/containership/containership.scheduler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/containership/containership.scheduler/statuses/{sha}","languages_url":"https://api.github.com/repos/containership/containership.scheduler/languages","stargazers_url":"https://api.github.com/repos/containership/containership.scheduler/stargazers","contributors_url":"https://api.github.com/repos/containership/containership.scheduler/contributors","subscribers_url":"https://api.github.com/repos/containership/containership.scheduler/subscribers","subscription_url":"https://api.github.com/repos/containership/containership.scheduler/subscription","commits_url":"https://api.github.com/repos/containership/containership.scheduler/commits{/sha}","git_commits_url":"https://api.github.com/repos/containership/containership.scheduler/git/commits{/sha}","comments_url":"https://api.github.com/repos/containership/containership.scheduler/comments{/number}","issue_comment_url":"https://api.github.com/repos/containership/containership.scheduler/issues/comments{/number}","contents_url":"https://api.github.com/repos/containership/containership.scheduler/contents/{+path}","compare_url":"https://api.github.com/repos/containership/containership.scheduler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/containership/containership.scheduler/merges","archive_url":"https://api.github.com/repos/containership/containership.scheduler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/containership/containership.scheduler/downloads","issues_url":"https://api.github.com/repos/containership/containership.scheduler/issues{/number}","pulls_url":"https://api.github.com/repos/containership/containership.scheduler/pulls{/number}","milestones_url":"https://api.github.com/repos/containership/containership.scheduler/milestones{/number}","notifications_url":"https://api.github.com/repos/containership/containership.scheduler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/containership/containership.scheduler/labels{/name}","releases_url":"https://api.github.com/repos/containership/containership.scheduler/releases{/id}","deployments_url":"https://api.github.com/repos/containership/containership.scheduler/deployments","created_at":"2015-02-25T04:56:48Z","updated_at":"2016-10-27T23:43:20Z","pushed_at":"2016-11-17T15:58:53Z","git_url":"git://github.com/containership/containership.scheduler.git","ssh_url":"git@github.com:containership/containership.scheduler.git","clone_url":"https://github.com/containership/containership.scheduler.git","svn_url":"https://github.com/containership/containership.scheduler","homepage":"containership.io","size":294,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":4,"forks":6,"open_issues":4,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/containership/containership.scheduler/pulls/80"},"html":{"href":"https://github.com/containership/containership.scheduler/pull/80"},"issue":{"href":"https://api.github.com/repos/containership/containership.scheduler/issues/80"},"comments":{"href":"https://api.github.com/repos/containership/containership.scheduler/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/containership/containership.scheduler/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/containership/containership.scheduler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/containership/containership.scheduler/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/containership/containership.scheduler/statuses/e0036d961eb65a1e5e63d2cbfdb6af9176190eb4"}}}}
{"actor":{"display_login":"normanjoyner"}}