{"action":"created","comment":{"url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/comments/196018270","pull_request_review_id":129484757,"id":196018270,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjAxODI3MA==","diff_hunk":"@@ -15,74 +15,70 @@\n package flexvolume\n \n import (\n-\t\"bytes\"\n \t\"testing\"\n )\n \n-const defaultTestOps = `{\"kubernetes.io/fsType\":\"ext4\",\"kubernetes.io/readwrite\":\"rw\"}`\n+const defaultTestOps = `{\"kubernetes.io/fsType\":\"ext4\",\"kubernetes.io/readwrite\":\"rw\",\"kubernetes.io/pvOrVolumeName\":\"mockvolumeid\"}`\n+const noVolIDTestOps = `{\"kubernetes.io/fsType\":\"ext4\",\"kubernetes.io/readwrite\":\"rw\"}`\n \n-func TestInit(t *testing.T) {\n-\tbak := out\n-\tout = new(bytes.Buffer)\n-\tdefer func() { out = bak }()\n+func assertSuccess(t *testing.T, expected DriverStatus, status DriverStatus) {\n+\tif status != expected {\n+\t\tt.Fatalf(`Expected '%#v' got '%#v'`, expected, status)\n+\t}\n+}\n \n-\tcode := 0\n-\tosexit := exit\n-\texit = func(c int) { code = c }\n-\tdefer func() { exit = osexit }()\n+func assertFailure(t *testing.T, expected DriverStatus, status DriverStatus) {\n+\tif status != expected {\n+\t\tt.Fatalf(`Expected '%#v' got '%#v'`, expected, status)\n+\t}\n+}\n \n-\tExecDriver(mockFlexvolumeDriver{}, []string{\"oci\", \"init\"})\n+func TestInit(t *testing.T) {\n+\tstatus := ExecDriver(map[string]Driver{\"oci-bvs\": mockFlexvolumeDriver{}},\n+\t\t[]string{\"oci\", \"init\"})\n \n-\tif out.(*bytes.Buffer).String() != `{\"status\":\"Success\"}`+\"\\n\" {\n-\t\tt.Fatalf(`Expected '{\"status\":\"Success\"}'; got %s`, out.(*bytes.Buffer).String())\n-\t}\n+\texpected := DriverStatus{Status: \"Success\"}\n \n-\tif code != 0 {\n-\t\tt.Fatalf(\"Expected 'exit 0'; got 'exit %d'\", code)\n-\t}\n+\tassertSuccess(t, expected, status)\n }\n \n // TestVolumeName tests that the getvolumename call-out results in\n // StatusNotSupported as the call-out is broken as of the latest stable Kube\n // release (1.6.4).\n func TestGetVolumeName(t *testing.T) {\n-\tbak := out\n-\tout = new(bytes.Buffer)\n-\tdefer func() { out = bak }()\n+\tstatus := ExecDriver(map[string]Driver{\"oci-bvs\": mockFlexvolumeDriver{}},","path":"pkg/flexvolume/flexvolume_test.go","position":55,"original_position":55,"commit_id":"26e9c2c4621e950740484f21a3bd04f1e770d485","original_commit_id":"26e9c2c4621e950740484f21a3bd04f1e770d485","user":{"login":"prydie","id":244160,"node_id":"MDQ6VXNlcjI0NDE2MA==","avatar_url":"https://avatars1.githubusercontent.com/u/244160?v=4","gravatar_id":"","url":"https://api.github.com/users/prydie","html_url":"https://github.com/prydie","followers_url":"https://api.github.com/users/prydie/followers","following_url":"https://api.github.com/users/prydie/following{/other_user}","gists_url":"https://api.github.com/users/prydie/gists{/gist_id}","starred_url":"https://api.github.com/users/prydie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prydie/subscriptions","organizations_url":"https://api.github.com/users/prydie/orgs","repos_url":"https://api.github.com/users/prydie/repos","events_url":"https://api.github.com/users/prydie/events{/privacy}","received_events_url":"https://api.github.com/users/prydie/received_events","type":"User","site_admin":false},"body":"nit: personally find the following more readable:\r\n```go\r\n\tstatus := ExecDriver(\r\n\t\tmap[string]Driver{\"oci-bvs\": mockFlexvolumeDriver{}},\r\n\t\t[]string{\"oci\", \"getvolumename\", defaultTestOps},\r\n\t)\r\n```","created_at":"2018-06-18T09:38:53Z","updated_at":"2018-06-18T09:44:54Z","html_url":"https://github.com/oracle/oci-flexvolume-driver/pull/127#discussion_r196018270","pull_request_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/127","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/comments/196018270"},"html":{"href":"https://github.com/oracle/oci-flexvolume-driver/pull/127#discussion_r196018270"},"pull_request":{"href":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/127","id":194929000,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0OTI5MDAw","html_url":"https://github.com/oracle/oci-flexvolume-driver/pull/127","diff_url":"https://github.com/oracle/oci-flexvolume-driver/pull/127.diff","patch_url":"https://github.com/oracle/oci-flexvolume-driver/pull/127.patch","issue_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/issues/127","number":127,"state":"open","locked":false,"title":"Support using symlinks to find correct driver","user":{"login":"harveylowndes","id":16415876,"node_id":"MDQ6VXNlcjE2NDE1ODc2","avatar_url":"https://avatars2.githubusercontent.com/u/16415876?v=4","gravatar_id":"","url":"https://api.github.com/users/harveylowndes","html_url":"https://github.com/harveylowndes","followers_url":"https://api.github.com/users/harveylowndes/followers","following_url":"https://api.github.com/users/harveylowndes/following{/other_user}","gists_url":"https://api.github.com/users/harveylowndes/gists{/gist_id}","starred_url":"https://api.github.com/users/harveylowndes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harveylowndes/subscriptions","organizations_url":"https://api.github.com/users/harveylowndes/orgs","repos_url":"https://api.github.com/users/harveylowndes/repos","events_url":"https://api.github.com/users/harveylowndes/events{/privacy}","received_events_url":"https://api.github.com/users/harveylowndes/received_events","type":"User","site_admin":false},"body":"Addresses https://github.com/oracle/oci-volume-provisioner/issues/131\r\n\r\nThe volume provisioner has been patched to now not use names to dispatch custom logic. A storage class can now use it's provisioner property to determine what driver should be used. At the moment only block volume storage is supported ```provisioner: oracle.com/oci-bvs``` with aim that file storage will soon be supported also https://github.com/oracle/oci-volume-provisioner/issues/90. Backwards compatible so that existing storage classes using ```provisioner: oracle.com/oci``` will default to using the block volume storage however this should be marked as deprecated and removed in a future release.","created_at":"2018-06-14T15:17:56Z","updated_at":"2018-06-18T09:44:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6445a7928f4fc3b8688f5cbb80ae94a6d76d4176","assignee":null,"assignees":[],"requested_reviewers":[{"login":"owainlewis","id":733944,"node_id":"MDQ6VXNlcjczMzk0NA==","avatar_url":"https://avatars1.githubusercontent.com/u/733944?v=4","gravatar_id":"","url":"https://api.github.com/users/owainlewis","html_url":"https://github.com/owainlewis","followers_url":"https://api.github.com/users/owainlewis/followers","following_url":"https://api.github.com/users/owainlewis/following{/other_user}","gists_url":"https://api.github.com/users/owainlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/owainlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owainlewis/subscriptions","organizations_url":"https://api.github.com/users/owainlewis/orgs","repos_url":"https://api.github.com/users/owainlewis/repos","events_url":"https://api.github.com/users/owainlewis/events{/privacy}","received_events_url":"https://api.github.com/users/owainlewis/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/127/commits","review_comments_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/127/comments","review_comment_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/issues/127/comments","statuses_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/statuses/26e9c2c4621e950740484f21a3bd04f1e770d485","head":{"label":"oracle:symlink-flexvolume-driver-provisioner","ref":"symlink-flexvolume-driver-provisioner","sha":"26e9c2c4621e950740484f21a3bd04f1e770d485","user":{"login":"oracle","id":4430336,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MzAzMzY=","avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"repo":{"id":102543925,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI1NDM5MjU=","name":"oci-flexvolume-driver","full_name":"oracle/oci-flexvolume-driver","owner":{"login":"oracle","id":4430336,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MzAzMzY=","avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oracle/oci-flexvolume-driver","description":"A Kubernetes volume driver for Oracle Cloud Infrastructure","fork":false,"url":"https://api.github.com/repos/oracle/oci-flexvolume-driver","forks_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/forks","keys_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/teams","hooks_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/hooks","issue_events_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/issues/events{/number}","events_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/events","assignees_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/assignees{/user}","branches_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/branches{/branch}","tags_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/tags","blobs_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/languages","stargazers_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/stargazers","contributors_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/contributors","subscribers_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/subscribers","subscription_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/subscription","commits_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/contents/{+path}","compare_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/merges","archive_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/downloads","issues_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/issues{/number}","pulls_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/labels{/name}","releases_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/releases{/id}","deployments_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/deployments","created_at":"2017-09-06T00:38:41Z","updated_at":"2018-06-16T06:39:49Z","pushed_at":"2018-06-14T16:39:02Z","git_url":"git://github.com/oracle/oci-flexvolume-driver.git","ssh_url":"git@github.com:oracle/oci-flexvolume-driver.git","clone_url":"https://github.com/oracle/oci-flexvolume-driver.git","svn_url":"https://github.com/oracle/oci-flexvolume-driver","homepage":"","size":2882,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":4,"open_issues":16,"watchers":8,"default_branch":"master"}},"base":{"label":"oracle:master","ref":"master","sha":"beafd4219d528192bff7f7d1d69dcf2a75b621d0","user":{"login":"oracle","id":4430336,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MzAzMzY=","avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"repo":{"id":102543925,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI1NDM5MjU=","name":"oci-flexvolume-driver","full_name":"oracle/oci-flexvolume-driver","owner":{"login":"oracle","id":4430336,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0MzAzMzY=","avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oracle/oci-flexvolume-driver","description":"A Kubernetes volume driver for Oracle Cloud Infrastructure","fork":false,"url":"https://api.github.com/repos/oracle/oci-flexvolume-driver","forks_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/forks","keys_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/teams","hooks_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/hooks","issue_events_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/issues/events{/number}","events_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/events","assignees_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/assignees{/user}","branches_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/branches{/branch}","tags_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/tags","blobs_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/languages","stargazers_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/stargazers","contributors_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/contributors","subscribers_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/subscribers","subscription_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/subscription","commits_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/contents/{+path}","compare_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/merges","archive_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/downloads","issues_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/issues{/number}","pulls_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/labels{/name}","releases_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/releases{/id}","deployments_url":"https://api.github.com/repos/oracle/oci-flexvolume-driver/deployments","created_at":"2017-09-06T00:38:41Z","updated_at":"2018-06-16T06:39:49Z","pushed_at":"2018-06-14T16:39:02Z","git_url":"git://github.com/oracle/oci-flexvolume-driver.git","ssh_url":"git@github.com:oracle/oci-flexvolume-driver.git","clone_url":"https://github.com/oracle/oci-flexvolume-driver.git","svn_url":"https://github.com/oracle/oci-flexvolume-driver","homepage":"","size":2882,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":4,"open_issues":16,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/127"},"html":{"href":"https://github.com/oracle/oci-flexvolume-driver/pull/127"},"issue":{"href":"https://api.github.com/repos/oracle/oci-flexvolume-driver/issues/127"},"comments":{"href":"https://api.github.com/repos/oracle/oci-flexvolume-driver/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oracle/oci-flexvolume-driver/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/oracle/oci-flexvolume-driver/statuses/26e9c2c4621e950740484f21a3bd04f1e770d485"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"prydie"}}