{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/24872468","id":24872468,"diff_hunk":"@@ -25,11 +25,20 @@ import (\n // ValidateEvent makes sure that the event makes sense.\n func ValidateEvent(event *api.Event) errs.ValidationErrorList {\n \tallErrs := errs.ValidationErrorList{}\n-\tif event.Namespace != event.InvolvedObject.Namespace {\n-\t\tallErrs = append(allErrs, errs.NewFieldInvalid(\"involvedObject.namespace\", event.InvolvedObject.Namespace, \"namespace does not match involvedObject\"))\n-\t}\n+\n \tif !util.IsDNSSubdomain(event.Namespace) {\n \t\tallErrs = append(allErrs, errs.NewFieldInvalid(\"namespace\", event.Namespace, \"\"))\n \t}\n+\t// TODO: event.InvolvedObject is not versioned. References need to be normalizd to internal when converted from external and vice versa.\n+\tif event.InvolvedObject.Kind == \"Minion\" || event.InvolvedObject.Kind == \"Node\" {","path":"pkg/api/validation/events.go","position":12,"original_position":12,"commit_id":"109d32a2dce62e20804767b0d3b183769254ee8c","original_commit_id":"109d32a2dce62e20804767b0d3b183769254ee8c","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"body":"latest.RESTMapper can tell you that, but it would have to be passed into the validation.  We haven't discussed validating references much beyond this - perhaps filtering out events which don't point to a known object type should happen at a level before validation?\n\n----- Original Message -----\n> >  \tif !util.IsDNSSubdomain(event.Namespace) {\n> >  \t\tallErrs = append(allErrs, errs.NewFieldInvalid(\"namespace\",\n> >  \t\tevent.Namespace, \"\"))\n> >  \t}\n> > +\t// TODO: event.InvolvedObject is not versioned. References need to be\n> > normalizd to internal when converted from external and vice versa.\n> > +\tif event.InvolvedObject.Kind == \"Minion\" || event.InvolvedObject.Kind ==\n> > \"Node\" {\n> \n> I see-- in that case, @ddysher, can you make this code state the distinction\n> in those terms? Like make/call a \"IsRootResource()\" function instead of\n> special-casing minion/node.\n> \n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/GoogleCloudPlatform/kubernetes/pull/4396/files#r24872179\n","created_at":"2015-02-18T01:26:45Z","updated_at":"2015-02-18T01:26:45Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4396#discussion_r24872468","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4396","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/24872468"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4396#discussion_r24872468"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4396"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4396","id":29217427,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4396","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4396.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4396.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/4396","number":4396,"state":"open","locked":false,"title":"Node event","user":{"login":"ddysher","id":2191361,"avatar_url":"https://avatars.githubusercontent.com/u/2191361?v=3","gravatar_id":"","url":"https://api.github.com/users/ddysher","html_url":"https://github.com/ddysher","followers_url":"https://api.github.com/users/ddysher/followers","following_url":"https://api.github.com/users/ddysher/following{/other_user}","gists_url":"https://api.github.com/users/ddysher/gists{/gist_id}","starred_url":"https://api.github.com/users/ddysher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddysher/subscriptions","organizations_url":"https://api.github.com/users/ddysher/orgs","repos_url":"https://api.github.com/users/ddysher/repos","events_url":"https://api.github.com/users/ddysher/events{/privacy}","received_events_url":"https://api.github.com/users/ddysher/received_events","type":"User","site_admin":false},"body":"Fix #4379 and publish node status change event.\r\n\r\nThe fix choses to not compare event namespace with node namespace, i.e. event namespace is default, and node namespace is None.  The alternative fix is to reset event namespace to none if involvedObject is a node.  I think the first fix is perferrable as event as a kind, is namespace scoped.\r\n\r\n/cc @smarterclayton @dchen1107 @derekwaynecarr \r\n","created_at":"2015-02-12T21:23:23Z","updated_at":"2015-02-18T01:26:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50862519c2833ff12a97b8797dff2190b3db9f57","assignee":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=3","gravatar_id":"","url":"https://api.github.com/users/lavalamp","html_url":"https://github.com/lavalamp","followers_url":"https://api.github.com/users/lavalamp/followers","following_url":"https://api.github.com/users/lavalamp/following{/other_user}","gists_url":"https://api.github.com/users/lavalamp/gists{/gist_id}","starred_url":"https://api.github.com/users/lavalamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavalamp/subscriptions","organizations_url":"https://api.github.com/users/lavalamp/orgs","repos_url":"https://api.github.com/users/lavalamp/repos","events_url":"https://api.github.com/users/lavalamp/events{/privacy}","received_events_url":"https://api.github.com/users/lavalamp/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4396/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4396/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/4396/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/109d32a2dce62e20804767b0d3b183769254ee8c","head":{"label":"ddysher:node-event-describe","ref":"node-event-describe","sha":"109d32a2dce62e20804767b0d3b183769254ee8c","user":{"login":"ddysher","id":2191361,"avatar_url":"https://avatars.githubusercontent.com/u/2191361?v=3","gravatar_id":"","url":"https://api.github.com/users/ddysher","html_url":"https://github.com/ddysher","followers_url":"https://api.github.com/users/ddysher/followers","following_url":"https://api.github.com/users/ddysher/following{/other_user}","gists_url":"https://api.github.com/users/ddysher/gists{/gist_id}","starred_url":"https://api.github.com/users/ddysher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddysher/subscriptions","organizations_url":"https://api.github.com/users/ddysher/orgs","repos_url":"https://api.github.com/users/ddysher/repos","events_url":"https://api.github.com/users/ddysher/events{/privacy}","received_events_url":"https://api.github.com/users/ddysher/received_events","type":"User","site_admin":false},"repo":{"id":22863953,"name":"kubernetes","full_name":"ddysher/kubernetes","owner":{"login":"ddysher","id":2191361,"avatar_url":"https://avatars.githubusercontent.com/u/2191361?v=3","gravatar_id":"","url":"https://api.github.com/users/ddysher","html_url":"https://github.com/ddysher","followers_url":"https://api.github.com/users/ddysher/followers","following_url":"https://api.github.com/users/ddysher/following{/other_user}","gists_url":"https://api.github.com/users/ddysher/gists{/gist_id}","starred_url":"https://api.github.com/users/ddysher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddysher/subscriptions","organizations_url":"https://api.github.com/users/ddysher/orgs","repos_url":"https://api.github.com/users/ddysher/repos","events_url":"https://api.github.com/users/ddysher/events{/privacy}","received_events_url":"https://api.github.com/users/ddysher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ddysher/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/ddysher/kubernetes","forks_url":"https://api.github.com/repos/ddysher/kubernetes/forks","keys_url":"https://api.github.com/repos/ddysher/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ddysher/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ddysher/kubernetes/teams","hooks_url":"https://api.github.com/repos/ddysher/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/ddysher/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/ddysher/kubernetes/events","assignees_url":"https://api.github.com/repos/ddysher/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/ddysher/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/ddysher/kubernetes/tags","blobs_url":"https://api.github.com/repos/ddysher/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ddysher/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ddysher/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/ddysher/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ddysher/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/ddysher/kubernetes/languages","stargazers_url":"https://api.github.com/repos/ddysher/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/ddysher/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/ddysher/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/ddysher/kubernetes/subscription","commits_url":"https://api.github.com/repos/ddysher/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/ddysher/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/ddysher/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/ddysher/kubernetes/issues/comments/{number}","contents_url":"https://api.github.com/repos/ddysher/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/ddysher/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ddysher/kubernetes/merges","archive_url":"https://api.github.com/repos/ddysher/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ddysher/kubernetes/downloads","issues_url":"https://api.github.com/repos/ddysher/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/ddysher/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/ddysher/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/ddysher/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ddysher/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/ddysher/kubernetes/releases{/id}","created_at":"2014-08-12T03:48:56Z","updated_at":"2014-08-15T00:25:36Z","pushed_at":"2015-02-17T21:52:51Z","git_url":"git://github.com/ddysher/kubernetes.git","ssh_url":"git@github.com:ddysher/kubernetes.git","clone_url":"https://github.com/ddysher/kubernetes.git","svn_url":"https://github.com/ddysher/kubernetes","homepage":null,"size":29780,"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":"003c0986b424eab6c137b4797d14cd2fb6e7f197","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","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-02-18T01:22:17Z","pushed_at":"2015-02-18T01:22:17Z","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":79848,"stargazers_count":6256,"watchers_count":6256,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1096,"mirror_url":null,"open_issues_count":688,"forks":1096,"open_issues":688,"watchers":6256,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4396"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/4396"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/4396"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/4396/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4396/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/4396/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/109d32a2dce62e20804767b0d3b183769254ee8c"}}}}