{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/25051596","id":25051596,"diff_hunk":"@@ -0,0 +1,215 @@\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 e2e\n+\n+import (\n+\t\"bytes\"\n+\t\"encoding/json\"\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"net/http\"\n+\t\"os/exec\"\n+\t\"path/filepath\"\n+\t\"strings\"\n+\t\"time\"\n+\n+\t. \"github.com/onsi/ginkgo\"\n+)\n+\n+const (\n+\tnautilusImage       = \"kubernetes/update-demo:nautilus\"\n+\tkittenImage         = \"kubernetes/update-demo:kitten\"\n+\tupdateDemoSelector  = \"name=update-demo\"\n+\tupdateDemoContainer = \"update-demo\"\n+)\n+\n+var _ = Describe(\"kubectl\", func() {\n+\n+\trunUpdateExample()\n+})\n+\n+func runUpdateExample() {\n+\tupdateDemoRoot := filepath.Join(root, \"examples/update-demo\")\n+\n+\tIt(fmt.Sprint(\"should create and stop a replication controller\"), func() {\n+\t\tnautilusPath := filepath.Join(updateDemoRoot, \"nautilus-rc.yaml\")\n+\n+\t\tdefer cleanup(nautilusPath, updateDemoSelector)\n+\t\tBy(\"creating a replication controller\")\n+\t\trunKubectl(\"create\", \"-f\", nautilusPath)\n+\t\tvalidateController(updateDemoSelector, updateDemoContainer, nautilusImage, 2, 30*time.Second)\n+\t})\n+\n+\tIt(fmt.Sprint(\"should scale a replication controller\"), func() {\n+\t\tnautilusPath := filepath.Join(updateDemoRoot, \"nautilus-rc.yaml\")\n+\n+\t\tdefer cleanup(nautilusPath, updateDemoSelector)\n+\t\tBy(\"creating a replication controller\")\n+\t\trunKubectl(\"create\", \"-f\", nautilusPath)\n+\t\tvalidateController(updateDemoSelector, updateDemoContainer, nautilusImage, 2, 30*time.Second)\n+\t\tBy(\"scaling down the replication controller\")\n+\t\trunKubectl(\"resize\", \"rc\", \"update-demo-nautilus\", \"--replicas=1\")\n+\t\tvalidateController(updateDemoSelector, updateDemoContainer, nautilusImage, 1, 30*time.Second)\n+\t\tBy(\"scaling up the replication controller\")\n+\t\trunKubectl(\"resize\", \"rc\", \"update-demo-nautilus\", \"--replicas=2\")\n+\t\tvalidateController(updateDemoSelector, updateDemoContainer, nautilusImage, 2, 30*time.Second)\n+\t})\n+\n+\tIt(fmt.Sprint(\"should do a rolling update of a replication controller\"), func() {\n+\t\tnautilusPath := filepath.Join(updateDemoRoot, \"nautilus-rc.yaml\")\n+\t\tkittenPath := filepath.Join(updateDemoRoot, \"kitten-rc.yaml\")\n+\n+\t\t// Cleanup all resources incase we fail somewhere in the middle\n+\t\tdefer cleanup(updateDemoRoot, updateDemoSelector)\n+\n+\t\tBy(\"creating the initial replication controller\")\n+\t\trunKubectl(\"create\", \"-f\", nautilusPath)\n+\t\tvalidateController(updateDemoSelector, updateDemoContainer, nautilusImage, 2, 30*time.Second)\n+\t\tBy(\"rollingupdate to new replication controller\")\n+\t\trunKubectl(\"rollingupdate\", \"update-demo-nautilus\", \"--update-period=1s\", \"-f\", kittenPath)\n+\t\tvalidateController(updateDemoSelector, updateDemoContainer, kittenImage, 2, 30*time.Second)\n+\t})\n+\n+}\n+\n+func cleanup(filePath, selector string) {","path":"test/e2e/kubectl.go","position":89,"original_position":89,"commit_id":"118df24d22725df0cdffb20300ded3fe0bb929c9","original_commit_id":"118df24d22725df0cdffb20300ded3fe0bb929c9","user":{"login":"roberthbailey","id":7751204,"avatar_url":"https://avatars.githubusercontent.com/u/7751204?v=3","gravatar_id":"","url":"https://api.github.com/users/roberthbailey","html_url":"https://github.com/roberthbailey","followers_url":"https://api.github.com/users/roberthbailey/followers","following_url":"https://api.github.com/users/roberthbailey/following{/other_user}","gists_url":"https://api.github.com/users/roberthbailey/gists{/gist_id}","starred_url":"https://api.github.com/users/roberthbailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roberthbailey/subscriptions","organizations_url":"https://api.github.com/users/roberthbailey/orgs","repos_url":"https://api.github.com/users/roberthbailey/repos","events_url":"https://api.github.com/users/roberthbailey/events{/privacy}","received_events_url":"https://api.github.com/users/roberthbailey/received_events","type":"User","site_admin":false},"body":"Every call to cleanup passes updateDemoSelector as the 2nd argument. Do we really need to parameterize it as an argument?","created_at":"2015-02-20T06:42:53Z","updated_at":"2015-02-20T06:42:53Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4637#discussion_r25051596","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4637","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/25051596"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4637#discussion_r25051596"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4637"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4637","id":29664737,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4637","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4637.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4637.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/4637","number":4637,"state":"open","locked":false,"title":"Port update.sh to ginkgo test","user":{"login":"jlowdermilk","id":2101035,"avatar_url":"https://avatars.githubusercontent.com/u/2101035?v=3","gravatar_id":"","url":"https://api.github.com/users/jlowdermilk","html_url":"https://github.com/jlowdermilk","followers_url":"https://api.github.com/users/jlowdermilk/followers","following_url":"https://api.github.com/users/jlowdermilk/following{/other_user}","gists_url":"https://api.github.com/users/jlowdermilk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlowdermilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlowdermilk/subscriptions","organizations_url":"https://api.github.com/users/jlowdermilk/orgs","repos_url":"https://api.github.com/users/jlowdermilk/repos","events_url":"https://api.github.com/users/jlowdermilk/events{/privacy}","received_events_url":"https://api.github.com/users/jlowdermilk/received_events","type":"User","site_admin":false},"body":"Closes #3694. Goal is to use kubectl.go for specs that specifically test kubectl. `guestbook.sh` will be ported/added to it in a follow up PR.\r\n\r\ncc @roberthbailey, @satnam6502 ","created_at":"2015-02-20T00:53:55Z","updated_at":"2015-02-20T06:42:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9c65fc7ec720da5c615ca5e450cae6f7a0ed8e0","assignee":{"login":"satnam6502","id":6164339,"avatar_url":"https://avatars.githubusercontent.com/u/6164339?v=3","gravatar_id":"","url":"https://api.github.com/users/satnam6502","html_url":"https://github.com/satnam6502","followers_url":"https://api.github.com/users/satnam6502/followers","following_url":"https://api.github.com/users/satnam6502/following{/other_user}","gists_url":"https://api.github.com/users/satnam6502/gists{/gist_id}","starred_url":"https://api.github.com/users/satnam6502/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satnam6502/subscriptions","organizations_url":"https://api.github.com/users/satnam6502/orgs","repos_url":"https://api.github.com/users/satnam6502/repos","events_url":"https://api.github.com/users/satnam6502/events{/privacy}","received_events_url":"https://api.github.com/users/satnam6502/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4637/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4637/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/4637/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/118df24d22725df0cdffb20300ded3fe0bb929c9","head":{"label":"jlowdermilk:examples-e2e","ref":"examples-e2e","sha":"118df24d22725df0cdffb20300ded3fe0bb929c9","user":{"login":"jlowdermilk","id":2101035,"avatar_url":"https://avatars.githubusercontent.com/u/2101035?v=3","gravatar_id":"","url":"https://api.github.com/users/jlowdermilk","html_url":"https://github.com/jlowdermilk","followers_url":"https://api.github.com/users/jlowdermilk/followers","following_url":"https://api.github.com/users/jlowdermilk/following{/other_user}","gists_url":"https://api.github.com/users/jlowdermilk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlowdermilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlowdermilk/subscriptions","organizations_url":"https://api.github.com/users/jlowdermilk/orgs","repos_url":"https://api.github.com/users/jlowdermilk/repos","events_url":"https://api.github.com/users/jlowdermilk/events{/privacy}","received_events_url":"https://api.github.com/users/jlowdermilk/received_events","type":"User","site_admin":false},"repo":{"id":22360041,"name":"kubernetes","full_name":"jlowdermilk/kubernetes","owner":{"login":"jlowdermilk","id":2101035,"avatar_url":"https://avatars.githubusercontent.com/u/2101035?v=3","gravatar_id":"","url":"https://api.github.com/users/jlowdermilk","html_url":"https://github.com/jlowdermilk","followers_url":"https://api.github.com/users/jlowdermilk/followers","following_url":"https://api.github.com/users/jlowdermilk/following{/other_user}","gists_url":"https://api.github.com/users/jlowdermilk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlowdermilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlowdermilk/subscriptions","organizations_url":"https://api.github.com/users/jlowdermilk/orgs","repos_url":"https://api.github.com/users/jlowdermilk/repos","events_url":"https://api.github.com/users/jlowdermilk/events{/privacy}","received_events_url":"https://api.github.com/users/jlowdermilk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jlowdermilk/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/jlowdermilk/kubernetes","forks_url":"https://api.github.com/repos/jlowdermilk/kubernetes/forks","keys_url":"https://api.github.com/repos/jlowdermilk/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jlowdermilk/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jlowdermilk/kubernetes/teams","hooks_url":"https://api.github.com/repos/jlowdermilk/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/jlowdermilk/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/jlowdermilk/kubernetes/events","assignees_url":"https://api.github.com/repos/jlowdermilk/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/jlowdermilk/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/jlowdermilk/kubernetes/tags","blobs_url":"https://api.github.com/repos/jlowdermilk/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jlowdermilk/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jlowdermilk/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/jlowdermilk/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jlowdermilk/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/jlowdermilk/kubernetes/languages","stargazers_url":"https://api.github.com/repos/jlowdermilk/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/jlowdermilk/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/jlowdermilk/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/jlowdermilk/kubernetes/subscription","commits_url":"https://api.github.com/repos/jlowdermilk/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/jlowdermilk/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/jlowdermilk/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/jlowdermilk/kubernetes/issues/comments/{number}","contents_url":"https://api.github.com/repos/jlowdermilk/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/jlowdermilk/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jlowdermilk/kubernetes/merges","archive_url":"https://api.github.com/repos/jlowdermilk/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jlowdermilk/kubernetes/downloads","issues_url":"https://api.github.com/repos/jlowdermilk/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/jlowdermilk/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/jlowdermilk/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/jlowdermilk/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jlowdermilk/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/jlowdermilk/kubernetes/releases{/id}","created_at":"2014-07-28T22:24:44Z","updated_at":"2015-02-19T19:37:48Z","pushed_at":"2015-02-20T01:36:45Z","git_url":"git://github.com/jlowdermilk/kubernetes.git","ssh_url":"git@github.com:jlowdermilk/kubernetes.git","clone_url":"https://github.com/jlowdermilk/kubernetes.git","svn_url":"https://github.com/jlowdermilk/kubernetes","homepage":null,"size":29692,"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":"GoogleCloudPlatform:master","ref":"master","sha":"597dedf762163aaff398f8760950e93ccf78556b","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","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=3","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":"2015-02-20T04:12:06Z","pushed_at":"2015-02-20T03:02:16Z","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":"http://kubernetes.io","size":82023,"stargazers_count":6273,"watchers_count":6273,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1099,"mirror_url":null,"open_issues_count":743,"forks":1099,"open_issues":743,"watchers":6273,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4637"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4637"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/4637"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/4637/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4637/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4637/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/118df24d22725df0cdffb20300ded3fe0bb929c9"}}}}