{"action":"created","comment":{"url":"https://api.github.com/repos/vmware/kubernetes/pulls/comments/85217507","pull_request_review_id":5945776,"id":85217507,"diff_hunk":"@@ -0,0 +1,550 @@\n+/*\n+Copyright 2016 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 photon\n+\n+import (\n+\t\"bytes\"\n+\t\"errors\"\n+\t\"fmt\"\n+\t\"github.com/golang/glog\"\n+\t\"github.com/vmware/photon-controller-go-sdk/photon\"\n+\t\"gopkg.in/gcfg.v1\"\n+\t\"io\"\n+\t\"k8s.io/kubernetes/pkg/api\"\n+\t\"k8s.io/kubernetes/pkg/cloudprovider\"\n+\tk8stypes \"k8s.io/kubernetes/pkg/types\"\n+\t\"log\"\n+\t\"os/exec\"\n+\t\"strings\"\n+)\n+\n+const (\n+\tProviderName = \"photon\"\n+)\n+\n+// Global variable pointing to photon client\n+var Esxclient *photon.Client\n+var logger *log.Logger = nil\n+\n+// overrideIP indicates if the hostname is overriden by IP address, such as when\n+// running multi-node kubernetes using docker. In this case the user should set\n+// overrideIP = true in cloud config file. Default value is false.\n+var overrideIP bool = false\n+\n+// Photon is an implementation of cloud provider Interface for Photon Controller.","path":"pkg/cloudprovider/providers/photon/photon.go","position":48,"original_position":48,"commit_id":"9ac62d5e1f09bc429ea61a1a6742332bed44658d","original_commit_id":"a81d406399113f61943ba881ed62c5f726bd83f8","user":{"login":"AlainRoy","id":887364,"avatar_url":"https://avatars.githubusercontent.com/u/887364?v=3","gravatar_id":"","url":"https://api.github.com/users/AlainRoy","html_url":"https://github.com/AlainRoy","followers_url":"https://api.github.com/users/AlainRoy/followers","following_url":"https://api.github.com/users/AlainRoy/following{/other_user}","gists_url":"https://api.github.com/users/AlainRoy/gists{/gist_id}","starred_url":"https://api.github.com/users/AlainRoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlainRoy/subscriptions","organizations_url":"https://api.github.com/users/AlainRoy/orgs","repos_url":"https://api.github.com/users/AlainRoy/repos","events_url":"https://api.github.com/users/AlainRoy/events{/privacy}","received_events_url":"https://api.github.com/users/AlainRoy/received_events","type":"User","site_admin":false},"body":"I tend to get picky about comments. It's a character fault. \r\n\"cloud provider\" -> \"the cloud provider\"\r\n\"Interface\" -> \"interface\"\r\n","created_at":"2016-10-26T20:51:26Z","updated_at":"2016-10-26T20:51:26Z","html_url":"https://github.com/vmware/kubernetes/pull/21#discussion_r85217507","pull_request_url":"https://api.github.com/repos/vmware/kubernetes/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/comments/85217507"},"html":{"href":"https://github.com/vmware/kubernetes/pull/21#discussion_r85217507"},"pull_request":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/vmware/kubernetes/pulls/21","id":90898591,"html_url":"https://github.com/vmware/kubernetes/pull/21","diff_url":"https://github.com/vmware/kubernetes/pull/21.diff","patch_url":"https://github.com/vmware/kubernetes/pull/21.patch","issue_url":"https://api.github.com/repos/vmware/kubernetes/issues/21","number":21,"state":"open","locked":false,"title":"Photon support for code review updated","user":{"login":"luomiao","id":8987721,"avatar_url":"https://avatars.githubusercontent.com/u/8987721?v=3","gravatar_id":"","url":"https://api.github.com/users/luomiao","html_url":"https://github.com/luomiao","followers_url":"https://api.github.com/users/luomiao/followers","following_url":"https://api.github.com/users/luomiao/following{/other_user}","gists_url":"https://api.github.com/users/luomiao/gists{/gist_id}","starred_url":"https://api.github.com/users/luomiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luomiao/subscriptions","organizations_url":"https://api.github.com/users/luomiao/orgs","repos_url":"https://api.github.com/users/luomiao/repos","events_url":"https://api.github.com/users/luomiao/events{/privacy}","received_events_url":"https://api.github.com/users/luomiao/received_events","type":"User","site_admin":false},"body":"Enable the persistent volume usage for kubernetes running on Photon platform.\r\nA following check-in for test files will be checked-in later.\r\n\r\na. Photon Controller is supported as cloud provider.\r\nWhen choosing to use photon controller as a cloud provider, \"--cloud-provider=photon --cloud-config=[path_to_config_file]\" is required for kubelet/kube-controller-manager/kube-apiserver. The config file of Photon Controller should follow the following usage:\r\n```\r\n[Global]\r\ntarget = http://[photon_controller_endpoint_IP]\r\nignoreCertificate = true\r\ntenant = [tenant_name]\r\nproject = [project_name]\r\noverrideIP = true\r\n```\r\n\r\nb. Photon persistent disk is supported as volume source/persistent volume source.\r\nyaml usage:\r\n```\r\nvolumes:\r\n  - name: photon-storage-1\r\n    photonPersistentDisk:\r\n        pdID: \"643ed4e2-3fcc-482b-96d0-12ff6cab2a69\"\r\npdID is the persistent disk ID from Photon Controller.\r\n```\r\n\r\nc. Enable Photon Controller as volume provisioner.\r\nyaml usage:\r\n```\r\nkind: StorageClass\r\napiVersion: storage.k8s.io/v1beta1\r\nmetadata:\r\n  name: gold_sc\r\nprovisioner: kubernetes.io/photon-pd\r\nparameters:\r\n  flavor: persistent-disk-gold\r\n```\r\nThe flavor \"persistent-disk-gold\" needs to be created by Photon platform admin before hand.","created_at":"2016-10-25T21:48:33Z","updated_at":"2016-10-26T20:51:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc7025b70f8e5ae3c7a410e73168d8ef8bf39a2e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/vmware/kubernetes/pulls/21/commits","review_comments_url":"https://api.github.com/repos/vmware/kubernetes/pulls/21/comments","review_comment_url":"https://api.github.com/repos/vmware/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vmware/kubernetes/issues/21/comments","statuses_url":"https://api.github.com/repos/vmware/kubernetes/statuses/9ac62d5e1f09bc429ea61a1a6742332bed44658d","head":{"label":"luomiao:photon-support-for-code-review-updated","ref":"photon-support-for-code-review-updated","sha":"9ac62d5e1f09bc429ea61a1a6742332bed44658d","user":{"login":"luomiao","id":8987721,"avatar_url":"https://avatars.githubusercontent.com/u/8987721?v=3","gravatar_id":"","url":"https://api.github.com/users/luomiao","html_url":"https://github.com/luomiao","followers_url":"https://api.github.com/users/luomiao/followers","following_url":"https://api.github.com/users/luomiao/following{/other_user}","gists_url":"https://api.github.com/users/luomiao/gists{/gist_id}","starred_url":"https://api.github.com/users/luomiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luomiao/subscriptions","organizations_url":"https://api.github.com/users/luomiao/orgs","repos_url":"https://api.github.com/users/luomiao/repos","events_url":"https://api.github.com/users/luomiao/events{/privacy}","received_events_url":"https://api.github.com/users/luomiao/received_events","type":"User","site_admin":false},"repo":{"id":67172599,"name":"kubernetes","full_name":"luomiao/kubernetes","owner":{"login":"luomiao","id":8987721,"avatar_url":"https://avatars.githubusercontent.com/u/8987721?v=3","gravatar_id":"","url":"https://api.github.com/users/luomiao","html_url":"https://github.com/luomiao","followers_url":"https://api.github.com/users/luomiao/followers","following_url":"https://api.github.com/users/luomiao/following{/other_user}","gists_url":"https://api.github.com/users/luomiao/gists{/gist_id}","starred_url":"https://api.github.com/users/luomiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luomiao/subscriptions","organizations_url":"https://api.github.com/users/luomiao/orgs","repos_url":"https://api.github.com/users/luomiao/repos","events_url":"https://api.github.com/users/luomiao/events{/privacy}","received_events_url":"https://api.github.com/users/luomiao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luomiao/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/luomiao/kubernetes","forks_url":"https://api.github.com/repos/luomiao/kubernetes/forks","keys_url":"https://api.github.com/repos/luomiao/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luomiao/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luomiao/kubernetes/teams","hooks_url":"https://api.github.com/repos/luomiao/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/luomiao/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/luomiao/kubernetes/events","assignees_url":"https://api.github.com/repos/luomiao/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/luomiao/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/luomiao/kubernetes/tags","blobs_url":"https://api.github.com/repos/luomiao/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luomiao/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luomiao/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/luomiao/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luomiao/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/luomiao/kubernetes/languages","stargazers_url":"https://api.github.com/repos/luomiao/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/luomiao/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/luomiao/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/luomiao/kubernetes/subscription","commits_url":"https://api.github.com/repos/luomiao/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/luomiao/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/luomiao/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/luomiao/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/luomiao/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/luomiao/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luomiao/kubernetes/merges","archive_url":"https://api.github.com/repos/luomiao/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luomiao/kubernetes/downloads","issues_url":"https://api.github.com/repos/luomiao/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/luomiao/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/luomiao/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/luomiao/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luomiao/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/luomiao/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/luomiao/kubernetes/deployments","created_at":"2016-09-01T23:07:37Z","updated_at":"2016-09-01T23:08:09Z","pushed_at":"2016-10-25T21:45:33Z","git_url":"git://github.com/luomiao/kubernetes.git","ssh_url":"git@github.com:luomiao/kubernetes.git","clone_url":"https://github.com/luomiao/kubernetes.git","svn_url":"https://github.com/luomiao/kubernetes","homepage":"http://kubernetes.io","size":346821,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vmware:photon-support-for-code-review","ref":"photon-support-for-code-review","sha":"8f23ca06e4e78d82883dea896d9c53d0b04a8569","user":{"login":"vmware","id":473334,"avatar_url":"https://avatars.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"repo":{"id":49536898,"name":"kubernetes","full_name":"vmware/kubernetes","owner":{"login":"vmware","id":473334,"avatar_url":"https://avatars.githubusercontent.com/u/473334?v=3","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vmware/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/vmware/kubernetes","forks_url":"https://api.github.com/repos/vmware/kubernetes/forks","keys_url":"https://api.github.com/repos/vmware/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmware/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmware/kubernetes/teams","hooks_url":"https://api.github.com/repos/vmware/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/vmware/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/vmware/kubernetes/events","assignees_url":"https://api.github.com/repos/vmware/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/vmware/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/vmware/kubernetes/tags","blobs_url":"https://api.github.com/repos/vmware/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmware/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmware/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmware/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmware/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/vmware/kubernetes/languages","stargazers_url":"https://api.github.com/repos/vmware/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/vmware/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/vmware/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/vmware/kubernetes/subscription","commits_url":"https://api.github.com/repos/vmware/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmware/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmware/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmware/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmware/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/vmware/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmware/kubernetes/merges","archive_url":"https://api.github.com/repos/vmware/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmware/kubernetes/downloads","issues_url":"https://api.github.com/repos/vmware/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/vmware/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/vmware/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/vmware/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmware/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/vmware/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/vmware/kubernetes/deployments","created_at":"2016-01-12T23:58:29Z","updated_at":"2016-10-24T22:23:21Z","pushed_at":"2016-10-25T21:48:33Z","git_url":"git://github.com/vmware/kubernetes.git","ssh_url":"git@github.com:vmware/kubernetes.git","clone_url":"https://github.com/vmware/kubernetes.git","svn_url":"https://github.com/vmware/kubernetes","homepage":"http://kubernetes.io","size":346174,"stargazers_count":5,"watchers_count":5,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/21"},"html":{"href":"https://github.com/vmware/kubernetes/pull/21"},"issue":{"href":"https://api.github.com/repos/vmware/kubernetes/issues/21"},"comments":{"href":"https://api.github.com/repos/vmware/kubernetes/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vmware/kubernetes/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/vmware/kubernetes/statuses/9ac62d5e1f09bc429ea61a1a6742332bed44658d"}}}}
{"actor":{"display_login":"AlainRoy"}}