{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/34676104","id":34676104,"diff_hunk":"@@ -336,22 +337,31 @@ func (e *TokensController) generateTokenIfNeeded(serviceAccount *api.ServiceAcco\n \t\tsecret.Data = map[string][]byte{}\n \t}\n \n-\ttokenData, ok := secret.Data[api.ServiceAccountTokenKey]\n-\tif ok && len(tokenData) > 0 {\n+\tcaData := secret.Data[api.ServiceAccountRootCAKey]\n+\tneedsCA := len(e.rootCA) > 0 && bytes.Compare(caData, e.rootCA) != 0\n+\n+\ttokenData := secret.Data[api.ServiceAccountTokenKey]\n+\tneedsToken := len(tokenData) == 0","path":"pkg/serviceaccount/tokens_controller.go","position":18,"original_position":18,"commit_id":"0bcdfaf6154474c87ad52c4f3081777a7dbbe548","original_commit_id":"0bcdfaf6154474c87ad52c4f3081777a7dbbe548","user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"body":"it would be ideal, though it would mean adding token validation into the token controller. I like the idea, but wanted to think through it more, and separately from the CA populate part.","created_at":"2015-07-15T13:16:19Z","updated_at":"2015-07-15T13:16:19Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11303#discussion_r34676104","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11303","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/34676104"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11303#discussion_r34676104"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11303"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11303","id":40019008,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11303","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11303.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11303.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11303","number":11303,"state":"open","locked":false,"title":"Add CA data to service account tokens if missing or different","user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"body":"If the token controller encounters a service account token secret with missing or mismatched CA data, it should update it","created_at":"2015-07-15T12:53:26Z","updated_at":"2015-07-15T13:16:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1c0b795e523d5de234225705eca5e9dc01de88b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11303/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11303/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11303/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/0bcdfaf6154474c87ad52c4f3081777a7dbbe548","head":{"label":"liggitt:token_ca","ref":"token_ca","sha":"0bcdfaf6154474c87ad52c4f3081777a7dbbe548","user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"repo":{"id":22823654,"name":"kubernetes","full_name":"liggitt/kubernetes","owner":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liggitt/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/liggitt/kubernetes","forks_url":"https://api.github.com/repos/liggitt/kubernetes/forks","keys_url":"https://api.github.com/repos/liggitt/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liggitt/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liggitt/kubernetes/teams","hooks_url":"https://api.github.com/repos/liggitt/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/liggitt/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/liggitt/kubernetes/events","assignees_url":"https://api.github.com/repos/liggitt/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/liggitt/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/liggitt/kubernetes/tags","blobs_url":"https://api.github.com/repos/liggitt/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liggitt/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liggitt/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/liggitt/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liggitt/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/liggitt/kubernetes/languages","stargazers_url":"https://api.github.com/repos/liggitt/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/liggitt/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/liggitt/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/liggitt/kubernetes/subscription","commits_url":"https://api.github.com/repos/liggitt/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/liggitt/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/liggitt/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/liggitt/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/liggitt/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/liggitt/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liggitt/kubernetes/merges","archive_url":"https://api.github.com/repos/liggitt/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liggitt/kubernetes/downloads","issues_url":"https://api.github.com/repos/liggitt/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/liggitt/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/liggitt/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/liggitt/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liggitt/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/liggitt/kubernetes/releases{/id}","created_at":"2014-08-11T01:56:03Z","updated_at":"2015-05-08T17:59:39Z","pushed_at":"2015-07-15T12:57:28Z","git_url":"git://github.com/liggitt/kubernetes.git","ssh_url":"git@github.com:liggitt/kubernetes.git","clone_url":"https://github.com/liggitt/kubernetes.git","svn_url":"https://github.com/liggitt/kubernetes","homepage":null,"size":89998,"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":"8f3c3108b83dab417e504511dd28b824e0be6d20","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 from Google","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-07-15T12:09:09Z","pushed_at":"2015-07-15T13:04:27Z","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":316016,"stargazers_count":8919,"watchers_count":8919,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2022,"mirror_url":null,"open_issues_count":1594,"forks":2022,"open_issues":1594,"watchers":8919,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11303"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11303"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11303"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11303/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11303/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11303/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/0bcdfaf6154474c87ad52c4f3081777a7dbbe548"}}}}