{"action":"created","comment":{"url":"https://api.github.com/repos/kowala-tech/kUSD/pulls/comments/177054730","pull_request_review_id":106859911,"id":177054730,"diff_hunk":"@@ -0,0 +1,114 @@\n+package cluster\n+\n+import (\n+\t\"encoding/hex\"\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"log\"\n+\t\"math/rand\"\n+\t\"regexp\"\n+\t\"time\"\n+\n+\tapiv1 \"k8s.io/api/core/v1\"\n+\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n+)\n+\n+const (\n+\tbootnodeEnodeKey = \"bootnode-enode\"\n+\tbootnodePort     = 33445\n+)\n+\n+var (\n+\tsrc               = rand.New(rand.NewSource(time.Now().UnixNano()))\n+\tenodeSecretRegexp = regexp.MustCompile(`enode://([a-f0-9]*)@`)\n+)\n+\n+// RunBootnode Runs the bootnode\n+func (client *cluster) RunBootnode() error {\n+\tlog.Println(\"Running bootnode\")\n+\tpod := bootnodePod(\"bootnode\", randStringBytes(64))\n+\n+\t_, err := client.Clientset.CoreV1().Pods(Namespace).Create(pod)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\terr = client.waitForPod(\"bootnode\")\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tenode, err := client.bootnodeEnode()\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\treturn client.StoreString(bootnodeEnodeKey, enode)\n+}\n+\n+func (client *cluster) bootnodeEnode() (string, error) {\n+\tlog.Println(\"Reading bootnode enode from its stdout\")\n+\tpods := client.Clientset.CoreV1().Pods(Namespace)\n+\tpod, err := pods.Get(\"bootnode\", metav1.GetOptions{})\n+\tif err != nil {\n+\t\treturn \"\", err\n+\t}\n+\tlogStream, err := pods.GetLogs(\"bootnode\", &apiv1.PodLogOptions{}).Stream()\n+\tif err != nil {\n+\t\treturn \"\", err\n+\t}\n+\n+\tdefer logStream.Close()\n+\tdata, err := ioutil.ReadAll(logStream)\n+\tif err != nil {\n+\t\treturn \"\", err\n+\t}\n+\tfound := enodeSecretRegexp.FindSubmatch(data)\n+\tif len(found) != 2 {\n+\t\treturn \"\", fmt.Errorf(\"Bootnode enode not found in the logs.\")\n+\t}\n+\n+\tenodeSecret := string(found[1])\n+\tip := pod.Status.PodIP\n+\n+\treturn fmt.Sprintf(`enode://%v@%v:%v`, enodeSecret, ip, bootnodePort), nil\n+}\n+\n+func randStringBytes(n int) string {","path":"cluster/bootnode.go","position":74,"original_position":74,"commit_id":"5e98823acab5cfc6887e21423d4573542b997833","original_commit_id":"5e98823acab5cfc6887e21423d4573542b997833","user":{"login":"rgeraldes","id":26251983,"avatar_url":"https://avatars2.githubusercontent.com/u/26251983?v=4","gravatar_id":"","url":"https://api.github.com/users/rgeraldes","html_url":"https://github.com/rgeraldes","followers_url":"https://api.github.com/users/rgeraldes/followers","following_url":"https://api.github.com/users/rgeraldes/following{/other_user}","gists_url":"https://api.github.com/users/rgeraldes/gists{/gist_id}","starred_url":"https://api.github.com/users/rgeraldes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgeraldes/subscriptions","organizations_url":"https://api.github.com/users/rgeraldes/orgs","repos_url":"https://api.github.com/users/rgeraldes/repos","events_url":"https://api.github.com/users/rgeraldes/events{/privacy}","received_events_url":"https://api.github.com/users/rgeraldes/received_events","type":"User","site_admin":false},"body":"move this one to utils.go & remove extra lines?","created_at":"2018-03-26T11:14:47Z","updated_at":"2018-03-26T11:14:48Z","html_url":"https://github.com/kowala-tech/kUSD/pull/164#discussion_r177054730","pull_request_url":"https://api.github.com/repos/kowala-tech/kUSD/pulls/164","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kowala-tech/kUSD/pulls/comments/177054730"},"html":{"href":"https://github.com/kowala-tech/kUSD/pull/164#discussion_r177054730"},"pull_request":{"href":"https://api.github.com/repos/kowala-tech/kUSD/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/kowala-tech/kUSD/pulls/164","id":176752916,"html_url":"https://github.com/kowala-tech/kUSD/pull/164","diff_url":"https://github.com/kowala-tech/kUSD/pull/164.diff","patch_url":"https://github.com/kowala-tech/kUSD/pull/164.patch","issue_url":"https://api.github.com/repos/kowala-tech/kUSD/issues/164","number":164,"state":"open","locked":false,"title":"Feature/e2e","user":{"login":"acroca","id":16717,"avatar_url":"https://avatars1.githubusercontent.com/u/16717?v=4","gravatar_id":"","url":"https://api.github.com/users/acroca","html_url":"https://github.com/acroca","followers_url":"https://api.github.com/users/acroca/followers","following_url":"https://api.github.com/users/acroca/following{/other_user}","gists_url":"https://api.github.com/users/acroca/gists{/gist_id}","starred_url":"https://api.github.com/users/acroca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acroca/subscriptions","organizations_url":"https://api.github.com/users/acroca/orgs","repos_url":"https://api.github.com/users/acroca/repos","events_url":"https://api.github.com/users/acroca/events{/privacy}","received_events_url":"https://api.github.com/users/acroca/received_events","type":"User","site_admin":false},"body":"Adds e2e tests to the project.\r\n\r\nI moved the Vendor commit to be the first one so it can be easily ignored in the github review interface.\r\n\r\nImportant changes:\r\n- [x] Added clustering tools to create and interact with a kubernetes cluster.\r\n- [x] Added first simple feature test using [godog](https://github.com/DATA-DOG/godog)","created_at":"2018-03-22T11:46:20Z","updated_at":"2018-03-26T11:14:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff5e5d631210a9c6ec68f5e4b297f4a912507d8f","assignee":{"login":"acroca","id":16717,"avatar_url":"https://avatars1.githubusercontent.com/u/16717?v=4","gravatar_id":"","url":"https://api.github.com/users/acroca","html_url":"https://github.com/acroca","followers_url":"https://api.github.com/users/acroca/followers","following_url":"https://api.github.com/users/acroca/following{/other_user}","gists_url":"https://api.github.com/users/acroca/gists{/gist_id}","starred_url":"https://api.github.com/users/acroca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acroca/subscriptions","organizations_url":"https://api.github.com/users/acroca/orgs","repos_url":"https://api.github.com/users/acroca/repos","events_url":"https://api.github.com/users/acroca/events{/privacy}","received_events_url":"https://api.github.com/users/acroca/received_events","type":"User","site_admin":false},"assignees":[{"login":"acroca","id":16717,"avatar_url":"https://avatars1.githubusercontent.com/u/16717?v=4","gravatar_id":"","url":"https://api.github.com/users/acroca","html_url":"https://github.com/acroca","followers_url":"https://api.github.com/users/acroca/followers","following_url":"https://api.github.com/users/acroca/following{/other_user}","gists_url":"https://api.github.com/users/acroca/gists{/gist_id}","starred_url":"https://api.github.com/users/acroca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acroca/subscriptions","organizations_url":"https://api.github.com/users/acroca/orgs","repos_url":"https://api.github.com/users/acroca/repos","events_url":"https://api.github.com/users/acroca/events{/privacy}","received_events_url":"https://api.github.com/users/acroca/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"yourheropaul","id":50168,"avatar_url":"https://avatars1.githubusercontent.com/u/50168?v=4","gravatar_id":"","url":"https://api.github.com/users/yourheropaul","html_url":"https://github.com/yourheropaul","followers_url":"https://api.github.com/users/yourheropaul/followers","following_url":"https://api.github.com/users/yourheropaul/following{/other_user}","gists_url":"https://api.github.com/users/yourheropaul/gists{/gist_id}","starred_url":"https://api.github.com/users/yourheropaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yourheropaul/subscriptions","organizations_url":"https://api.github.com/users/yourheropaul/orgs","repos_url":"https://api.github.com/users/yourheropaul/repos","events_url":"https://api.github.com/users/yourheropaul/events{/privacy}","received_events_url":"https://api.github.com/users/yourheropaul/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kowala-tech/kUSD/pulls/164/commits","review_comments_url":"https://api.github.com/repos/kowala-tech/kUSD/pulls/164/comments","review_comment_url":"https://api.github.com/repos/kowala-tech/kUSD/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kowala-tech/kUSD/issues/164/comments","statuses_url":"https://api.github.com/repos/kowala-tech/kUSD/statuses/5e98823acab5cfc6887e21423d4573542b997833","head":{"label":"kowala-tech:feature/e2e","ref":"feature/e2e","sha":"5e98823acab5cfc6887e21423d4573542b997833","user":{"login":"kowala-tech","id":29745494,"avatar_url":"https://avatars0.githubusercontent.com/u/29745494?v=4","gravatar_id":"","url":"https://api.github.com/users/kowala-tech","html_url":"https://github.com/kowala-tech","followers_url":"https://api.github.com/users/kowala-tech/followers","following_url":"https://api.github.com/users/kowala-tech/following{/other_user}","gists_url":"https://api.github.com/users/kowala-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/kowala-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kowala-tech/subscriptions","organizations_url":"https://api.github.com/users/kowala-tech/orgs","repos_url":"https://api.github.com/users/kowala-tech/repos","events_url":"https://api.github.com/users/kowala-tech/events{/privacy}","received_events_url":"https://api.github.com/users/kowala-tech/received_events","type":"Organization","site_admin":false},"repo":{"id":98875571,"name":"kUSD","full_name":"kowala-tech/kUSD","owner":{"login":"kowala-tech","id":29745494,"avatar_url":"https://avatars0.githubusercontent.com/u/29745494?v=4","gravatar_id":"","url":"https://api.github.com/users/kowala-tech","html_url":"https://github.com/kowala-tech","followers_url":"https://api.github.com/users/kowala-tech/followers","following_url":"https://api.github.com/users/kowala-tech/following{/other_user}","gists_url":"https://api.github.com/users/kowala-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/kowala-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kowala-tech/subscriptions","organizations_url":"https://api.github.com/users/kowala-tech/orgs","repos_url":"https://api.github.com/users/kowala-tech/repos","events_url":"https://api.github.com/users/kowala-tech/events{/privacy}","received_events_url":"https://api.github.com/users/kowala-tech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kowala-tech/kUSD","description":"A stable cryptocurrency, algorithmically pegged to $1 USD using the Kowala Protocol","fork":false,"url":"https://api.github.com/repos/kowala-tech/kUSD","forks_url":"https://api.github.com/repos/kowala-tech/kUSD/forks","keys_url":"https://api.github.com/repos/kowala-tech/kUSD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kowala-tech/kUSD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kowala-tech/kUSD/teams","hooks_url":"https://api.github.com/repos/kowala-tech/kUSD/hooks","issue_events_url":"https://api.github.com/repos/kowala-tech/kUSD/issues/events{/number}","events_url":"https://api.github.com/repos/kowala-tech/kUSD/events","assignees_url":"https://api.github.com/repos/kowala-tech/kUSD/assignees{/user}","branches_url":"https://api.github.com/repos/kowala-tech/kUSD/branches{/branch}","tags_url":"https://api.github.com/repos/kowala-tech/kUSD/tags","blobs_url":"https://api.github.com/repos/kowala-tech/kUSD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kowala-tech/kUSD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kowala-tech/kUSD/git/refs{/sha}","trees_url":"https://api.github.com/repos/kowala-tech/kUSD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kowala-tech/kUSD/statuses/{sha}","languages_url":"https://api.github.com/repos/kowala-tech/kUSD/languages","stargazers_url":"https://api.github.com/repos/kowala-tech/kUSD/stargazers","contributors_url":"https://api.github.com/repos/kowala-tech/kUSD/contributors","subscribers_url":"https://api.github.com/repos/kowala-tech/kUSD/subscribers","subscription_url":"https://api.github.com/repos/kowala-tech/kUSD/subscription","commits_url":"https://api.github.com/repos/kowala-tech/kUSD/commits{/sha}","git_commits_url":"https://api.github.com/repos/kowala-tech/kUSD/git/commits{/sha}","comments_url":"https://api.github.com/repos/kowala-tech/kUSD/comments{/number}","issue_comment_url":"https://api.github.com/repos/kowala-tech/kUSD/issues/comments{/number}","contents_url":"https://api.github.com/repos/kowala-tech/kUSD/contents/{+path}","compare_url":"https://api.github.com/repos/kowala-tech/kUSD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kowala-tech/kUSD/merges","archive_url":"https://api.github.com/repos/kowala-tech/kUSD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kowala-tech/kUSD/downloads","issues_url":"https://api.github.com/repos/kowala-tech/kUSD/issues{/number}","pulls_url":"https://api.github.com/repos/kowala-tech/kUSD/pulls{/number}","milestones_url":"https://api.github.com/repos/kowala-tech/kUSD/milestones{/number}","notifications_url":"https://api.github.com/repos/kowala-tech/kUSD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kowala-tech/kUSD/labels{/name}","releases_url":"https://api.github.com/repos/kowala-tech/kUSD/releases{/id}","deployments_url":"https://api.github.com/repos/kowala-tech/kUSD/deployments","created_at":"2017-07-31T10:09:03Z","updated_at":"2018-03-26T10:44:02Z","pushed_at":"2018-03-26T10:46:14Z","git_url":"git://github.com/kowala-tech/kUSD.git","ssh_url":"git@github.com:kowala-tech/kUSD.git","clone_url":"https://github.com/kowala-tech/kUSD.git","svn_url":"https://github.com/kowala-tech/kUSD","homepage":null,"size":52741,"stargazers_count":9,"watchers_count":9,"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":58,"license":null,"forks":4,"open_issues":58,"watchers":9,"default_branch":"dev"}},"base":{"label":"kowala-tech:dev","ref":"dev","sha":"1290327377b412c9905296846a0bb2542f006a22","user":{"login":"kowala-tech","id":29745494,"avatar_url":"https://avatars0.githubusercontent.com/u/29745494?v=4","gravatar_id":"","url":"https://api.github.com/users/kowala-tech","html_url":"https://github.com/kowala-tech","followers_url":"https://api.github.com/users/kowala-tech/followers","following_url":"https://api.github.com/users/kowala-tech/following{/other_user}","gists_url":"https://api.github.com/users/kowala-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/kowala-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kowala-tech/subscriptions","organizations_url":"https://api.github.com/users/kowala-tech/orgs","repos_url":"https://api.github.com/users/kowala-tech/repos","events_url":"https://api.github.com/users/kowala-tech/events{/privacy}","received_events_url":"https://api.github.com/users/kowala-tech/received_events","type":"Organization","site_admin":false},"repo":{"id":98875571,"name":"kUSD","full_name":"kowala-tech/kUSD","owner":{"login":"kowala-tech","id":29745494,"avatar_url":"https://avatars0.githubusercontent.com/u/29745494?v=4","gravatar_id":"","url":"https://api.github.com/users/kowala-tech","html_url":"https://github.com/kowala-tech","followers_url":"https://api.github.com/users/kowala-tech/followers","following_url":"https://api.github.com/users/kowala-tech/following{/other_user}","gists_url":"https://api.github.com/users/kowala-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/kowala-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kowala-tech/subscriptions","organizations_url":"https://api.github.com/users/kowala-tech/orgs","repos_url":"https://api.github.com/users/kowala-tech/repos","events_url":"https://api.github.com/users/kowala-tech/events{/privacy}","received_events_url":"https://api.github.com/users/kowala-tech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kowala-tech/kUSD","description":"A stable cryptocurrency, algorithmically pegged to $1 USD using the Kowala Protocol","fork":false,"url":"https://api.github.com/repos/kowala-tech/kUSD","forks_url":"https://api.github.com/repos/kowala-tech/kUSD/forks","keys_url":"https://api.github.com/repos/kowala-tech/kUSD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kowala-tech/kUSD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kowala-tech/kUSD/teams","hooks_url":"https://api.github.com/repos/kowala-tech/kUSD/hooks","issue_events_url":"https://api.github.com/repos/kowala-tech/kUSD/issues/events{/number}","events_url":"https://api.github.com/repos/kowala-tech/kUSD/events","assignees_url":"https://api.github.com/repos/kowala-tech/kUSD/assignees{/user}","branches_url":"https://api.github.com/repos/kowala-tech/kUSD/branches{/branch}","tags_url":"https://api.github.com/repos/kowala-tech/kUSD/tags","blobs_url":"https://api.github.com/repos/kowala-tech/kUSD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kowala-tech/kUSD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kowala-tech/kUSD/git/refs{/sha}","trees_url":"https://api.github.com/repos/kowala-tech/kUSD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kowala-tech/kUSD/statuses/{sha}","languages_url":"https://api.github.com/repos/kowala-tech/kUSD/languages","stargazers_url":"https://api.github.com/repos/kowala-tech/kUSD/stargazers","contributors_url":"https://api.github.com/repos/kowala-tech/kUSD/contributors","subscribers_url":"https://api.github.com/repos/kowala-tech/kUSD/subscribers","subscription_url":"https://api.github.com/repos/kowala-tech/kUSD/subscription","commits_url":"https://api.github.com/repos/kowala-tech/kUSD/commits{/sha}","git_commits_url":"https://api.github.com/repos/kowala-tech/kUSD/git/commits{/sha}","comments_url":"https://api.github.com/repos/kowala-tech/kUSD/comments{/number}","issue_comment_url":"https://api.github.com/repos/kowala-tech/kUSD/issues/comments{/number}","contents_url":"https://api.github.com/repos/kowala-tech/kUSD/contents/{+path}","compare_url":"https://api.github.com/repos/kowala-tech/kUSD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kowala-tech/kUSD/merges","archive_url":"https://api.github.com/repos/kowala-tech/kUSD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kowala-tech/kUSD/downloads","issues_url":"https://api.github.com/repos/kowala-tech/kUSD/issues{/number}","pulls_url":"https://api.github.com/repos/kowala-tech/kUSD/pulls{/number}","milestones_url":"https://api.github.com/repos/kowala-tech/kUSD/milestones{/number}","notifications_url":"https://api.github.com/repos/kowala-tech/kUSD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kowala-tech/kUSD/labels{/name}","releases_url":"https://api.github.com/repos/kowala-tech/kUSD/releases{/id}","deployments_url":"https://api.github.com/repos/kowala-tech/kUSD/deployments","created_at":"2017-07-31T10:09:03Z","updated_at":"2018-03-26T10:44:02Z","pushed_at":"2018-03-26T10:46:14Z","git_url":"git://github.com/kowala-tech/kUSD.git","ssh_url":"git@github.com:kowala-tech/kUSD.git","clone_url":"https://github.com/kowala-tech/kUSD.git","svn_url":"https://github.com/kowala-tech/kUSD","homepage":null,"size":52741,"stargazers_count":9,"watchers_count":9,"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":58,"license":null,"forks":4,"open_issues":58,"watchers":9,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/kowala-tech/kUSD/pulls/164"},"html":{"href":"https://github.com/kowala-tech/kUSD/pull/164"},"issue":{"href":"https://api.github.com/repos/kowala-tech/kUSD/issues/164"},"comments":{"href":"https://api.github.com/repos/kowala-tech/kUSD/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/kowala-tech/kUSD/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/kowala-tech/kUSD/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kowala-tech/kUSD/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/kowala-tech/kUSD/statuses/5e98823acab5cfc6887e21423d4573542b997833"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rgeraldes"}}