GitHub PullRequestReviewCommentEvent at 2014-10-14 06:15:50
Repository: kubernetes
Actor: lavalamp
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/18810510","id":18810510,"diff_hunk":"@@ -0,0 +1,133 @@\n+/*\n+Copyright 2014 Google Inc. 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 openstack_cloud\n+\n+import (\n+\t\"os\"\n+\t\"strings\"\n+\t\"testing\"\n+)\n+\n+func TestReadOpenStackCloud(t *testing.T) {\n+\t_, err := readOpenStackCloud(nil)\n+\tif err == nil {\n+\t\tt.Errorf(\"Should fail when no config is provided: %s\", err)\n+\t}\n+\n+\tcfg, err := readOpenStackCloud(strings.NewReader(`\n+[Global]\n+authurl = http://auth.url\n+username = user\n+`))\n+\tif err != nil {\n+\t\tt.Fatalf(\"Should succeed when a valid config is provided: %s\", err)\n+\t}\n+\tif cfg.Global.AuthUrl != \"http://auth.url\" {\n+\t\tt.Errorf(\"incorrect authurl: %s\", cfg.Global.AuthUrl)\n+\t}\n+}\n+\n+func TestToAuthOptions(t *testing.T) {\n+\tcfg := OpenStackCloudConfig{}\n+\tcfg.Global.Username = \"user\"\n+\t// etc.\n+\n+\tao := cfg.toAuthOptions()\n+\n+\tif !ao.AllowReauth {\n+\t\tt.Errorf(\"Will need to be able to reauthenticate\")\n+\t}\n+\tif ao.Username != cfg.Global.Username {\n+\t\tt.Errorf(\"Username %s != %s\", ao.Username, cfg.Global.Username)\n+\t}\n+}\n+\n+func cloudConfigFromEnv() (cfg OpenStackCloudConfig, ok bool) {\n+\tcfg.Global.AuthUrl = os.Getenv(\"OS_AUTH_URL\")\n+\t// gophercloud wants \"provider\" to point specifically at tokens URL\n+\tif !strings.HasSuffix(cfg.Global.AuthUrl, \"/tokens\") {\n+\t\tcfg.Global.AuthUrl += \"/tokens\"\n+\t}\n+\n+\tcfg.Global.TenantId = os.Getenv(\"OS_TENANT_ID\")\n+\t// Rax/nova _insists_ that we don't specify both tenant ID and name\n+\tif cfg.Global.TenantId == \"\" {\n+\t\tcfg.Global.TenantName = os.Getenv(\"OS_TENANT_NAME\")\n+\t}\n+\n+\tcfg.Global.Username = os.Getenv(\"OS_USERNAME\")\n+\tcfg.Global.Password = os.Getenv(\"OS_PASSWORD\")\n+\tcfg.Global.ApiKey = os.Getenv(\"OS_API_KEY\")\n+\tcfg.Global.Region = os.Getenv(\"OS_REGION_NAME\")\n+\n+\tok = (cfg.Global.AuthUrl != \"\" &&\n+\t\tcfg.Global.Username != \"\" &&\n+\t\t(cfg.Global.Password != \"\" || cfg.Global.ApiKey != \"\") &&\n+\t\t(cfg.Global.TenantId != \"\" || cfg.Global.TenantName != \"\"))\n+\n+\treturn\n+}\n+\n+func TestNewOpenStackCloud(t *testing.T) {\n+\tcfg, ok := cloudConfigFromEnv()\n+\tif !ok {\n+\t\tt.Skipf(\"No config found in environment\")\n+\t}\n+\n+\t_, err := newOpenStackCloud(cfg)\n+\tif err != nil {\n+\t\tt.Fatalf(\"Failed to construct/authenticate  OpenStackCloud: %s\", err)\n+\t}\n+}\n+\n+func TestInstances(t *testing.T) {\n+\tcfg, ok := cloudConfigFromEnv()\n+\tif !ok {\n+\t\tt.Skipf(\"No config found in environment\")","path":"pkg/cloudprovider/openstack/openstack_test.go","position":100,"original_position":100,"commit_id":"d2c7132c74fbc59f0d7dbeb71462390a54930392","original_commit_id":"d2c7132c74fbc59f0d7dbeb71462390a54930392","user":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=2","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},"body":"Are we supposed to run this test with some env vars set?","created_at":"2014-10-14T06:15:50Z","updated_at":"2014-10-14T06:15:50Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/1676#discussion_r18810510","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/1676","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/18810510"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/1676#discussion_r18810510"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/1676"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/1676","id":22501674,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/1676","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/1676.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/1676.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/1676","number":1676,"state":"open","locked":false,"title":"Add OpenStack cloud provider","user":{"login":"anguslees","id":224224,"avatar_url":"https://avatars.githubusercontent.com/u/224224?v=2","gravatar_id":"","url":"https://api.github.com/users/anguslees","html_url":"https://github.com/anguslees","followers_url":"https://api.github.com/users/anguslees/followers","following_url":"https://api.github.com/users/anguslees/following{/other_user}","gists_url":"https://api.github.com/users/anguslees/gists{/gist_id}","starred_url":"https://api.github.com/users/anguslees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anguslees/subscriptions","organizations_url":"https://api.github.com/users/anguslees/orgs","repos_url":"https://api.github.com/users/anguslees/repos","events_url":"https://api.github.com/users/anguslees/events{/privacy}","received_events_url":"https://api.github.com/users/anguslees/received_events","type":"User","site_admin":false},"body":"So far only implements Instances() interface.","created_at":"2014-10-09T15:32:15Z","updated_at":"2014-10-14T06:15:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cbb006845316f8dc36b9ebf4699b201d56470a5f","assignee":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=2","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/GoogleCloudPlatform/kubernetes/pulls/1676/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/1676/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/1676/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/d2c7132c74fbc59f0d7dbeb71462390a54930392","head":{"label":"anguslees:openstack-provider","ref":"openstack-provider","sha":"d2c7132c74fbc59f0d7dbeb71462390a54930392","user":{"login":"anguslees","id":224224,"avatar_url":"https://avatars.githubusercontent.com/u/224224?v=2","gravatar_id":"","url":"https://api.github.com/users/anguslees","html_url":"https://github.com/anguslees","followers_url":"https://api.github.com/users/anguslees/followers","following_url":"https://api.github.com/users/anguslees/following{/other_user}","gists_url":"https://api.github.com/users/anguslees/gists{/gist_id}","starred_url":"https://api.github.com/users/anguslees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anguslees/subscriptions","organizations_url":"https://api.github.com/users/anguslees/orgs","repos_url":"https://api.github.com/users/anguslees/repos","events_url":"https://api.github.com/users/anguslees/events{/privacy}","received_events_url":"https://api.github.com/users/anguslees/received_events","type":"User","site_admin":false},"repo":{"id":24916948,"name":"kubernetes","full_name":"anguslees/kubernetes","owner":{"login":"anguslees","id":224224,"avatar_url":"https://avatars.githubusercontent.com/u/224224?v=2","gravatar_id":"","url":"https://api.github.com/users/anguslees","html_url":"https://github.com/anguslees","followers_url":"https://api.github.com/users/anguslees/followers","following_url":"https://api.github.com/users/anguslees/following{/other_user}","gists_url":"https://api.github.com/users/anguslees/gists{/gist_id}","starred_url":"https://api.github.com/users/anguslees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anguslees/subscriptions","organizations_url":"https://api.github.com/users/anguslees/orgs","repos_url":"https://api.github.com/users/anguslees/repos","events_url":"https://api.github.com/users/anguslees/events{/privacy}","received_events_url":"https://api.github.com/users/anguslees/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anguslees/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/anguslees/kubernetes","forks_url":"https://api.github.com/repos/anguslees/kubernetes/forks","keys_url":"https://api.github.com/repos/anguslees/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anguslees/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anguslees/kubernetes/teams","hooks_url":"https://api.github.com/repos/anguslees/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/anguslees/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/anguslees/kubernetes/events","assignees_url":"https://api.github.com/repos/anguslees/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/anguslees/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/anguslees/kubernetes/tags","blobs_url":"https://api.github.com/repos/anguslees/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anguslees/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anguslees/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/anguslees/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anguslees/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/anguslees/kubernetes/languages","stargazers_url":"https://api.github.com/repos/anguslees/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/anguslees/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/anguslees/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/anguslees/kubernetes/subscription","commits_url":"https://api.github.com/repos/anguslees/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/anguslees/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/anguslees/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/anguslees/kubernetes/issues/comments/{number}","contents_url":"https://api.github.com/repos/anguslees/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/anguslees/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anguslees/kubernetes/merges","archive_url":"https://api.github.com/repos/anguslees/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anguslees/kubernetes/downloads","issues_url":"https://api.github.com/repos/anguslees/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/anguslees/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/anguslees/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/anguslees/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anguslees/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/anguslees/kubernetes/releases{/id}","created_at":"2014-10-08T00:00:18Z","updated_at":"2014-10-09T03:46:27Z","pushed_at":"2014-10-11T06:25:05Z","git_url":"git://github.com/anguslees/kubernetes.git","ssh_url":"git@github.com:anguslees/kubernetes.git","clone_url":"https://github.com/anguslees/kubernetes.git","svn_url":"https://github.com/anguslees/kubernetes","homepage":null,"size":11055,"stargazers_count":2,"watchers_count":2,"language":null,"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":2,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"695fbee3434ccaa6564164999f203b79c1198de3","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=2","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"GoogleCloudPlatform/kubernetes","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=2","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes","description":"Container Cluster Manager","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments/{number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2014-10-14T04:14:24Z","pushed_at":"2014-10-14T01:30:45Z","git_url":"git://github.com/GoogleCloudPlatform/kubernetes.git","ssh_url":"git@github.com:GoogleCloudPlatform/kubernetes.git","clone_url":"https://github.com/GoogleCloudPlatform/kubernetes.git","svn_url":"https://github.com/GoogleCloudPlatform/kubernetes","homepage":null,"size":39301,"stargazers_count":3966,"watchers_count":3966,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":586,"mirror_url":null,"open_issues_count":286,"forks":586,"open_issues":286,"watchers":3966,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/1676"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/1676"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/1676"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/1676/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/1676/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/1676/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/d2c7132c74fbc59f0d7dbeb71462390a54930392"}}}}