{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/69772233","id":69772233,"diff_hunk":"@@ -139,3 +140,134 @@ func newWithContents(t *testing.T, contents string) (auth *TokenAuthenticator, e\n \n \treturn NewCSV(f.Name())\n }\n+\n+type inner func(*testing.T, *TokenAuthenticator)\n+\n+func testChangeTokenFileWrapper(t *testing.T, before string, after string, fn1 inner, fn2 inner) {\n+\tdone := make(chan bool)\n+\tf, err := ioutil.TempFile(\"\", \"tokenfile_test\")\n+\tif err != nil {\n+\t\tt.Fatalf(\"unexpected error creating tokenfile: %v\", err)\n+\t}\n+\tf.Close()\n+\tdefer os.Remove(f.Name())\n+\n+\tgo func() {\n+\t\tioutil.WriteFile(f.Name(), []byte(before), 0644)\n+\t\tdone <- true\n+\t}()\n+\t<-done\n+\tauth, err := NewCSV(f.Name())\n+\tfn1(t, auth)\n+\ttime.Sleep(100 * time.Millisecond)\n+\tgo func() {\n+\t\tioutil.WriteFile(f.Name(), []byte(after), 0644)\n+\t\tdone <- true\n+\t}()\n+\t<-done\n+\ttime.Sleep(100 * time.Millisecond)","path":"plugin/pkg/auth/authenticator/token/tokenfile/tokenfile_test.go","position":37,"original_position":37,"commit_id":"c1c9c7efa7a1a954f23a635af0393cf81605aa18","original_commit_id":"fd496c84bcf7ee8666c7ffef8455fa7d195b2bc5","user":{"login":"erictune","id":8105590,"avatar_url":"https://avatars.githubusercontent.com/u/8105590?v=3","gravatar_id":"","url":"https://api.github.com/users/erictune","html_url":"https://github.com/erictune","followers_url":"https://api.github.com/users/erictune/followers","following_url":"https://api.github.com/users/erictune/following{/other_user}","gists_url":"https://api.github.com/users/erictune/gists{/gist_id}","starred_url":"https://api.github.com/users/erictune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictune/subscriptions","organizations_url":"https://api.github.com/users/erictune/orgs","repos_url":"https://api.github.com/users/erictune/repos","events_url":"https://api.github.com/users/erictune/events{/privacy}","received_events_url":"https://api.github.com/users/erictune/received_events","type":"User","site_admin":false},"body":"during automated testing, on a busy test machine, this might not be long enough, which will make this test flaky.\r\nSuggest making the test retry fn2 several times, until it passes, or a long time has passed.","created_at":"2016-07-06T17:15:05Z","updated_at":"2016-07-06T17:15:05Z","html_url":"https://github.com/kubernetes/kubernetes/pull/27860#discussion_r69772233","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27860","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/69772233"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/27860#discussion_r69772233"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27860"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27860","id":74772878,"html_url":"https://github.com/kubernetes/kubernetes/pull/27860","diff_url":"https://github.com/kubernetes/kubernetes/pull/27860.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/27860.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/27860","number":27860,"state":"open","locked":false,"title":"Api-server dynamically load authentication token-file and password-file.","user":{"login":"reAsOn2010","id":1191377,"avatar_url":"https://avatars.githubusercontent.com/u/1191377?v=3","gravatar_id":"","url":"https://api.github.com/users/reAsOn2010","html_url":"https://github.com/reAsOn2010","followers_url":"https://api.github.com/users/reAsOn2010/followers","following_url":"https://api.github.com/users/reAsOn2010/following{/other_user}","gists_url":"https://api.github.com/users/reAsOn2010/gists{/gist_id}","starred_url":"https://api.github.com/users/reAsOn2010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reAsOn2010/subscriptions","organizations_url":"https://api.github.com/users/reAsOn2010/orgs","repos_url":"https://api.github.com/users/reAsOn2010/repos","events_url":"https://api.github.com/users/reAsOn2010/events{/privacy}","received_events_url":"https://api.github.com/users/reAsOn2010/received_events","type":"User","site_admin":false},"body":"<!--\r\nChecklist for submitting a Pull Request\r\n\r\nPlease remove this comment block before submitting.\r\n\r\n1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).\r\n2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).\r\n3. If you want this PR to automatically close an issue when it is merged,\r\n   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`\r\n   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).\r\n4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.\r\n-->\r\n\r\n```release-note\r\n* Use the release-note-* labels to set the release note state \r\n* Clear this block to use the PR title as the release note \r\n-OR-\r\n* Enter your extended release note here\r\n```\r\n\r\n\r\n[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()\r\n\r\nfix #27418 \r\n\r\nUsing fsnotify to watch toke-file change event invoke reloading configuration.","created_at":"2016-06-22T12:12:32Z","updated_at":"2016-07-06T17:15:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c3620db87e5df70e37b52799fd04c2465fa0388","assignee":{"login":"erictune","id":8105590,"avatar_url":"https://avatars.githubusercontent.com/u/8105590?v=3","gravatar_id":"","url":"https://api.github.com/users/erictune","html_url":"https://github.com/erictune","followers_url":"https://api.github.com/users/erictune/followers","following_url":"https://api.github.com/users/erictune/following{/other_user}","gists_url":"https://api.github.com/users/erictune/gists{/gist_id}","starred_url":"https://api.github.com/users/erictune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictune/subscriptions","organizations_url":"https://api.github.com/users/erictune/orgs","repos_url":"https://api.github.com/users/erictune/repos","events_url":"https://api.github.com/users/erictune/events{/privacy}","received_events_url":"https://api.github.com/users/erictune/received_events","type":"User","site_admin":false},"assignees":[{"login":"erictune","id":8105590,"avatar_url":"https://avatars.githubusercontent.com/u/8105590?v=3","gravatar_id":"","url":"https://api.github.com/users/erictune","html_url":"https://github.com/erictune","followers_url":"https://api.github.com/users/erictune/followers","following_url":"https://api.github.com/users/erictune/following{/other_user}","gists_url":"https://api.github.com/users/erictune/gists{/gist_id}","starred_url":"https://api.github.com/users/erictune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictune/subscriptions","organizations_url":"https://api.github.com/users/erictune/orgs","repos_url":"https://api.github.com/users/erictune/repos","events_url":"https://api.github.com/users/erictune/events{/privacy}","received_events_url":"https://api.github.com/users/erictune/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27860/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27860/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/27860/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/c1c9c7efa7a1a954f23a635af0393cf81605aa18","head":{"label":"reAsOn2010:dynamic-auth","ref":"dynamic-auth","sha":"c1c9c7efa7a1a954f23a635af0393cf81605aa18","user":{"login":"reAsOn2010","id":1191377,"avatar_url":"https://avatars.githubusercontent.com/u/1191377?v=3","gravatar_id":"","url":"https://api.github.com/users/reAsOn2010","html_url":"https://github.com/reAsOn2010","followers_url":"https://api.github.com/users/reAsOn2010/followers","following_url":"https://api.github.com/users/reAsOn2010/following{/other_user}","gists_url":"https://api.github.com/users/reAsOn2010/gists{/gist_id}","starred_url":"https://api.github.com/users/reAsOn2010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reAsOn2010/subscriptions","organizations_url":"https://api.github.com/users/reAsOn2010/orgs","repos_url":"https://api.github.com/users/reAsOn2010/repos","events_url":"https://api.github.com/users/reAsOn2010/events{/privacy}","received_events_url":"https://api.github.com/users/reAsOn2010/received_events","type":"User","site_admin":false},"repo":{"id":61277928,"name":"kubernetes","full_name":"reAsOn2010/kubernetes","owner":{"login":"reAsOn2010","id":1191377,"avatar_url":"https://avatars.githubusercontent.com/u/1191377?v=3","gravatar_id":"","url":"https://api.github.com/users/reAsOn2010","html_url":"https://github.com/reAsOn2010","followers_url":"https://api.github.com/users/reAsOn2010/followers","following_url":"https://api.github.com/users/reAsOn2010/following{/other_user}","gists_url":"https://api.github.com/users/reAsOn2010/gists{/gist_id}","starred_url":"https://api.github.com/users/reAsOn2010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reAsOn2010/subscriptions","organizations_url":"https://api.github.com/users/reAsOn2010/orgs","repos_url":"https://api.github.com/users/reAsOn2010/repos","events_url":"https://api.github.com/users/reAsOn2010/events{/privacy}","received_events_url":"https://api.github.com/users/reAsOn2010/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reAsOn2010/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/reAsOn2010/kubernetes","forks_url":"https://api.github.com/repos/reAsOn2010/kubernetes/forks","keys_url":"https://api.github.com/repos/reAsOn2010/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reAsOn2010/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reAsOn2010/kubernetes/teams","hooks_url":"https://api.github.com/repos/reAsOn2010/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/reAsOn2010/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/reAsOn2010/kubernetes/events","assignees_url":"https://api.github.com/repos/reAsOn2010/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/reAsOn2010/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/reAsOn2010/kubernetes/tags","blobs_url":"https://api.github.com/repos/reAsOn2010/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reAsOn2010/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reAsOn2010/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/reAsOn2010/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reAsOn2010/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/reAsOn2010/kubernetes/languages","stargazers_url":"https://api.github.com/repos/reAsOn2010/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/reAsOn2010/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/reAsOn2010/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/reAsOn2010/kubernetes/subscription","commits_url":"https://api.github.com/repos/reAsOn2010/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/reAsOn2010/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/reAsOn2010/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/reAsOn2010/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/reAsOn2010/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/reAsOn2010/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reAsOn2010/kubernetes/merges","archive_url":"https://api.github.com/repos/reAsOn2010/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reAsOn2010/kubernetes/downloads","issues_url":"https://api.github.com/repos/reAsOn2010/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/reAsOn2010/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/reAsOn2010/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/reAsOn2010/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reAsOn2010/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/reAsOn2010/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/reAsOn2010/kubernetes/deployments","created_at":"2016-06-16T08:58:41Z","updated_at":"2016-06-16T08:58:59Z","pushed_at":"2016-06-28T10:03:35Z","git_url":"git://github.com/reAsOn2010/kubernetes.git","ssh_url":"git@github.com:reAsOn2010/kubernetes.git","clone_url":"https://github.com/reAsOn2010/kubernetes.git","svn_url":"https://github.com/reAsOn2010/kubernetes","homepage":"http://kubernetes.io","size":270589,"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":"7454bc464a25465b0dcd0cb8233b670e71ffd239","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":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","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/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-07-06T16:31:57Z","pushed_at":"2016-07-06T17:06:52Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":487602,"stargazers_count":15339,"watchers_count":15339,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4788,"mirror_url":null,"open_issues_count":3842,"forks":4788,"open_issues":3842,"watchers":15339,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27860"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/27860"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/27860"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/27860/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27860/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27860/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/c1c9c7efa7a1a954f23a635af0393cf81605aa18"}}}}
{"actor":{"display_login":"erictune"}}