{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/40047946","id":40047946,"diff_hunk":"@@ -0,0 +1,138 @@\n+/*\n+Copyright 2015 The Kubernetes Authors 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 flocker\n+\n+import (\n+\t\"github.com/docker/docker/pkg/units\"\n+\t\"k8s.io/kubernetes/pkg/api\"\n+\t\"k8s.io/kubernetes/pkg/types\"\n+\t\"k8s.io/kubernetes/pkg/util/exec\"\n+\t\"k8s.io/kubernetes/pkg/util/mount\"\n+\t\"k8s.io/kubernetes/pkg/volume\"\n+)\n+\n+func ProbeVolumePlugins() []volume.VolumePlugin {\n+\treturn []volume.VolumePlugin{&flockerPlugin{}}\n+}\n+\n+type flockerPlugin struct {\n+\thost volume.VolumeHost\n+}\n+\n+type flocker struct {\n+\tdatasetName string\n+\tdatasetID   string\n+\tmaximumSize int64\n+\tpod         *api.Pod\n+\tmounter     mount.Interface\n+\tplugin      *flockerPlugin\n+}\n+\n+func (p *flockerPlugin) Init(host volume.VolumeHost) {\n+\tp.host = host\n+}\n+\n+func (p flockerPlugin) Name() string {\n+\treturn \"kubernetes.io/flocker\"\n+}\n+\n+func (p flockerPlugin) CanSupport(spec *volume.Spec) bool {\n+\treturn (spec.PersistentVolume != nil && spec.PersistentVolume.Spec.Flocker != nil) ||\n+\t\t(spec.Volume != nil && spec.Volume.Flocker != nil)\n+}\n+\n+func (p *flockerPlugin) getFlockerVolumeSource(spec *volume.Spec) (*api.FlockerVolumeSource, bool) {\n+\t// AFAIK this will always be r/w, but perhaps for the future it will be needed\n+\treadOnly := false\n+\n+\tif spec.Volume != nil && spec.Volume.Flocker != nil {\n+\t\treturn spec.Volume.Flocker, readOnly\n+\t}\n+\treturn spec.PersistentVolume.Spec.Flocker, readOnly","path":"pkg/volume/flocker/plugin.go","position":65,"original_position":65,"commit_id":"c23134130cd32ff6de2482b48227a6e1dd85c243","original_commit_id":"c23134130cd32ff6de2482b48227a6e1dd85c243","user":{"login":"markturansky","id":8001968,"avatar_url":"https://avatars.githubusercontent.com/u/8001968?v=3","gravatar_id":"","url":"https://api.github.com/users/markturansky","html_url":"https://github.com/markturansky","followers_url":"https://api.github.com/users/markturansky/followers","following_url":"https://api.github.com/users/markturansky/following{/other_user}","gists_url":"https://api.github.com/users/markturansky/gists{/gist_id}","starred_url":"https://api.github.com/users/markturansky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markturansky/subscriptions","organizations_url":"https://api.github.com/users/markturansky/orgs","repos_url":"https://api.github.com/users/markturansky/repos","events_url":"https://api.github.com/users/markturansky/events{/privacy}","received_events_url":"https://api.github.com/users/markturansky/received_events","type":"User","site_admin":false},"body":"Same as above.  I missed flocker in PV struct.  Looks good here.","created_at":"2015-09-22T02:06:00Z","updated_at":"2015-09-22T02:06:00Z","html_url":"https://github.com/kubernetes/kubernetes/pull/14328#discussion_r40047946","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14328","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/40047946"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/14328#discussion_r40047946"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14328"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14328","id":45618464,"html_url":"https://github.com/kubernetes/kubernetes/pull/14328","diff_url":"https://github.com/kubernetes/kubernetes/pull/14328.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/14328.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14328","number":14328,"state":"open","locked":false,"title":"Add flocker volume plugin","user":{"login":"agonzalezro","id":205176,"avatar_url":"https://avatars.githubusercontent.com/u/205176?v=3","gravatar_id":"","url":"https://api.github.com/users/agonzalezro","html_url":"https://github.com/agonzalezro","followers_url":"https://api.github.com/users/agonzalezro/followers","following_url":"https://api.github.com/users/agonzalezro/following{/other_user}","gists_url":"https://api.github.com/users/agonzalezro/gists{/gist_id}","starred_url":"https://api.github.com/users/agonzalezro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agonzalezro/subscriptions","organizations_url":"https://api.github.com/users/agonzalezro/orgs","repos_url":"https://api.github.com/users/agonzalezro/repos","events_url":"https://api.github.com/users/agonzalezro/events{/privacy}","received_events_url":"https://api.github.com/users/agonzalezro/received_events","type":"User","site_admin":false},"body":"Flocker [1] is an open-source container data volume manager for\r\nDockerized applications.\r\n\r\nThis PR adds a volume plugin for Flocker.\r\nThe plugin interfaces the Flocker Control Service REST API [2] to\r\nrequest volume creation and attachment.\r\n\r\nEach kubelet host should run Flocker agents (Container Agent and Dataset\r\nAgent).\r\n\r\nThe kubelet will also require environment variables that contain the\r\nhost and port of the Flocker Control Service. (see Flocker architecture\r\n[3] for more).\r\n\r\n- `FLOCKER_CONTROL_SERVICE_HOST`\r\n- `FLOCKER_CONTROL_SERVICE_PORT`\r\n\r\nThe contribution introduces a new 'flocker' volume type to the API with\r\nfields:\r\n\r\n- `datasetName`: which indicates the name of the dataset in Flocker\r\n  added to metadata;\r\n- `size`: a human-readable number that indicates the maximum size of the\r\n  requested dataset.\r\n\r\nFull documentation (including getting started guides) and e2e tests to\r\nfollow.\r\n\r\nAs the plugin is code complete, we're hoping to make version 1.1.\r\n\r\n[1] https://clusterhq.com/flocker/introduction/\r\n[2] https://docs.clusterhq.com/en/1.3.1/reference/api.html\r\n[3] https://docs.clusterhq.com/en/1.3.1/concepts/architecture.html","created_at":"2015-09-22T01:06:27Z","updated_at":"2015-09-22T02:06:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f995e36e84e1b0dbf9ebab5c61aa7a469a250fb3","assignee":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=3","gravatar_id":"","url":"https://api.github.com/users/lavalamp","html_url":"https://github.com/lavalamp","followers_url":"https://api.github.com/users/lavalamp/followers","following_url":"https://api.github.com/users/lavalamp/following{/other_user}","gists_url":"https://api.github.com/users/lavalamp/gists{/gist_id}","starred_url":"https://api.github.com/users/lavalamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavalamp/subscriptions","organizations_url":"https://api.github.com/users/lavalamp/orgs","repos_url":"https://api.github.com/users/lavalamp/repos","events_url":"https://api.github.com/users/lavalamp/events{/privacy}","received_events_url":"https://api.github.com/users/lavalamp/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14328/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14328/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14328/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/c23134130cd32ff6de2482b48227a6e1dd85c243","head":{"label":"agonzalezro:flocker","ref":"flocker","sha":"c23134130cd32ff6de2482b48227a6e1dd85c243","user":{"login":"agonzalezro","id":205176,"avatar_url":"https://avatars.githubusercontent.com/u/205176?v=3","gravatar_id":"","url":"https://api.github.com/users/agonzalezro","html_url":"https://github.com/agonzalezro","followers_url":"https://api.github.com/users/agonzalezro/followers","following_url":"https://api.github.com/users/agonzalezro/following{/other_user}","gists_url":"https://api.github.com/users/agonzalezro/gists{/gist_id}","starred_url":"https://api.github.com/users/agonzalezro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agonzalezro/subscriptions","organizations_url":"https://api.github.com/users/agonzalezro/orgs","repos_url":"https://api.github.com/users/agonzalezro/repos","events_url":"https://api.github.com/users/agonzalezro/events{/privacy}","received_events_url":"https://api.github.com/users/agonzalezro/received_events","type":"User","site_admin":false},"repo":{"id":42435566,"name":"kubernetes","full_name":"agonzalezro/kubernetes","owner":{"login":"agonzalezro","id":205176,"avatar_url":"https://avatars.githubusercontent.com/u/205176?v=3","gravatar_id":"","url":"https://api.github.com/users/agonzalezro","html_url":"https://github.com/agonzalezro","followers_url":"https://api.github.com/users/agonzalezro/followers","following_url":"https://api.github.com/users/agonzalezro/following{/other_user}","gists_url":"https://api.github.com/users/agonzalezro/gists{/gist_id}","starred_url":"https://api.github.com/users/agonzalezro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agonzalezro/subscriptions","organizations_url":"https://api.github.com/users/agonzalezro/orgs","repos_url":"https://api.github.com/users/agonzalezro/repos","events_url":"https://api.github.com/users/agonzalezro/events{/privacy}","received_events_url":"https://api.github.com/users/agonzalezro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/agonzalezro/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/agonzalezro/kubernetes","forks_url":"https://api.github.com/repos/agonzalezro/kubernetes/forks","keys_url":"https://api.github.com/repos/agonzalezro/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agonzalezro/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agonzalezro/kubernetes/teams","hooks_url":"https://api.github.com/repos/agonzalezro/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/agonzalezro/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/agonzalezro/kubernetes/events","assignees_url":"https://api.github.com/repos/agonzalezro/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/agonzalezro/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/agonzalezro/kubernetes/tags","blobs_url":"https://api.github.com/repos/agonzalezro/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agonzalezro/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agonzalezro/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/agonzalezro/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agonzalezro/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/agonzalezro/kubernetes/languages","stargazers_url":"https://api.github.com/repos/agonzalezro/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/agonzalezro/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/agonzalezro/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/agonzalezro/kubernetes/subscription","commits_url":"https://api.github.com/repos/agonzalezro/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/agonzalezro/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/agonzalezro/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/agonzalezro/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/agonzalezro/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/agonzalezro/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agonzalezro/kubernetes/merges","archive_url":"https://api.github.com/repos/agonzalezro/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agonzalezro/kubernetes/downloads","issues_url":"https://api.github.com/repos/agonzalezro/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/agonzalezro/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/agonzalezro/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/agonzalezro/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agonzalezro/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/agonzalezro/kubernetes/releases{/id}","created_at":"2015-09-14T08:06:38Z","updated_at":"2015-09-14T08:06:45Z","pushed_at":"2015-09-22T01:23:34Z","git_url":"git://github.com/agonzalezro/kubernetes.git","ssh_url":"git@github.com:agonzalezro/kubernetes.git","clone_url":"https://github.com/agonzalezro/kubernetes.git","svn_url":"https://github.com/agonzalezro/kubernetes","homepage":"http://kubernetes.io","size":109933,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"02b993052559b23400ef3ac80e45ae7d164cc66a","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}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-09-22T01:33:36Z","pushed_at":"2015-09-22T01:59:33Z","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":424342,"stargazers_count":10364,"watchers_count":10364,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2569,"mirror_url":null,"open_issues_count":1830,"forks":2569,"open_issues":1830,"watchers":10364,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14328"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/14328"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/14328"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/14328/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14328/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14328/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/c23134130cd32ff6de2482b48227a6e1dd85c243"}}}}