{"action":"closed","number":199,"pull_request":{"url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/pulls/199","id":190039773,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwMDM5Nzcz","html_url":"https://github.com/kubernetes-sigs/cluster-api/pull/199","diff_url":"https://github.com/kubernetes-sigs/cluster-api/pull/199.diff","patch_url":"https://github.com/kubernetes-sigs/cluster-api/pull/199.patch","issue_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/issues/199","number":199,"state":"closed","locked":false,"title":"CLUSTER-API-159: Enhance gce-machine-controller to fetch kubeadm join token","user":{"login":"spew","id":1868389,"node_id":"MDQ6VXNlcjE4NjgzODk=","avatar_url":"https://avatars1.githubusercontent.com/u/1868389?v=4","gravatar_id":"","url":"https://api.github.com/users/spew","html_url":"https://github.com/spew","followers_url":"https://api.github.com/users/spew/followers","following_url":"https://api.github.com/users/spew/following{/other_user}","gists_url":"https://api.github.com/users/spew/gists{/gist_id}","starred_url":"https://api.github.com/users/spew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spew/subscriptions","organizations_url":"https://api.github.com/users/spew/orgs","repos_url":"https://api.github.com/users/spew/repos","events_url":"https://api.github.com/users/spew/events{/privacy}","received_events_url":"https://api.github.com/users/spew/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\nThis commit ensures that for the lifecycle of gce-machine-controller new machines can enter the cluster and improves the security model used by the join command.\r\n\r\n- *New Machines:* Prior to this commit, the gce-machine-controller had a single kubeadm join token passed in as a parameter. The token was given to new machines that gce-machine-controller created. The token was using the default expiration of 24 hours so after 24 hours new machines could not enter the cluster.\r\n- *Security Model:* Prior to this commit, the join command used by new nodes passed in the flag ```discovery-token-unsafe-skip-ca-verification```. This flag disabled checking the validity of the root certificate authority presented by the Master.\r\n\r\nFor fetching the token the decision was to go with kubeadm as the token creation exists in that command and if it changes over time the command should continue to function the same way. In addition, it is more version agnostic to make use of the command as long as the arguments do not change.\r\n\r\nAlso, a new type of wrapper for exec.Commands is added named CmdRunner. This wrapper enables us to create an exec implementation specifically for test binaries. Using this wrapper tests can mock exec commands and finely control the output and exit codes. An actual program is exec-ed so it is extremely close to what happens at runtime other than the actual program is not called.\r\n\r\n**Which issue(s) this PR fixes**:\r\nThis is a partial completion of: https://github.com/kubernetes-sigs/cluster-api/issues/159 and some of the logic will need to be duplicated into tf-deployer.\r\n\r\n**Special notes for your reviewer**:\r\nI will follow up with another commit for tf-deployer.\r\n\r\n**Release note**:\r\n```release-note\r\nMachine controller support for adding new nodes to clusters after 24 hours. \r\n```\r\n\r\n<!-- All reviews default to cc'ing the kube-deploy-reviewers github group. -->\r\n@kubernetes/kube-deploy-reviewers\r\n","created_at":"2018-05-23T16:46:27Z","updated_at":"2018-06-01T15:12:56Z","closed_at":"2018-06-01T15:12:56Z","merged_at":"2018-06-01T15:12:55Z","merge_commit_sha":"a3b39103e3f0233b41729bd48bb38738859005ae","assignee":{"login":"k4leung4","id":16194785,"node_id":"MDQ6VXNlcjE2MTk0Nzg1","avatar_url":"https://avatars0.githubusercontent.com/u/16194785?v=4","gravatar_id":"","url":"https://api.github.com/users/k4leung4","html_url":"https://github.com/k4leung4","followers_url":"https://api.github.com/users/k4leung4/followers","following_url":"https://api.github.com/users/k4leung4/following{/other_user}","gists_url":"https://api.github.com/users/k4leung4/gists{/gist_id}","starred_url":"https://api.github.com/users/k4leung4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k4leung4/subscriptions","organizations_url":"https://api.github.com/users/k4leung4/orgs","repos_url":"https://api.github.com/users/k4leung4/repos","events_url":"https://api.github.com/users/k4leung4/events{/privacy}","received_events_url":"https://api.github.com/users/k4leung4/received_events","type":"User","site_admin":false},"assignees":[{"login":"k4leung4","id":16194785,"node_id":"MDQ6VXNlcjE2MTk0Nzg1","avatar_url":"https://avatars0.githubusercontent.com/u/16194785?v=4","gravatar_id":"","url":"https://api.github.com/users/k4leung4","html_url":"https://github.com/k4leung4","followers_url":"https://api.github.com/users/k4leung4/followers","following_url":"https://api.github.com/users/k4leung4/following{/other_user}","gists_url":"https://api.github.com/users/k4leung4/gists{/gist_id}","starred_url":"https://api.github.com/users/k4leung4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k4leung4/subscriptions","organizations_url":"https://api.github.com/users/k4leung4/orgs","repos_url":"https://api.github.com/users/k4leung4/repos","events_url":"https://api.github.com/users/k4leung4/events{/privacy}","received_events_url":"https://api.github.com/users/k4leung4/received_events","type":"User","site_admin":false},{"login":"jessicaochen","id":25439230,"node_id":"MDQ6VXNlcjI1NDM5MjMw","avatar_url":"https://avatars2.githubusercontent.com/u/25439230?v=4","gravatar_id":"","url":"https://api.github.com/users/jessicaochen","html_url":"https://github.com/jessicaochen","followers_url":"https://api.github.com/users/jessicaochen/followers","following_url":"https://api.github.com/users/jessicaochen/following{/other_user}","gists_url":"https://api.github.com/users/jessicaochen/gists{/gist_id}","starred_url":"https://api.github.com/users/jessicaochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessicaochen/subscriptions","organizations_url":"https://api.github.com/users/jessicaochen/orgs","repos_url":"https://api.github.com/users/jessicaochen/repos","events_url":"https://api.github.com/users/jessicaochen/events{/privacy}","received_events_url":"https://api.github.com/users/jessicaochen/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":905052788,"node_id":"MDU6TGFiZWw5MDUwNTI3ODg=","url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/labels/approved","name":"approved","color":"0ffa16","default":false},{"id":875323571,"node_id":"MDU6TGFiZWw4NzUzMjM1NzE=","url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":876558833,"node_id":"MDU6TGFiZWw4NzY1NTg4MzM=","url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/labels/lgtm","name":"lgtm","color":"15dd18","default":false},{"id":905012891,"node_id":"MDU6TGFiZWw5MDUwMTI4OTE=","url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/labels/size/XL","name":"size/XL","color":"ee5500","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/pulls/199/commits","review_comments_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/pulls/199/comments","review_comment_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/issues/199/comments","statuses_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/statuses/5e164c3f8d559d749457f099fed1ad837f026216","head":{"label":"spew:issue-159","ref":"issue-159","sha":"5e164c3f8d559d749457f099fed1ad837f026216","user":{"login":"spew","id":1868389,"node_id":"MDQ6VXNlcjE4NjgzODk=","avatar_url":"https://avatars1.githubusercontent.com/u/1868389?v=4","gravatar_id":"","url":"https://api.github.com/users/spew","html_url":"https://github.com/spew","followers_url":"https://api.github.com/users/spew/followers","following_url":"https://api.github.com/users/spew/following{/other_user}","gists_url":"https://api.github.com/users/spew/gists{/gist_id}","starred_url":"https://api.github.com/users/spew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spew/subscriptions","organizations_url":"https://api.github.com/users/spew/orgs","repos_url":"https://api.github.com/users/spew/repos","events_url":"https://api.github.com/users/spew/events{/privacy}","received_events_url":"https://api.github.com/users/spew/received_events","type":"User","site_admin":false},"repo":{"id":129435650,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk0MzU2NTA=","name":"cluster-api","full_name":"spew/cluster-api","owner":{"login":"spew","id":1868389,"node_id":"MDQ6VXNlcjE4NjgzODk=","avatar_url":"https://avatars1.githubusercontent.com/u/1868389?v=4","gravatar_id":"","url":"https://api.github.com/users/spew","html_url":"https://github.com/spew","followers_url":"https://api.github.com/users/spew/followers","following_url":"https://api.github.com/users/spew/following{/other_user}","gists_url":"https://api.github.com/users/spew/gists{/gist_id}","starred_url":"https://api.github.com/users/spew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spew/subscriptions","organizations_url":"https://api.github.com/users/spew/orgs","repos_url":"https://api.github.com/users/spew/repos","events_url":"https://api.github.com/users/spew/events{/privacy}","received_events_url":"https://api.github.com/users/spew/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spew/cluster-api","description":"Home for the cluster api work, a subproject of sig-cluster-lifecycle","fork":true,"url":"https://api.github.com/repos/spew/cluster-api","forks_url":"https://api.github.com/repos/spew/cluster-api/forks","keys_url":"https://api.github.com/repos/spew/cluster-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spew/cluster-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spew/cluster-api/teams","hooks_url":"https://api.github.com/repos/spew/cluster-api/hooks","issue_events_url":"https://api.github.com/repos/spew/cluster-api/issues/events{/number}","events_url":"https://api.github.com/repos/spew/cluster-api/events","assignees_url":"https://api.github.com/repos/spew/cluster-api/assignees{/user}","branches_url":"https://api.github.com/repos/spew/cluster-api/branches{/branch}","tags_url":"https://api.github.com/repos/spew/cluster-api/tags","blobs_url":"https://api.github.com/repos/spew/cluster-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spew/cluster-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spew/cluster-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/spew/cluster-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spew/cluster-api/statuses/{sha}","languages_url":"https://api.github.com/repos/spew/cluster-api/languages","stargazers_url":"https://api.github.com/repos/spew/cluster-api/stargazers","contributors_url":"https://api.github.com/repos/spew/cluster-api/contributors","subscribers_url":"https://api.github.com/repos/spew/cluster-api/subscribers","subscription_url":"https://api.github.com/repos/spew/cluster-api/subscription","commits_url":"https://api.github.com/repos/spew/cluster-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/spew/cluster-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/spew/cluster-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/spew/cluster-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/spew/cluster-api/contents/{+path}","compare_url":"https://api.github.com/repos/spew/cluster-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spew/cluster-api/merges","archive_url":"https://api.github.com/repos/spew/cluster-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spew/cluster-api/downloads","issues_url":"https://api.github.com/repos/spew/cluster-api/issues{/number}","pulls_url":"https://api.github.com/repos/spew/cluster-api/pulls{/number}","milestones_url":"https://api.github.com/repos/spew/cluster-api/milestones{/number}","notifications_url":"https://api.github.com/repos/spew/cluster-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spew/cluster-api/labels{/name}","releases_url":"https://api.github.com/repos/spew/cluster-api/releases{/id}","deployments_url":"https://api.github.com/repos/spew/cluster-api/deployments","created_at":"2018-04-13T17:46:34Z","updated_at":"2018-04-27T20:19:13Z","pushed_at":"2018-05-31T21:26:13Z","git_url":"git://github.com/spew/cluster-api.git","ssh_url":"git@github.com:spew/cluster-api.git","clone_url":"https://github.com/spew/cluster-api.git","svn_url":"https://github.com/spew/cluster-api","homepage":null,"size":144961,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes-sigs:master","ref":"master","sha":"e929a2fc09f20cbf2f1f4e80146257ff69456d0b","user":{"login":"kubernetes-sigs","id":36015203,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MDE1MjAz","avatar_url":"https://avatars1.githubusercontent.com/u/36015203?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes-sigs","html_url":"https://github.com/kubernetes-sigs","followers_url":"https://api.github.com/users/kubernetes-sigs/followers","following_url":"https://api.github.com/users/kubernetes-sigs/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-sigs/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-sigs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-sigs/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-sigs/orgs","repos_url":"https://api.github.com/users/kubernetes-sigs/repos","events_url":"https://api.github.com/users/kubernetes-sigs/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-sigs/received_events","type":"Organization","site_admin":false},"repo":{"id":124157517,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQxNTc1MTc=","name":"cluster-api","full_name":"kubernetes-sigs/cluster-api","owner":{"login":"kubernetes-sigs","id":36015203,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MDE1MjAz","avatar_url":"https://avatars1.githubusercontent.com/u/36015203?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes-sigs","html_url":"https://github.com/kubernetes-sigs","followers_url":"https://api.github.com/users/kubernetes-sigs/followers","following_url":"https://api.github.com/users/kubernetes-sigs/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-sigs/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-sigs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-sigs/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-sigs/orgs","repos_url":"https://api.github.com/users/kubernetes-sigs/repos","events_url":"https://api.github.com/users/kubernetes-sigs/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-sigs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes-sigs/cluster-api","description":"Home for the cluster api work, a subproject of sig-cluster-lifecycle","fork":false,"url":"https://api.github.com/repos/kubernetes-sigs/cluster-api","forks_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/forks","keys_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/teams","hooks_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/hooks","issue_events_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/events","assignees_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/tags","blobs_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/languages","stargazers_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/stargazers","contributors_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/contributors","subscribers_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/subscribers","subscription_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/subscription","commits_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/merges","archive_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/downloads","issues_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes-sigs/cluster-api/deployments","created_at":"2018-03-07T00:49:50Z","updated_at":"2018-05-31T21:03:00Z","pushed_at":"2018-06-01T15:12:55Z","git_url":"git://github.com/kubernetes-sigs/cluster-api.git","ssh_url":"git@github.com:kubernetes-sigs/cluster-api.git","clone_url":"https://github.com/kubernetes-sigs/cluster-api.git","svn_url":"https://github.com/kubernetes-sigs/cluster-api","homepage":null,"size":144945,"stargazers_count":55,"watchers_count":55,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"open_issues_count":126,"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":31,"open_issues":126,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes-sigs/cluster-api/pulls/199"},"html":{"href":"https://github.com/kubernetes-sigs/cluster-api/pull/199"},"issue":{"href":"https://api.github.com/repos/kubernetes-sigs/cluster-api/issues/199"},"comments":{"href":"https://api.github.com/repos/kubernetes-sigs/cluster-api/issues/199/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes-sigs/cluster-api/pulls/199/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes-sigs/cluster-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes-sigs/cluster-api/pulls/199/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes-sigs/cluster-api/statuses/5e164c3f8d559d749457f099fed1ad837f026216"}},"author_association":"COLLABORATOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"k8s-ci-robot","id":20407524,"node_id":"MDQ6VXNlcjIwNDA3NTI0","avatar_url":"https://avatars0.githubusercontent.com/u/20407524?v=4","gravatar_id":"","url":"https://api.github.com/users/k8s-ci-robot","html_url":"https://github.com/k8s-ci-robot","followers_url":"https://api.github.com/users/k8s-ci-robot/followers","following_url":"https://api.github.com/users/k8s-ci-robot/following{/other_user}","gists_url":"https://api.github.com/users/k8s-ci-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/k8s-ci-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8s-ci-robot/subscriptions","organizations_url":"https://api.github.com/users/k8s-ci-robot/orgs","repos_url":"https://api.github.com/users/k8s-ci-robot/repos","events_url":"https://api.github.com/users/k8s-ci-robot/events{/privacy}","received_events_url":"https://api.github.com/users/k8s-ci-robot/received_events","type":"User","site_admin":false},"comments":12,"review_comments":19,"maintainer_can_modify":false,"commits":1,"additions":610,"deletions":47,"changed_files":15}}
{"actor":{"display_login":"k8s-ci-robot"}}