{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/56143615","id":56143615,"diff_hunk":"@@ -391,3 +466,146 @@ func (os *Rackspace) GetZone() (cloudprovider.Zone, error) {\n \n \treturn cloudprovider.Zone{Region: os.region}, nil\n }\n+\n+// Create a volume of given size (in GiB)\n+func (os *Rackspace) CreateVolume(name string, size int, tags *map[string]string) (volumeName string, err error) {\n+\treturn \"\", errors.New(\"unimplemented\")\n+}\n+\n+func (os *Rackspace) DeleteVolume(volumeName string) error {\n+\treturn errors.New(\"unimplemented\")\n+}\n+\n+// Attaches given cinder volume to the compute running kubelet\n+func (os *Rackspace) AttachDisk(diskName string) (string, error) {\n+\tinstanceID, err := readInstanceID()\n+\tif err != nil {\n+\t\treturn \"\", err\n+\t}\n+\n+\tdisk, err := os.getVolume(diskName)\n+\tif err != nil {\n+\t\treturn \"\", err\n+\t}\n+\n+\tcompute, err := os.getComputeClient()\n+\tif err != nil {\n+\t\treturn \"\", err\n+\t}\n+\n+\tif len(disk.Attachments) > 0 && disk.Attachments[0][\"server_id\"] != nil {\n+\t\tif instanceID == disk.Attachments[0][\"server_id\"] {\n+\t\t\tglog.V(4).Infof(\"Disk: %q is already attached to compute: %q\", diskName, instanceID)\n+\t\t\treturn disk.ID, nil\n+\t\t} else {\n+\t\t\terrMsg := fmt.Sprintf(\"Disk %q is attached to a different compute: %q, should be detached before proceeding\", diskName, disk.Attachments[0][\"server_id\"])\n+\t\t\tglog.Errorf(errMsg)\n+\t\t\treturn \"\", errors.New(errMsg)\n+\t\t}\n+\t}\n+\n+\t_, err = volumeattach.Create(compute, instanceID, &volumeattach.CreateOpts{","path":"pkg/cloudprovider/providers/rackspace/rackspace.go","position":226,"original_position":226,"commit_id":"f4a245f50ed3d710c52eb416eb6fbe2abe6e7e73","original_commit_id":"f4a245f50ed3d710c52eb416eb6fbe2abe6e7e73","user":{"login":"jamiehannaford","id":1867202,"avatar_url":"https://avatars.githubusercontent.com/u/1867202?v=3","gravatar_id":"","url":"https://api.github.com/users/jamiehannaford","html_url":"https://github.com/jamiehannaford","followers_url":"https://api.github.com/users/jamiehannaford/followers","following_url":"https://api.github.com/users/jamiehannaford/following{/other_user}","gists_url":"https://api.github.com/users/jamiehannaford/gists{/gist_id}","starred_url":"https://api.github.com/users/jamiehannaford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamiehannaford/subscriptions","organizations_url":"https://api.github.com/users/jamiehannaford/orgs","repos_url":"https://api.github.com/users/jamiehannaford/repos","events_url":"https://api.github.com/users/jamiehannaford/events{/privacy}","received_events_url":"https://api.github.com/users/jamiehannaford/received_events","type":"User","site_admin":false},"body":"should this really be `github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach`? I would rely on the `rackspace` namespace here, since you're not handling openstack types","created_at":"2016-03-15T10:39:19Z","updated_at":"2016-03-15T10:39:19Z","html_url":"https://github.com/kubernetes/kubernetes/pull/22023#discussion_r56143615","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/22023","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/56143615"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/22023#discussion_r56143615"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/22023"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/22023","id":60765323,"html_url":"https://github.com/kubernetes/kubernetes/pull/22023","diff_url":"https://github.com/kubernetes/kubernetes/pull/22023.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/22023.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22023","number":22023,"state":"open","locked":false,"title":"Rackspace improvements (OpenStack Cinder)","user":{"login":"mkulke","id":273280,"avatar_url":"https://avatars.githubusercontent.com/u/273280?v=3","gravatar_id":"","url":"https://api.github.com/users/mkulke","html_url":"https://github.com/mkulke","followers_url":"https://api.github.com/users/mkulke/followers","following_url":"https://api.github.com/users/mkulke/following{/other_user}","gists_url":"https://api.github.com/users/mkulke/gists{/gist_id}","starred_url":"https://api.github.com/users/mkulke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkulke/subscriptions","organizations_url":"https://api.github.com/users/mkulke/orgs","repos_url":"https://api.github.com/users/mkulke/repos","events_url":"https://api.github.com/users/mkulke/events{/privacy}","received_events_url":"https://api.github.com/users/mkulke/received_events","type":"User","site_admin":false},"body":"This adds PV support via Cinder on Rackspace clusters. Rackspace Cloud Block Storage is pretty much vanilla OpenStack Cinder, so there is no need for a separate Volume Plugin. Instead I refactored the Cinder/OpenStack interaction a bit (by introducing a CinderProvider Interface and moving the device path detection logic to the OpenStack part).\r\n\r\nRight now this is limited to `AttachDisk` and `DetachDisk`. Creation and deletion of Block Storage is not in scope of this PR.\r\n\r\nAlso the `ExternalID` and `InstanceID` cloud provider methods have been implemented for Rackspace.","created_at":"2016-02-25T23:18:28Z","updated_at":"2016-03-15T10:39:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97732451e99225702ee4e7d165666407d7e48f76","assignee":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/22023/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/22023/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22023/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/f4a245f50ed3d710c52eb416eb6fbe2abe6e7e73","head":{"label":"mkulke:rackspace-improvements","ref":"rackspace-improvements","sha":"f4a245f50ed3d710c52eb416eb6fbe2abe6e7e73","user":{"login":"mkulke","id":273280,"avatar_url":"https://avatars.githubusercontent.com/u/273280?v=3","gravatar_id":"","url":"https://api.github.com/users/mkulke","html_url":"https://github.com/mkulke","followers_url":"https://api.github.com/users/mkulke/followers","following_url":"https://api.github.com/users/mkulke/following{/other_user}","gists_url":"https://api.github.com/users/mkulke/gists{/gist_id}","starred_url":"https://api.github.com/users/mkulke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkulke/subscriptions","organizations_url":"https://api.github.com/users/mkulke/orgs","repos_url":"https://api.github.com/users/mkulke/repos","events_url":"https://api.github.com/users/mkulke/events{/privacy}","received_events_url":"https://api.github.com/users/mkulke/received_events","type":"User","site_admin":false},"repo":{"id":33568881,"name":"kubernetes","full_name":"mkulke/kubernetes","owner":{"login":"mkulke","id":273280,"avatar_url":"https://avatars.githubusercontent.com/u/273280?v=3","gravatar_id":"","url":"https://api.github.com/users/mkulke","html_url":"https://github.com/mkulke","followers_url":"https://api.github.com/users/mkulke/followers","following_url":"https://api.github.com/users/mkulke/following{/other_user}","gists_url":"https://api.github.com/users/mkulke/gists{/gist_id}","starred_url":"https://api.github.com/users/mkulke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkulke/subscriptions","organizations_url":"https://api.github.com/users/mkulke/orgs","repos_url":"https://api.github.com/users/mkulke/repos","events_url":"https://api.github.com/users/mkulke/events{/privacy}","received_events_url":"https://api.github.com/users/mkulke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mkulke/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/mkulke/kubernetes","forks_url":"https://api.github.com/repos/mkulke/kubernetes/forks","keys_url":"https://api.github.com/repos/mkulke/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mkulke/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mkulke/kubernetes/teams","hooks_url":"https://api.github.com/repos/mkulke/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/mkulke/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/mkulke/kubernetes/events","assignees_url":"https://api.github.com/repos/mkulke/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/mkulke/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/mkulke/kubernetes/tags","blobs_url":"https://api.github.com/repos/mkulke/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mkulke/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mkulke/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/mkulke/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mkulke/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/mkulke/kubernetes/languages","stargazers_url":"https://api.github.com/repos/mkulke/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/mkulke/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/mkulke/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/mkulke/kubernetes/subscription","commits_url":"https://api.github.com/repos/mkulke/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/mkulke/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/mkulke/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/mkulke/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/mkulke/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/mkulke/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mkulke/kubernetes/merges","archive_url":"https://api.github.com/repos/mkulke/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mkulke/kubernetes/downloads","issues_url":"https://api.github.com/repos/mkulke/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/mkulke/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/mkulke/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/mkulke/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mkulke/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/mkulke/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/mkulke/kubernetes/deployments","created_at":"2015-04-07T21:19:20Z","updated_at":"2016-02-09T10:43:05Z","pushed_at":"2016-03-08T08:58:23Z","git_url":"git://github.com/mkulke/kubernetes.git","ssh_url":"git@github.com:mkulke/kubernetes.git","clone_url":"https://github.com/mkulke/kubernetes.git","svn_url":"https://github.com/mkulke/kubernetes","homepage":"http://kubernetes.io","size":174058,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"kubernetes:master","ref":"master","sha":"48962b2a118741e6a3e8e1e3acd3d804bbab8109","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":"Container Cluster Manager from Google","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-03-15T09:21:39Z","pushed_at":"2016-03-15T10:09:17Z","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":340827,"stargazers_count":13233,"watchers_count":13233,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3814,"mirror_url":null,"open_issues_count":2991,"forks":3814,"open_issues":2991,"watchers":13233,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/22023"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/22023"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/22023"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/22023/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/22023/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/22023/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/f4a245f50ed3d710c52eb416eb6fbe2abe6e7e73"}}}}