{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/comments/41471357","id":41471357,"diff_hunk":"@@ -0,0 +1,212 @@\n+/*\n+Copyright 2014 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 main\n+\n+import (\n+\t\"fmt\"\n+\t\"strconv\"\n+\n+\tcompute \"google.golang.org/api/compute/v1\"\n+\n+\t\"k8s.io/kubernetes/pkg/util/sets\"\n+\n+\t\"github.com/golang/glog\"\n+)\n+\n+type Backends struct {\n+\tcloud          BackendServices\n+\tinstanceGroups InstanceGroups\n+\tpool           *poolStore\n+\tdefaultIg      *compute.InstanceGroup\n+\tdefaultBackend *compute.BackendService\n+\tdefaultHc      *compute.HttpHealthCheck\n+}\n+\n+func portKey(port int64) string {\n+\treturn fmt.Sprintf(\"%v\", port)\n+}\n+\n+func beName(port int64) string {\n+\treturn fmt.Sprintf(\"%v-%v\", backendPrefix, port)\n+}\n+\n+func NewBackendPool(\n+\tcloud BackendServices,\n+\tdefaultBackendNodePort int64,\n+\tdefaultIg *compute.InstanceGroup,\n+\tdefaultHc *compute.HttpHealthCheck,\n+\tinstanceGroups InstanceGroups) (BackendPool, error) {\n+\tbackends := &Backends{\n+\t\tcloud:          cloud,\n+\t\tinstanceGroups: instanceGroups,\n+\t\tpool:           newPoolStore(),\n+\t\tdefaultIg:      defaultIg,\n+\t\tdefaultHc:      defaultHc,\n+\t}\n+\terr := backends.Add(defaultBackendNodePort)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\tbackends.defaultBackend, err = backends.Get(defaultBackendNodePort)","path":"service-loadbalancer/gce/backends.go","position":64,"original_position":64,"commit_id":"3492f429c23435c73e0cfd8eba06da4a6efc5087","original_commit_id":"3492f429c23435c73e0cfd8eba06da4a6efc5087","user":{"login":"brendandburns","id":5751682,"avatar_url":"https://avatars.githubusercontent.com/u/5751682?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandburns","html_url":"https://github.com/brendandburns","followers_url":"https://api.github.com/users/brendandburns/followers","following_url":"https://api.github.com/users/brendandburns/following{/other_user}","gists_url":"https://api.github.com/users/brendandburns/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandburns/subscriptions","organizations_url":"https://api.github.com/users/brendandburns/orgs","repos_url":"https://api.github.com/users/brendandburns/repos","events_url":"https://api.github.com/users/brendandburns/events{/privacy}","received_events_url":"https://api.github.com/users/brendandburns/received_events","type":"User","site_admin":false},"body":"why not just\r\n\r\n```go\r\nreturn backends.Get(defaultBackendNodePort)\r\n```\r\n","created_at":"2015-10-08T02:46:15Z","updated_at":"2015-10-08T02:46:15Z","html_url":"https://github.com/kubernetes/contrib/pull/132#discussion_r41471357","pull_request_url":"https://api.github.com/repos/kubernetes/contrib/pulls/132","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/comments/41471357"},"html":{"href":"https://github.com/kubernetes/contrib/pull/132#discussion_r41471357"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/132"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/132","id":46477684,"html_url":"https://github.com/kubernetes/contrib/pull/132","diff_url":"https://github.com/kubernetes/contrib/pull/132.diff","patch_url":"https://github.com/kubernetes/contrib/pull/132.patch","issue_url":"https://api.github.com/repos/kubernetes/contrib/issues/132","number":132,"state":"open","locked":false,"title":"Gce L7s through Kubernetes Ingress","user":{"login":"bprashanth","id":10927820,"avatar_url":"https://avatars.githubusercontent.com/u/10927820?v=3","gravatar_id":"","url":"https://api.github.com/users/bprashanth","html_url":"https://github.com/bprashanth","followers_url":"https://api.github.com/users/bprashanth/followers","following_url":"https://api.github.com/users/bprashanth/following{/other_user}","gists_url":"https://api.github.com/users/bprashanth/gists{/gist_id}","starred_url":"https://api.github.com/users/bprashanth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bprashanth/subscriptions","organizations_url":"https://api.github.com/users/bprashanth/orgs","repos_url":"https://api.github.com/users/bprashanth/repos","events_url":"https://api.github.com/users/bprashanth/events{/privacy}","received_events_url":"https://api.github.com/users/bprashanth/received_events","type":"User","site_admin":false},"body":"Depends on https://github.com/kubernetes/kubernetes/pull/14459 \r\nProbably just want to wait on the README for a Tl;Dr. ","created_at":"2015-10-01T01:52:01Z","updated_at":"2015-10-08T02:46:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"115438008c5ef32ce6f43bac249a55cd768dcd08","assignee":{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/contrib/pulls/132/commits","review_comments_url":"https://api.github.com/repos/kubernetes/contrib/pulls/132/comments","review_comment_url":"https://api.github.com/repos/kubernetes/contrib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/contrib/issues/132/comments","statuses_url":"https://api.github.com/repos/kubernetes/contrib/statuses/3492f429c23435c73e0cfd8eba06da4a6efc5087","head":{"label":"bprashanth:gcelb","ref":"gcelb","sha":"3492f429c23435c73e0cfd8eba06da4a6efc5087","user":{"login":"bprashanth","id":10927820,"avatar_url":"https://avatars.githubusercontent.com/u/10927820?v=3","gravatar_id":"","url":"https://api.github.com/users/bprashanth","html_url":"https://github.com/bprashanth","followers_url":"https://api.github.com/users/bprashanth/followers","following_url":"https://api.github.com/users/bprashanth/following{/other_user}","gists_url":"https://api.github.com/users/bprashanth/gists{/gist_id}","starred_url":"https://api.github.com/users/bprashanth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bprashanth/subscriptions","organizations_url":"https://api.github.com/users/bprashanth/orgs","repos_url":"https://api.github.com/users/bprashanth/repos","events_url":"https://api.github.com/users/bprashanth/events{/privacy}","received_events_url":"https://api.github.com/users/bprashanth/received_events","type":"User","site_admin":false},"repo":{"id":41126871,"name":"contrib","full_name":"bprashanth/contrib","owner":{"login":"bprashanth","id":10927820,"avatar_url":"https://avatars.githubusercontent.com/u/10927820?v=3","gravatar_id":"","url":"https://api.github.com/users/bprashanth","html_url":"https://github.com/bprashanth","followers_url":"https://api.github.com/users/bprashanth/followers","following_url":"https://api.github.com/users/bprashanth/following{/other_user}","gists_url":"https://api.github.com/users/bprashanth/gists{/gist_id}","starred_url":"https://api.github.com/users/bprashanth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bprashanth/subscriptions","organizations_url":"https://api.github.com/users/bprashanth/orgs","repos_url":"https://api.github.com/users/bprashanth/repos","events_url":"https://api.github.com/users/bprashanth/events{/privacy}","received_events_url":"https://api.github.com/users/bprashanth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bprashanth/contrib","description":"","fork":true,"url":"https://api.github.com/repos/bprashanth/contrib","forks_url":"https://api.github.com/repos/bprashanth/contrib/forks","keys_url":"https://api.github.com/repos/bprashanth/contrib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bprashanth/contrib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bprashanth/contrib/teams","hooks_url":"https://api.github.com/repos/bprashanth/contrib/hooks","issue_events_url":"https://api.github.com/repos/bprashanth/contrib/issues/events{/number}","events_url":"https://api.github.com/repos/bprashanth/contrib/events","assignees_url":"https://api.github.com/repos/bprashanth/contrib/assignees{/user}","branches_url":"https://api.github.com/repos/bprashanth/contrib/branches{/branch}","tags_url":"https://api.github.com/repos/bprashanth/contrib/tags","blobs_url":"https://api.github.com/repos/bprashanth/contrib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bprashanth/contrib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bprashanth/contrib/git/refs{/sha}","trees_url":"https://api.github.com/repos/bprashanth/contrib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bprashanth/contrib/statuses/{sha}","languages_url":"https://api.github.com/repos/bprashanth/contrib/languages","stargazers_url":"https://api.github.com/repos/bprashanth/contrib/stargazers","contributors_url":"https://api.github.com/repos/bprashanth/contrib/contributors","subscribers_url":"https://api.github.com/repos/bprashanth/contrib/subscribers","subscription_url":"https://api.github.com/repos/bprashanth/contrib/subscription","commits_url":"https://api.github.com/repos/bprashanth/contrib/commits{/sha}","git_commits_url":"https://api.github.com/repos/bprashanth/contrib/git/commits{/sha}","comments_url":"https://api.github.com/repos/bprashanth/contrib/comments{/number}","issue_comment_url":"https://api.github.com/repos/bprashanth/contrib/issues/comments{/number}","contents_url":"https://api.github.com/repos/bprashanth/contrib/contents/{+path}","compare_url":"https://api.github.com/repos/bprashanth/contrib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bprashanth/contrib/merges","archive_url":"https://api.github.com/repos/bprashanth/contrib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bprashanth/contrib/downloads","issues_url":"https://api.github.com/repos/bprashanth/contrib/issues{/number}","pulls_url":"https://api.github.com/repos/bprashanth/contrib/pulls{/number}","milestones_url":"https://api.github.com/repos/bprashanth/contrib/milestones{/number}","notifications_url":"https://api.github.com/repos/bprashanth/contrib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bprashanth/contrib/labels{/name}","releases_url":"https://api.github.com/repos/bprashanth/contrib/releases{/id}","created_at":"2015-08-21T01:24:13Z","updated_at":"2015-08-21T01:24:13Z","pushed_at":"2015-10-08T02:33:47Z","git_url":"git://github.com/bprashanth/contrib.git","ssh_url":"git@github.com:bprashanth/contrib.git","clone_url":"https://github.com/bprashanth/contrib.git","svn_url":"https://github.com/bprashanth/contrib","homepage":null,"size":6578,"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":"kubernetes:master","ref":"master","sha":"c15fcb659d1629664c7983f4ef441cb98c10d73f","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":40686014,"name":"contrib","full_name":"kubernetes/contrib","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/contrib","description":"This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core.","fork":false,"url":"https://api.github.com/repos/kubernetes/contrib","forks_url":"https://api.github.com/repos/kubernetes/contrib/forks","keys_url":"https://api.github.com/repos/kubernetes/contrib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/contrib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/contrib/teams","hooks_url":"https://api.github.com/repos/kubernetes/contrib/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/contrib/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/contrib/events","assignees_url":"https://api.github.com/repos/kubernetes/contrib/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/contrib/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/contrib/tags","blobs_url":"https://api.github.com/repos/kubernetes/contrib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/contrib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/contrib/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/contrib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/contrib/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/contrib/languages","stargazers_url":"https://api.github.com/repos/kubernetes/contrib/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/contrib/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/contrib/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/contrib/subscription","commits_url":"https://api.github.com/repos/kubernetes/contrib/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/contrib/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/contrib/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/contrib/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/contrib/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/contrib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/contrib/merges","archive_url":"https://api.github.com/repos/kubernetes/contrib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/contrib/downloads","issues_url":"https://api.github.com/repos/kubernetes/contrib/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/contrib/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/contrib/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/contrib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/contrib/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/contrib/releases{/id}","created_at":"2015-08-13T23:18:26Z","updated_at":"2015-10-05T13:45:52Z","pushed_at":"2015-10-08T02:33:47Z","git_url":"git://github.com/kubernetes/contrib.git","ssh_url":"git@github.com:kubernetes/contrib.git","clone_url":"https://github.com/kubernetes/contrib.git","svn_url":"https://github.com/kubernetes/contrib","homepage":"","size":7999,"stargazers_count":41,"watchers_count":41,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":30,"forks":51,"open_issues":30,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/132"},"html":{"href":"https://github.com/kubernetes/contrib/pull/132"},"issue":{"href":"https://api.github.com/repos/kubernetes/contrib/issues/132"},"comments":{"href":"https://api.github.com/repos/kubernetes/contrib/issues/132/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/132/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/132/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/contrib/statuses/3492f429c23435c73e0cfd8eba06da4a6efc5087"}}}}