{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/195871184","pull_request_review_id":129328664,"id":195871184,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTg3MTE4NA==","diff_hunk":"@@ -101,6 +102,30 @@ func UpdateResource(r rest.Updater, scope RequestScope, admit admission.Interfac\n \t\t\t\treturn newObj, mutatingAdmission.Admit(admission.NewAttributesRecord(newObj, oldObj, scope.Kind, namespace, name, scope.Resource, scope.Subresource, admission.Update, userInfo))\n \t\t\t})\n \t\t}\n+\t\ttransformers = append(transformers, func(ctx context.Context, newObj, oldObj runtime.Object) (runtime.Object, error) {\n+\t\t\tif hasUID, err := hasUID(oldObj); err != nil {\n+\t\t\t\treturn nil, err\n+\t\t\t} else if !hasUID && scope.Authorizer != nil {","path":"staging/src/k8s.io/apiserver/pkg/endpoints/handlers/update.go","position":15,"original_position":15,"commit_id":"03c2fa6790afcab3b03c676965c9a1d00299973b","original_commit_id":"03c2fa6790afcab3b03c676965c9a1d00299973b","user":{"login":"liggitt","id":980082,"node_id":"MDQ6VXNlcjk4MDA4Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/980082?v=4","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":"> When the apiserver is coming up, it is allowed for the authorizer to be unset, it just emits a warning saying authorization is disabled. I think if we allow that at startup then we should allow for this\r\n\r\nHmm, it still seems safer for the top level server creator to plug in an AlwaysAllow impl in that case. Skipping on nil here means we don't know if we were wired incorrectly or if the server creator really intended to run without authorization.","created_at":"2018-06-15T21:57:13Z","updated_at":"2018-06-15T21:57:13Z","html_url":"https://github.com/kubernetes/kubernetes/pull/65150#discussion_r195871184","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/65150","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/195871184"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/65150#discussion_r195871184"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/65150"}},"in_reply_to_id":195844663},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/65150","id":195251324,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MjUxMzI0","html_url":"https://github.com/kubernetes/kubernetes/pull/65150","diff_url":"https://github.com/kubernetes/kubernetes/pull/65150.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/65150.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/65150","number":65150,"state":"open","locked":false,"title":" Add additional authorization check for create-on-update","user":{"login":"jennybuckley","id":31416425,"node_id":"MDQ6VXNlcjMxNDE2NDI1","avatar_url":"https://avatars2.githubusercontent.com/u/31416425?v=4","gravatar_id":"","url":"https://api.github.com/users/jennybuckley","html_url":"https://github.com/jennybuckley","followers_url":"https://api.github.com/users/jennybuckley/followers","following_url":"https://api.github.com/users/jennybuckley/following{/other_user}","gists_url":"https://api.github.com/users/jennybuckley/gists{/gist_id}","starred_url":"https://api.github.com/users/jennybuckley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennybuckley/subscriptions","organizations_url":"https://api.github.com/users/jennybuckley/orgs","repos_url":"https://api.github.com/users/jennybuckley/repos","events_url":"https://api.github.com/users/jennybuckley/events{/privacy}","received_events_url":"https://api.github.com/users/jennybuckley/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\nCurrently it is possible for a user who is only authorized to update objects to send a PUT request for an object that doesn't currently exist, and if that resource allows create on update, it will all them to create the object. This PR fixes that bug and adds a test case which fails on master, but succeeds when the additional authorization check is done.\r\n\r\n/sig api-machinery\r\n/kind bug\r\n/cc @liggitt @lavalamp \r\n\r\n**Release note**:\r\n```release-note\r\nNONE\r\n```","created_at":"2018-06-15T18:27:52Z","updated_at":"2018-06-15T21:57:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6804fe96c7bce9158631c0baa09f21c1bcf2140","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":477397086,"node_id":"MDU6TGFiZWw0NzczOTcwODY=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":105146071,"node_id":"MDU6TGFiZWwxMDUxNDYwNzE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/bug","name":"kind/bug","color":"e11d21","default":false},{"id":349530249,"node_id":"MDU6TGFiZWwzNDk1MzAyNDk=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-none","name":"release-note-none","color":"c2e0c6","default":false},{"id":173493835,"node_id":"MDU6TGFiZWwxNzM0OTM4MzU=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/api-machinery","name":"sig/api-machinery","color":"d2b48c","default":false},{"id":253450934,"node_id":"MDU6TGFiZWwyNTM0NTA5MzQ=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/M","name":"size/M","color":"eebb00","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/65150/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/65150/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/65150/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/03c2fa6790afcab3b03c676965c9a1d00299973b","head":{"label":"jennybuckley:create-on-update-authorizer","ref":"create-on-update-authorizer","sha":"03c2fa6790afcab3b03c676965c9a1d00299973b","user":{"login":"jennybuckley","id":31416425,"node_id":"MDQ6VXNlcjMxNDE2NDI1","avatar_url":"https://avatars2.githubusercontent.com/u/31416425?v=4","gravatar_id":"","url":"https://api.github.com/users/jennybuckley","html_url":"https://github.com/jennybuckley","followers_url":"https://api.github.com/users/jennybuckley/followers","following_url":"https://api.github.com/users/jennybuckley/following{/other_user}","gists_url":"https://api.github.com/users/jennybuckley/gists{/gist_id}","starred_url":"https://api.github.com/users/jennybuckley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennybuckley/subscriptions","organizations_url":"https://api.github.com/users/jennybuckley/orgs","repos_url":"https://api.github.com/users/jennybuckley/repos","events_url":"https://api.github.com/users/jennybuckley/events{/privacy}","received_events_url":"https://api.github.com/users/jennybuckley/received_events","type":"User","site_admin":false},"repo":{"id":101671907,"node_id":"MDEwOlJlcG9zaXRvcnkxMDE2NzE5MDc=","name":"kubernetes","full_name":"jennybuckley/kubernetes","owner":{"login":"jennybuckley","id":31416425,"node_id":"MDQ6VXNlcjMxNDE2NDI1","avatar_url":"https://avatars2.githubusercontent.com/u/31416425?v=4","gravatar_id":"","url":"https://api.github.com/users/jennybuckley","html_url":"https://github.com/jennybuckley","followers_url":"https://api.github.com/users/jennybuckley/followers","following_url":"https://api.github.com/users/jennybuckley/following{/other_user}","gists_url":"https://api.github.com/users/jennybuckley/gists{/gist_id}","starred_url":"https://api.github.com/users/jennybuckley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennybuckley/subscriptions","organizations_url":"https://api.github.com/users/jennybuckley/orgs","repos_url":"https://api.github.com/users/jennybuckley/repos","events_url":"https://api.github.com/users/jennybuckley/events{/privacy}","received_events_url":"https://api.github.com/users/jennybuckley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jennybuckley/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/jennybuckley/kubernetes","forks_url":"https://api.github.com/repos/jennybuckley/kubernetes/forks","keys_url":"https://api.github.com/repos/jennybuckley/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jennybuckley/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jennybuckley/kubernetes/teams","hooks_url":"https://api.github.com/repos/jennybuckley/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/jennybuckley/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/jennybuckley/kubernetes/events","assignees_url":"https://api.github.com/repos/jennybuckley/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/jennybuckley/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/jennybuckley/kubernetes/tags","blobs_url":"https://api.github.com/repos/jennybuckley/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jennybuckley/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jennybuckley/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/jennybuckley/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jennybuckley/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/jennybuckley/kubernetes/languages","stargazers_url":"https://api.github.com/repos/jennybuckley/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/jennybuckley/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/jennybuckley/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/jennybuckley/kubernetes/subscription","commits_url":"https://api.github.com/repos/jennybuckley/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/jennybuckley/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/jennybuckley/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/jennybuckley/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/jennybuckley/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/jennybuckley/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jennybuckley/kubernetes/merges","archive_url":"https://api.github.com/repos/jennybuckley/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jennybuckley/kubernetes/downloads","issues_url":"https://api.github.com/repos/jennybuckley/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/jennybuckley/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/jennybuckley/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/jennybuckley/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jennybuckley/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/jennybuckley/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/jennybuckley/kubernetes/deployments","created_at":"2017-08-28T18:02:24Z","updated_at":"2018-05-31T23:27:49Z","pushed_at":"2018-06-15T21:01:06Z","git_url":"git://github.com/jennybuckley/kubernetes.git","ssh_url":"git@github.com:jennybuckley/kubernetes.git","clone_url":"https://github.com/jennybuckley/kubernetes.git","svn_url":"https://github.com/jennybuckley/kubernetes","homepage":"http://kubernetes.io","size":563977,"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:master","ref":"master","sha":"4ba0dbde84ba54941d998fc93b863b7eb97b8d53","user":{"login":"kubernetes","id":13629408,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjI5NDA4","avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkyMDU4MDQ5OA==","name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjI5NDA4","avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","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":"2018-06-15T21:45:50Z","pushed_at":"2018-06-15T21:54:55Z","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":785685,"stargazers_count":37631,"watchers_count":37631,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13151,"mirror_url":null,"archived":false,"open_issues_count":3229,"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":13151,"open_issues":3229,"watchers":37631,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/65150"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/65150"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/65150"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/65150/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/65150/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/65150/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/03c2fa6790afcab3b03c676965c9a1d00299973b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"liggitt"}}