GitHub PullRequestReviewCommentEvent at 2014-08-12 20:41:18
Repository: kubernetes
Actor: Sarsate
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/16140859","id":16140859,"diff_hunk":"@@ -0,0 +1,201 @@\n+/*\n+Copyright 2014 Google Inc. All rights reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package volume\n+\n+import (\n+\t\"errors\"\n+\t\"io/ioutil\"\n+\t\"net/http\"\n+\t\"os\"\n+\t\"path\"\n+\t\"path/filepath\"\n+\t\"regexp\"\n+\t\"strings\"\n+\t\"time\"\n+\n+\t\"code.google.com/p/goauth2/compute/serviceaccount\"\n+\tcompute \"code.google.com/p/google-api-go-client/compute/v1\"\n+)\n+\n+type GCEDiskUtil struct {\n+\tproject   string\n+\tzone      string\n+\tinstance  string\n+\tservice   *compute.Service\n+\tconnected bool\n+}\n+\n+// Establishes a connection to the GCE API and initializes project, zone,\n+// and instance members.\n+func (GCEPD *GCEDiskUtil) Connect() error {\n+\tvar err error\n+\tGCEPD.project, GCEPD.zone, err = getProjectIDAndZone()\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tGCEPD.instance, err = os.Hostname()\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tclient, err := serviceaccount.NewClient(&serviceaccount.Options{})\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tGCEPD.service, err = compute.New(client)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tGCEPD.connected = true\n+\treturn nil\n+}\n+\n+// Acquires zone and project names from the metadata server.\n+func getProjectIDAndZone() (string, string, error) {\n+\treq, _ := http.NewRequest(\"GET\", \"http://metadata.google.internal/computeMetadata/v1/instance/zone\", nil)","path":"pkg/volume/gce_util.go","position":68,"original_position":68,"commit_id":"fa9fd8c237f7e54795d099d8d4aa9907a2755c76","original_commit_id":"3e412c52ff296ba3c61a965ed2cd0a2a84bbc8b7","user":{"login":"Sarsate","id":3740548,"avatar_url":"https://avatars.githubusercontent.com/u/3740548?v=2","gravatar_id":"eacb6c1e76f7e8df4c65ee4b9fa7dae5","url":"https://api.github.com/users/Sarsate","html_url":"https://github.com/Sarsate","followers_url":"https://api.github.com/users/Sarsate/followers","following_url":"https://api.github.com/users/Sarsate/following{/other_user}","gists_url":"https://api.github.com/users/Sarsate/gists{/gist_id}","starred_url":"https://api.github.com/users/Sarsate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sarsate/subscriptions","organizations_url":"https://api.github.com/users/Sarsate/orgs","repos_url":"https://api.github.com/users/Sarsate/repos","events_url":"https://api.github.com/users/Sarsate/events{/privacy}","received_events_url":"https://api.github.com/users/Sarsate/received_events","type":"User","site_admin":false},"body":"https://developers.google.com/compute/docs/metadata#querying seems to suggest that querying the url directly is the standard way to do it.","created_at":"2014-08-12T20:41:18Z","updated_at":"2014-08-12T20:41:18Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/861#discussion_r16140859","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/861","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/16140859"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/861#discussion_r16140859"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/861"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/861","id":19641389,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/861","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/861.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/861.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/861","number":861,"state":"open","title":"Adds Persistent Disk volume type.","user":{"login":"Sarsate","id":3740548,"avatar_url":"https://avatars.githubusercontent.com/u/3740548?v=2","gravatar_id":"eacb6c1e76f7e8df4c65ee4b9fa7dae5","url":"https://api.github.com/users/Sarsate","html_url":"https://github.com/Sarsate","followers_url":"https://api.github.com/users/Sarsate/followers","following_url":"https://api.github.com/users/Sarsate/following{/other_user}","gists_url":"https://api.github.com/users/Sarsate/gists{/gist_id}","starred_url":"https://api.github.com/users/Sarsate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sarsate/subscriptions","organizations_url":"https://api.github.com/users/Sarsate/orgs","repos_url":"https://api.github.com/users/Sarsate/repos","events_url":"https://api.github.com/users/Sarsate/events{/privacy}","received_events_url":"https://api.github.com/users/Sarsate/received_events","type":"User","site_admin":false},"body":"Implements a generalized Persistent Disk resource with plug-able API and Mounter interfaces.\r\n\r\nCurrently only supports GCE API, but the Persistent Disk resource was made general enough to support additional APIs.\r\n\r\n\r\n\r\n","created_at":"2014-08-12T03:47:57Z","updated_at":"2014-08-12T20:41:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ca88c17290400449292c85038b200bad839bd0a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/861/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/861/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/861/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/fa9fd8c237f7e54795d099d8d4aa9907a2755c76","head":{"label":"Sarsate:pd-support","ref":"pd-support","sha":"fa9fd8c237f7e54795d099d8d4aa9907a2755c76","user":{"login":"Sarsate","id":3740548,"avatar_url":"https://avatars.githubusercontent.com/u/3740548?v=2","gravatar_id":"eacb6c1e76f7e8df4c65ee4b9fa7dae5","url":"https://api.github.com/users/Sarsate","html_url":"https://github.com/Sarsate","followers_url":"https://api.github.com/users/Sarsate/followers","following_url":"https://api.github.com/users/Sarsate/following{/other_user}","gists_url":"https://api.github.com/users/Sarsate/gists{/gist_id}","starred_url":"https://api.github.com/users/Sarsate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sarsate/subscriptions","organizations_url":"https://api.github.com/users/Sarsate/orgs","repos_url":"https://api.github.com/users/Sarsate/repos","events_url":"https://api.github.com/users/Sarsate/events{/privacy}","received_events_url":"https://api.github.com/users/Sarsate/received_events","type":"User","site_admin":false},"repo":{"id":21047302,"name":"kubernetes","full_name":"Sarsate/kubernetes","owner":{"login":"Sarsate","id":3740548,"avatar_url":"https://avatars.githubusercontent.com/u/3740548?v=2","gravatar_id":"eacb6c1e76f7e8df4c65ee4b9fa7dae5","url":"https://api.github.com/users/Sarsate","html_url":"https://github.com/Sarsate","followers_url":"https://api.github.com/users/Sarsate/followers","following_url":"https://api.github.com/users/Sarsate/following{/other_user}","gists_url":"https://api.github.com/users/Sarsate/gists{/gist_id}","starred_url":"https://api.github.com/users/Sarsate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sarsate/subscriptions","organizations_url":"https://api.github.com/users/Sarsate/orgs","repos_url":"https://api.github.com/users/Sarsate/repos","events_url":"https://api.github.com/users/Sarsate/events{/privacy}","received_events_url":"https://api.github.com/users/Sarsate/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Sarsate/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/Sarsate/kubernetes","forks_url":"https://api.github.com/repos/Sarsate/kubernetes/forks","keys_url":"https://api.github.com/repos/Sarsate/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sarsate/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sarsate/kubernetes/teams","hooks_url":"https://api.github.com/repos/Sarsate/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/Sarsate/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/Sarsate/kubernetes/events","assignees_url":"https://api.github.com/repos/Sarsate/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/Sarsate/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/Sarsate/kubernetes/tags","blobs_url":"https://api.github.com/repos/Sarsate/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sarsate/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sarsate/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sarsate/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sarsate/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/Sarsate/kubernetes/languages","stargazers_url":"https://api.github.com/repos/Sarsate/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/Sarsate/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/Sarsate/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/Sarsate/kubernetes/subscription","commits_url":"https://api.github.com/repos/Sarsate/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sarsate/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sarsate/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sarsate/kubernetes/issues/comments/{number}","contents_url":"https://api.github.com/repos/Sarsate/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/Sarsate/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sarsate/kubernetes/merges","archive_url":"https://api.github.com/repos/Sarsate/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sarsate/kubernetes/downloads","issues_url":"https://api.github.com/repos/Sarsate/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/Sarsate/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/Sarsate/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/Sarsate/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sarsate/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/Sarsate/kubernetes/releases{/id}","created_at":"2014-06-20T18:00:57Z","updated_at":"2014-07-01T18:01:06Z","pushed_at":"2014-08-12T19:22:55Z","git_url":"git://github.com/Sarsate/kubernetes.git","ssh_url":"git@github.com:Sarsate/kubernetes.git","clone_url":"https://github.com/Sarsate/kubernetes.git","svn_url":"https://github.com/Sarsate/kubernetes","homepage":null,"size":8399,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"24b5d582685705d5192e54d1610add7b817c19a9","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=2","gravatar_id":"3db02c6238c8b1fb844871330744ec5d","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"GoogleCloudPlatform/kubernetes","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=2","gravatar_id":"3db02c6238c8b1fb844871330744ec5d","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes","description":"Container Cluster Manager","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments/{number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2014-08-12T19:37:21Z","pushed_at":"2014-08-12T20:23:44Z","git_url":"git://github.com/GoogleCloudPlatform/kubernetes.git","ssh_url":"git@github.com:GoogleCloudPlatform/kubernetes.git","clone_url":"https://github.com/GoogleCloudPlatform/kubernetes.git","svn_url":"https://github.com/GoogleCloudPlatform/kubernetes","homepage":null,"size":21144,"stargazers_count":2978,"watchers_count":2978,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":379,"mirror_url":null,"open_issues_count":154,"forks":379,"open_issues":154,"watchers":2978,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/861"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/861"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/861"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/861/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/861/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/861/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/fa9fd8c237f7e54795d099d8d4aa9907a2755c76"}}}}