{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/74160512","id":74160512,"diff_hunk":"@@ -0,0 +1,96 @@\n+/*\n+Copyright 2016 The Kubernetes Authors.\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 azure_dd\n+\n+import (\n+\t\"io/ioutil\"\n+\t\"os\"\n+\t\"path\"\n+\t\"regexp\"\n+\t\"strconv\"\n+\t\"strings\"\n+\n+\t\"k8s.io/kubernetes/pkg/util/exec\"\n+)\n+\n+type ioHandler interface {\n+\tReadDir(dirname string) ([]os.FileInfo, error)\n+\tWriteFile(filename string, data []byte, perm os.FileMode) error\n+}\n+\n+type osIOHandler struct{}\n+\n+func (handler *osIOHandler) ReadDir(dirname string) ([]os.FileInfo, error) {\n+\treturn ioutil.ReadDir(dirname)\n+}\n+func (handler *osIOHandler) WriteFile(filename string, data []byte, perm os.FileMode) error {\n+\treturn ioutil.WriteFile(filename, data, perm)\n+}\n+\n+// given a LUN find the VHD device path like /dev/sdb\n+// VHD disks under sysfs are like /sys/bus/scsi/devices/3:0:1:0\n+// return empty string if no disk is found\n+func findDiskByLun(lun int, io ioHandler) string {\n+\tsys_path := \"/sys/bus/scsi/devices\"\n+\tif dirs, err := io.ReadDir(sys_path); err == nil {\n+\t\tfor _, f := range dirs {\n+\t\t\tname := f.Name()\n+\t\t\t// look for path like /sys/bus/scsi/devices/3:0:1:0\n+\t\t\tarr := strings.Split(name, \":\")\n+\t\t\tif len(arr) < 4 {\n+\t\t\t\tcontinue\n+\t\t\t}\n+\t\t\ttarget, err := strconv.Atoi(arr[0])\n+\t\t\t// as observed, targets 0-3 are used by OS disks. Skip them\n+\t\t\tif err == nil && target > 3 {\n+\t\t\t\tl, err := strconv.Atoi(arr[3])","path":"pkg/volume/azure_dd/vhd_util.go","position":60,"original_position":60,"commit_id":"bd37b46bd5094f8dcfbdea0db5274baddf4c5f9b","original_commit_id":"cb428ec00ff3d0e781fd90f134533ad99542a5cc","user":{"login":"brendandburns","id":5751682,"avatar_url":"https://avatars.githubusercontent.com/u/5751682?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandburns","html_url":"https://github.com/brendandburns","followers_url":"https://api.github.com/users/brendandburns/followers","following_url":"https://api.github.com/users/brendandburns/following{/other_user}","gists_url":"https://api.github.com/users/brendandburns/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandburns/subscriptions","organizations_url":"https://api.github.com/users/brendandburns/orgs","repos_url":"https://api.github.com/users/brendandburns/repos","events_url":"https://api.github.com/users/brendandburns/events{/privacy}","received_events_url":"https://api.github.com/users/brendandburns/received_events","type":"User","site_admin":false},"body":"Handle the err here.  (not only is it informative, `return err` will clean up the flow too.","created_at":"2016-08-09T23:03:53Z","updated_at":"2016-08-09T23:03:53Z","html_url":"https://github.com/kubernetes/kubernetes/pull/29836#discussion_r74160512","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29836","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/74160512"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/29836#discussion_r74160512"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29836"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29836","id":79496028,"html_url":"https://github.com/kubernetes/kubernetes/pull/29836","diff_url":"https://github.com/kubernetes/kubernetes/pull/29836.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/29836.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/29836","number":29836,"state":"open","locked":false,"title":"support Azure data disk volume","user":{"login":"rootfs","id":7062400,"avatar_url":"https://avatars.githubusercontent.com/u/7062400?v=3","gravatar_id":"","url":"https://api.github.com/users/rootfs","html_url":"https://github.com/rootfs","followers_url":"https://api.github.com/users/rootfs/followers","following_url":"https://api.github.com/users/rootfs/following{/other_user}","gists_url":"https://api.github.com/users/rootfs/gists{/gist_id}","starred_url":"https://api.github.com/users/rootfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rootfs/subscriptions","organizations_url":"https://api.github.com/users/rootfs/orgs","repos_url":"https://api.github.com/users/rootfs/repos","events_url":"https://api.github.com/users/rootfs/events{/privacy}","received_events_url":"https://api.github.com/users/rootfs/received_events","type":"User","site_admin":false},"body":"This is a WIP of supporting azure data disk volume. Will add test and dynamic provisioning support once #29006 is merged\r\n\r\nreplace #25915\r\nfix #23259\r\n\r\n@kubernetes/sig-storage \r\n@colemickens @brendandburns\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.kubernetes.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29836)\n<!-- Reviewable:end -->\n","created_at":"2016-07-31T21:06:57Z","updated_at":"2016-08-09T23:03:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8c195e8dd0d611484f7af81ad4a281d2609e34c","assignee":{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},"assignees":[{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},{"login":"brendandburns","id":5751682,"avatar_url":"https://avatars.githubusercontent.com/u/5751682?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandburns","html_url":"https://github.com/brendandburns","followers_url":"https://api.github.com/users/brendandburns/followers","following_url":"https://api.github.com/users/brendandburns/following{/other_user}","gists_url":"https://api.github.com/users/brendandburns/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandburns/subscriptions","organizations_url":"https://api.github.com/users/brendandburns/orgs","repos_url":"https://api.github.com/users/brendandburns/repos","events_url":"https://api.github.com/users/brendandburns/events{/privacy}","received_events_url":"https://api.github.com/users/brendandburns/received_events","type":"User","site_admin":false},{"login":"jingxu97","id":19172805,"avatar_url":"https://avatars.githubusercontent.com/u/19172805?v=3","gravatar_id":"","url":"https://api.github.com/users/jingxu97","html_url":"https://github.com/jingxu97","followers_url":"https://api.github.com/users/jingxu97/followers","following_url":"https://api.github.com/users/jingxu97/following{/other_user}","gists_url":"https://api.github.com/users/jingxu97/gists{/gist_id}","starred_url":"https://api.github.com/users/jingxu97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jingxu97/subscriptions","organizations_url":"https://api.github.com/users/jingxu97/orgs","repos_url":"https://api.github.com/users/jingxu97/repos","events_url":"https://api.github.com/users/jingxu97/events{/privacy}","received_events_url":"https://api.github.com/users/jingxu97/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29836/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29836/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/29836/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/bd37b46bd5094f8dcfbdea0db5274baddf4c5f9b","head":{"label":"rootfs:azuredd","ref":"azuredd","sha":"bd37b46bd5094f8dcfbdea0db5274baddf4c5f9b","user":{"login":"rootfs","id":7062400,"avatar_url":"https://avatars.githubusercontent.com/u/7062400?v=3","gravatar_id":"","url":"https://api.github.com/users/rootfs","html_url":"https://github.com/rootfs","followers_url":"https://api.github.com/users/rootfs/followers","following_url":"https://api.github.com/users/rootfs/following{/other_user}","gists_url":"https://api.github.com/users/rootfs/gists{/gist_id}","starred_url":"https://api.github.com/users/rootfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rootfs/subscriptions","organizations_url":"https://api.github.com/users/rootfs/orgs","repos_url":"https://api.github.com/users/rootfs/repos","events_url":"https://api.github.com/users/rootfs/events{/privacy}","received_events_url":"https://api.github.com/users/rootfs/received_events","type":"User","site_admin":false},"repo":{"id":29694119,"name":"kubernetes","full_name":"rootfs/kubernetes","owner":{"login":"rootfs","id":7062400,"avatar_url":"https://avatars.githubusercontent.com/u/7062400?v=3","gravatar_id":"","url":"https://api.github.com/users/rootfs","html_url":"https://github.com/rootfs","followers_url":"https://api.github.com/users/rootfs/followers","following_url":"https://api.github.com/users/rootfs/following{/other_user}","gists_url":"https://api.github.com/users/rootfs/gists{/gist_id}","starred_url":"https://api.github.com/users/rootfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rootfs/subscriptions","organizations_url":"https://api.github.com/users/rootfs/orgs","repos_url":"https://api.github.com/users/rootfs/repos","events_url":"https://api.github.com/users/rootfs/events{/privacy}","received_events_url":"https://api.github.com/users/rootfs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rootfs/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/rootfs/kubernetes","forks_url":"https://api.github.com/repos/rootfs/kubernetes/forks","keys_url":"https://api.github.com/repos/rootfs/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rootfs/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rootfs/kubernetes/teams","hooks_url":"https://api.github.com/repos/rootfs/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/rootfs/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/rootfs/kubernetes/events","assignees_url":"https://api.github.com/repos/rootfs/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/rootfs/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/rootfs/kubernetes/tags","blobs_url":"https://api.github.com/repos/rootfs/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rootfs/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rootfs/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/rootfs/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rootfs/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/rootfs/kubernetes/languages","stargazers_url":"https://api.github.com/repos/rootfs/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/rootfs/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/rootfs/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/rootfs/kubernetes/subscription","commits_url":"https://api.github.com/repos/rootfs/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/rootfs/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/rootfs/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/rootfs/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/rootfs/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/rootfs/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rootfs/kubernetes/merges","archive_url":"https://api.github.com/repos/rootfs/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rootfs/kubernetes/downloads","issues_url":"https://api.github.com/repos/rootfs/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/rootfs/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/rootfs/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/rootfs/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rootfs/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/rootfs/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/rootfs/kubernetes/deployments","created_at":"2015-01-22T18:48:37Z","updated_at":"2016-02-19T05:36:24Z","pushed_at":"2016-08-09T23:01:32Z","git_url":"git://github.com/rootfs/kubernetes.git","ssh_url":"git@github.com:rootfs/kubernetes.git","clone_url":"https://github.com/rootfs/kubernetes.git","svn_url":"https://github.com/rootfs/kubernetes","homepage":"http://kubernetes.io","size":299148,"stargazers_count":5,"watchers_count":5,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":5,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"012eb941d6f90b75f9866ec59bd7f73a965b4d27","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-08-09T22:49:52Z","pushed_at":"2016-08-09T23:01:43Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":517801,"stargazers_count":16052,"watchers_count":16052,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5085,"mirror_url":null,"open_issues_count":4127,"forks":5085,"open_issues":4127,"watchers":16052,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29836"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/29836"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/29836"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/29836/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29836/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/29836/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/bd37b46bd5094f8dcfbdea0db5274baddf4c5f9b"}}}}
{"actor":{"display_login":"brendandburns"}}