{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/nomad/pulls/comments/225336276","pull_request_review_id":164919790,"id":225336276,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTMzNjI3Ng==","diff_hunk":"@@ -0,0 +1,1007 @@\n+// +build linux\n+\n+package rkt\n+\n+import (\n+\t\"bytes\"\n+\t\"fmt\"\n+\t\"net\"\n+\t\"os\"\n+\t\"os/exec\"\n+\t\"path/filepath\"\n+\t\"regexp\"\n+\t\"runtime\"\n+\t\"strings\"\n+\t\"syscall\"\n+\t\"time\"\n+\n+\tappcschema \"github.com/appc/spec/schema\"\n+\t\"github.com/hashicorp/go-hclog\"\n+\t\"github.com/hashicorp/go-plugin\"\n+\t\"github.com/hashicorp/go-version\"\n+\t\"github.com/hashicorp/nomad/client/config\"\n+\t\"github.com/hashicorp/nomad/client/driver/env\"\n+\tdstructs \"github.com/hashicorp/nomad/client/driver/structs\"\n+\tcstructs \"github.com/hashicorp/nomad/client/structs\"\n+\t\"github.com/hashicorp/nomad/drivers/shared/eventer\"\n+\t\"github.com/hashicorp/nomad/plugins/base\"\n+\t\"github.com/hashicorp/nomad/plugins/drivers\"\n+\t\"github.com/hashicorp/nomad/plugins/drivers/utils\"\n+\t\"github.com/hashicorp/nomad/plugins/shared/hclspec\"\n+\trktv1 \"github.com/rkt/rkt/api/v1\"\n+\t\"golang.org/x/net/context\"\n+\n+\t\"encoding/json\"\n+\t\"io/ioutil\"\n+\t\"math/rand\"\n+\t\"strconv\"\n+\n+\t\"github.com/hashicorp/consul-template/signals\"\n+\t\"github.com/hashicorp/nomad/client/driver/executor\"\n+)\n+\n+const (\n+\t// pluginName is the name of the plugin\n+\tpluginName = \"rkt\"\n+\n+\t// fingerprintPeriod is the interval at which the driver will send fingerprint responses\n+\tfingerprintPeriod = 30 * time.Second\n+\n+\t// minRktVersion is the earliest supported version of rkt. rkt added support\n+\t// for CPU and memory isolators in 0.14.0. We cannot support an earlier\n+\t// version to maintain an uniform interface across all drivers\n+\tminRktVersion = \"1.27.0\"\n+\n+\t// rktCmd is the command rkt is installed as.\n+\trktCmd = \"rkt\"\n+\n+\t// rktNetworkDeadline is how long to wait for container network to start\n+\trktNetworkDeadline = 1 * time.Minute\n+)\n+\n+var (\n+\t// pluginInfo is the response returned for the PluginInfo RPC\n+\tpluginInfo = &base.PluginInfoResponse{\n+\t\tType:             base.PluginTypeDriver,\n+\t\tPluginApiVersion: \"0.0.1\",\n+\t\tPluginVersion:    \"0.1.0\",\n+\t\tName:             pluginName,\n+\t}\n+\n+\t// configSpec is the hcl specification returned by the ConfigSchema RPC\n+\tconfigSpec = hclspec.NewObject(map[string]*hclspec.Spec{\n+\t\t\"volumes_enabled\": hclspec.NewDefault(\n+\t\t\thclspec.NewAttr(\"volumes_enabled\", \"bool\", false),\n+\t\t\thclspec.NewLiteral(\"true\"),\n+\t\t),\n+\t})\n+\n+\t// taskConfigSpec is the hcl specification for the driver config section of\n+\t// a taskConfig within a job. It is returned in the TaskConfigSchema RPC\n+\ttaskConfigSpec = hclspec.NewObject(map[string]*hclspec.Spec{\n+\t\t\"image\":              hclspec.NewAttr(\"image\", \"string\", true),\n+\t\t\"command\":            hclspec.NewAttr(\"command\", \"string\", false),\n+\t\t\"args\":               hclspec.NewAttr(\"args\", \"list(string)\", false),\n+\t\t\"trust_prefix\":       hclspec.NewAttr(\"trust_prefix\", \"string\", false),\n+\t\t\"dns_servers\":        hclspec.NewAttr(\"dns_servers\", \"list(string)\", false),\n+\t\t\"dns_search_domains\": hclspec.NewAttr(\"dns_search_domains\", \"list(string)\", false),\n+\t\t\"net\":                hclspec.NewAttr(\"net\", \"list(string)\", false),\n+\t\t\"port_map\":           hclspec.NewAttr(\"port_map\", \"list(map(string))\", false),","path":"drivers/rkt/driver.go","position":89,"original_position":89,"commit_id":"60c40322e66a38ad784d8f1f4d0446bf9e6a5859","original_commit_id":"60c40322e66a38ad784d8f1f4d0446bf9e6a5859","user":{"login":"preetapan","id":460133,"node_id":"MDQ6VXNlcjQ2MDEzMw==","avatar_url":"https://avatars1.githubusercontent.com/u/460133?v=4","gravatar_id":"","url":"https://api.github.com/users/preetapan","html_url":"https://github.com/preetapan","followers_url":"https://api.github.com/users/preetapan/followers","following_url":"https://api.github.com/users/preetapan/following{/other_user}","gists_url":"https://api.github.com/users/preetapan/gists{/gist_id}","starred_url":"https://api.github.com/users/preetapan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/preetapan/subscriptions","organizations_url":"https://api.github.com/users/preetapan/orgs","repos_url":"https://api.github.com/users/preetapan/repos","events_url":"https://api.github.com/users/preetapan/events{/privacy}","received_events_url":"https://api.github.com/users/preetapan/received_events","type":"User","site_admin":false},"body":"I originally had it without the map but without an end to end test it was hard to prove that a pre nomad 0.9 rkt drive config block would parse correctly without modelling it as a slice. ","created_at":"2018-10-15T22:21:41Z","updated_at":"2018-10-15T22:21:41Z","html_url":"https://github.com/hashicorp/nomad/pull/4778#discussion_r225336276","pull_request_url":"https://api.github.com/repos/hashicorp/nomad/pulls/4778","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/comments/225336276"},"html":{"href":"https://github.com/hashicorp/nomad/pull/4778#discussion_r225336276"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/4778"}},"in_reply_to_id":225270944},"pull_request":{"url":"https://api.github.com/repos/hashicorp/nomad/pulls/4778","id":222563944,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNTYzOTQ0","html_url":"https://github.com/hashicorp/nomad/pull/4778","diff_url":"https://github.com/hashicorp/nomad/pull/4778.diff","patch_url":"https://github.com/hashicorp/nomad/pull/4778.patch","issue_url":"https://api.github.com/repos/hashicorp/nomad/issues/4778","number":4778,"state":"open","locked":false,"title":"rkt driver plugin","user":{"login":"preetapan","id":460133,"node_id":"MDQ6VXNlcjQ2MDEzMw==","avatar_url":"https://avatars1.githubusercontent.com/u/460133?v=4","gravatar_id":"","url":"https://api.github.com/users/preetapan","html_url":"https://github.com/preetapan","followers_url":"https://api.github.com/users/preetapan/followers","following_url":"https://api.github.com/users/preetapan/following{/other_user}","gists_url":"https://api.github.com/users/preetapan/gists{/gist_id}","starred_url":"https://api.github.com/users/preetapan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/preetapan/subscriptions","organizations_url":"https://api.github.com/users/preetapan/orgs","repos_url":"https://api.github.com/users/preetapan/repos","events_url":"https://api.github.com/users/preetapan/events{/privacy}","received_events_url":"https://api.github.com/users/preetapan/received_events","type":"User","site_admin":false},"body":"Implements Rkt driver plugin, and ported over unit tests from client/driver/rkt_test.go","created_at":"2018-10-12T19:27:53Z","updated_at":"2018-10-15T22:21:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2081212583141cfdd52c6e473b29dd1238ec1b59","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/nomad/pulls/4778/commits","review_comments_url":"https://api.github.com/repos/hashicorp/nomad/pulls/4778/comments","review_comment_url":"https://api.github.com/repos/hashicorp/nomad/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/nomad/issues/4778/comments","statuses_url":"https://api.github.com/repos/hashicorp/nomad/statuses/60c40322e66a38ad784d8f1f4d0446bf9e6a5859","head":{"label":"hashicorp:f-driver-plugin-rkt","ref":"f-driver-plugin-rkt","sha":"60c40322e66a38ad784d8f1f4d0446bf9e6a5859","user":{"login":"hashicorp","id":761456,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MTQ1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":36653430,"node_id":"MDEwOlJlcG9zaXRvcnkzNjY1MzQzMA==","name":"nomad","full_name":"hashicorp/nomad","private":false,"owner":{"login":"hashicorp","id":761456,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MTQ1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/hashicorp/nomad","description":"Nomad is a flexible, enterprise-grade cluster scheduler designed to easily integrate into existing workflows. Nomad can run a diverse workload of micro-service, batch, containerized and non-containerized applications. Nomad is easy to operate and scale and integrates seamlessly with Consul and Vault.","fork":false,"url":"https://api.github.com/repos/hashicorp/nomad","forks_url":"https://api.github.com/repos/hashicorp/nomad/forks","keys_url":"https://api.github.com/repos/hashicorp/nomad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/nomad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/nomad/teams","hooks_url":"https://api.github.com/repos/hashicorp/nomad/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/nomad/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/nomad/events","assignees_url":"https://api.github.com/repos/hashicorp/nomad/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/nomad/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/nomad/tags","blobs_url":"https://api.github.com/repos/hashicorp/nomad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/nomad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/nomad/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/nomad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/nomad/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/nomad/languages","stargazers_url":"https://api.github.com/repos/hashicorp/nomad/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/nomad/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/nomad/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/nomad/subscription","commits_url":"https://api.github.com/repos/hashicorp/nomad/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/nomad/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/nomad/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/nomad/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/nomad/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/nomad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/nomad/merges","archive_url":"https://api.github.com/repos/hashicorp/nomad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/nomad/downloads","issues_url":"https://api.github.com/repos/hashicorp/nomad/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/nomad/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/nomad/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/nomad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/nomad/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/nomad/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/nomad/deployments","created_at":"2015-06-01T10:21:00Z","updated_at":"2018-10-15T20:37:56Z","pushed_at":"2018-10-15T22:18:48Z","git_url":"git://github.com/hashicorp/nomad.git","ssh_url":"git@github.com:hashicorp/nomad.git","clone_url":"https://github.com/hashicorp/nomad.git","svn_url":"https://github.com/hashicorp/nomad","homepage":"https://www.nomadproject.io/","size":112319,"stargazers_count":3924,"watchers_count":3924,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":768,"mirror_url":null,"archived":false,"open_issues_count":449,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":768,"open_issues":449,"watchers":3924,"default_branch":"master"}},"base":{"label":"hashicorp:r-clientv2","ref":"r-clientv2","sha":"a69deebec9fdd75c431694140d3086cb06800524","user":{"login":"hashicorp","id":761456,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MTQ1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":36653430,"node_id":"MDEwOlJlcG9zaXRvcnkzNjY1MzQzMA==","name":"nomad","full_name":"hashicorp/nomad","private":false,"owner":{"login":"hashicorp","id":761456,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MTQ1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/hashicorp/nomad","description":"Nomad is a flexible, enterprise-grade cluster scheduler designed to easily integrate into existing workflows. Nomad can run a diverse workload of micro-service, batch, containerized and non-containerized applications. Nomad is easy to operate and scale and integrates seamlessly with Consul and Vault.","fork":false,"url":"https://api.github.com/repos/hashicorp/nomad","forks_url":"https://api.github.com/repos/hashicorp/nomad/forks","keys_url":"https://api.github.com/repos/hashicorp/nomad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/nomad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/nomad/teams","hooks_url":"https://api.github.com/repos/hashicorp/nomad/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/nomad/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/nomad/events","assignees_url":"https://api.github.com/repos/hashicorp/nomad/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/nomad/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/nomad/tags","blobs_url":"https://api.github.com/repos/hashicorp/nomad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/nomad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/nomad/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/nomad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/nomad/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/nomad/languages","stargazers_url":"https://api.github.com/repos/hashicorp/nomad/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/nomad/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/nomad/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/nomad/subscription","commits_url":"https://api.github.com/repos/hashicorp/nomad/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/nomad/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/nomad/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/nomad/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/nomad/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/nomad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/nomad/merges","archive_url":"https://api.github.com/repos/hashicorp/nomad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/nomad/downloads","issues_url":"https://api.github.com/repos/hashicorp/nomad/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/nomad/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/nomad/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/nomad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/nomad/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/nomad/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/nomad/deployments","created_at":"2015-06-01T10:21:00Z","updated_at":"2018-10-15T20:37:56Z","pushed_at":"2018-10-15T22:18:48Z","git_url":"git://github.com/hashicorp/nomad.git","ssh_url":"git@github.com:hashicorp/nomad.git","clone_url":"https://github.com/hashicorp/nomad.git","svn_url":"https://github.com/hashicorp/nomad","homepage":"https://www.nomadproject.io/","size":112319,"stargazers_count":3924,"watchers_count":3924,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":768,"mirror_url":null,"archived":false,"open_issues_count":449,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":768,"open_issues":449,"watchers":3924,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/4778"},"html":{"href":"https://github.com/hashicorp/nomad/pull/4778"},"issue":{"href":"https://api.github.com/repos/hashicorp/nomad/issues/4778"},"comments":{"href":"https://api.github.com/repos/hashicorp/nomad/issues/4778/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/4778/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/4778/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/nomad/statuses/60c40322e66a38ad784d8f1f4d0446bf9e6a5859"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"preetapan"}}