{"action":"created","comment":{"url":"https://api.github.com/repos/knative/serving/pulls/comments/224815657","pull_request_review_id":164282436,"id":224815657,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDgxNTY1Nw==","diff_hunk":"@@ -129,11 +130,29 @@ func NewController(\n \t})\n \n \tc.Logger.Info(\"Setting up ConfigMap receivers\")\n-\tc.configStore = config.NewStore(c.Logger.Named(\"config-store\"))\n+\tc.configStore = config.NewStore(c.Logger.Named(\"config-store\"), c.enqueueRoutes(impl))\n \tc.configStore.WatchConfigs(opt.ConfigMapWatcher)\n \treturn impl\n }\n \n+func (c *Reconciler) enqueueRoutes(impl *controller.Impl) func(string, interface{}) {\n+\treturn func(_ string, value interface{}) {\n+\t\t_, ok := value.(*config.Domain)\n+\t\tif !ok {\n+\t\t\tc.Logger.Debugf(\"not a *config.Domain: '%#v'\", value)\n+\t\t\treturn","path":"pkg/reconciler/v1alpha1/route/route.go","position":23,"original_position":23,"commit_id":"e879b93121a7278a11742dec4d6aec793d22e354","original_commit_id":"e879b93121a7278a11742dec4d6aec793d22e354","user":{"login":"mattmoor","id":2442466,"node_id":"MDQ6VXNlcjI0NDI0NjY=","avatar_url":"https://avatars3.githubusercontent.com/u/2442466?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmoor","html_url":"https://github.com/mattmoor","followers_url":"https://api.github.com/users/mattmoor/followers","following_url":"https://api.github.com/users/mattmoor/following{/other_user}","gists_url":"https://api.github.com/users/mattmoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmoor/subscriptions","organizations_url":"https://api.github.com/users/mattmoor/orgs","repos_url":"https://api.github.com/users/mattmoor/repos","events_url":"https://api.github.com/users/mattmoor/events{/privacy}","received_events_url":"https://api.github.com/users/mattmoor/received_events","type":"User","site_admin":false},"body":"It wasn't immediately obvious to me from this log statement that this is not an error path, but a **filter**.\r\n\r\nI think that I'd like to see us decompose and encapsulate this a bit more so that the `NewStore` call (above) can look like:\r\n```golang\r\n// Triggers a global resync of the objects in the SharedInformer's Store anytime we store a new config:\r\nc.configStore = config.NewStore(c.Logger.Named(\"config-store\"),\r\n  config.GlobalResync(routeInformer))\r\n\r\n// Filter the GlobalResync to just changes in the config.Domain ConfigMap (last so it can be variadic):\r\nc.configStore = config.NewStore(c.Logger.Named(\"config-store\"),\r\n  config.TypeFilter(impl.GlobalResync(routeInformer), &config.Domain{}, ...))\r\n```\r\n\r\nI believe we can do this in a general way by having ([see also](https://godoc.org/k8s.io/client-go/tools/cache#SharedInformer)):\r\n```go\r\nfunc (c *Impl) GlobalResync(si cache.SharedInformer) yourFunc {\r\n  return func(string, interface{}) {\r\n    store := si.GetStore()\r\n    // Consider also ListKeys, but I'm not sure its keys are guaranteed to have the same sense as ours.\r\n    for _, obj := range store.List() {\r\n      c.Enqueue(obj)\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nAs proposed above, we'd need to get some code into `knative/pkg`.  I'd be fine with staging this in `knative/serving`, with loose agreement about how we move it and then doing the `knative/pkg` reshuffling.  This is partly because I suspect we may want to generalize some of the config store stuff into `knative/pkg` as well.","created_at":"2018-10-12T15:01:50Z","updated_at":"2018-10-12T15:04:43Z","html_url":"https://github.com/knative/serving/pull/2220#discussion_r224815657","pull_request_url":"https://api.github.com/repos/knative/serving/pulls/2220","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/knative/serving/pulls/comments/224815657"},"html":{"href":"https://github.com/knative/serving/pull/2220#discussion_r224815657"},"pull_request":{"href":"https://api.github.com/repos/knative/serving/pulls/2220"}}},"pull_request":{"url":"https://api.github.com/repos/knative/serving/pulls/2220","id":222316632,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyMzE2NjMy","html_url":"https://github.com/knative/serving/pull/2220","diff_url":"https://github.com/knative/serving/pull/2220.diff","patch_url":"https://github.com/knative/serving/pull/2220.patch","issue_url":"https://api.github.com/repos/knative/serving/issues/2220","number":2220,"state":"open","locked":false,"title":"[WIP] Enqueue routes on domain-config update","user":{"login":"imikushin","id":931932,"node_id":"MDQ6VXNlcjkzMTkzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/931932?v=4","gravatar_id":"","url":"https://api.github.com/users/imikushin","html_url":"https://github.com/imikushin","followers_url":"https://api.github.com/users/imikushin/followers","following_url":"https://api.github.com/users/imikushin/following{/other_user}","gists_url":"https://api.github.com/users/imikushin/gists{/gist_id}","starred_url":"https://api.github.com/users/imikushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imikushin/subscriptions","organizations_url":"https://api.github.com/users/imikushin/orgs","repos_url":"https://api.github.com/users/imikushin/repos","events_url":"https://api.github.com/users/imikushin/events{/privacy}","received_events_url":"https://api.github.com/users/imikushin/received_events","type":"User","site_admin":false},"body":"Fixes #2182\n\nAdd hooks to run *after* the configStore has been updated. \nList all routes and enqueue them with the controller.\n\nWIP:\n- see if it works ;)\n- possibly list *just* the affected routes\n- unit/e2e tests\n","created_at":"2018-10-12T00:22:48Z","updated_at":"2018-10-12T15:04:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41857231eb5dc98df6fff7dd58ce19e6a69fd40d","assignee":{"login":"mattmoor","id":2442466,"node_id":"MDQ6VXNlcjI0NDI0NjY=","avatar_url":"https://avatars3.githubusercontent.com/u/2442466?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmoor","html_url":"https://github.com/mattmoor","followers_url":"https://api.github.com/users/mattmoor/followers","following_url":"https://api.github.com/users/mattmoor/following{/other_user}","gists_url":"https://api.github.com/users/mattmoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmoor/subscriptions","organizations_url":"https://api.github.com/users/mattmoor/orgs","repos_url":"https://api.github.com/users/mattmoor/repos","events_url":"https://api.github.com/users/mattmoor/events{/privacy}","received_events_url":"https://api.github.com/users/mattmoor/received_events","type":"User","site_admin":false},"assignees":[{"login":"mattmoor","id":2442466,"node_id":"MDQ6VXNlcjI0NDI0NjY=","avatar_url":"https://avatars3.githubusercontent.com/u/2442466?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmoor","html_url":"https://github.com/mattmoor","followers_url":"https://api.github.com/users/mattmoor/followers","following_url":"https://api.github.com/users/mattmoor/following{/other_user}","gists_url":"https://api.github.com/users/mattmoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmoor/subscriptions","organizations_url":"https://api.github.com/users/mattmoor/orgs","repos_url":"https://api.github.com/users/mattmoor/repos","events_url":"https://api.github.com/users/mattmoor/events{/privacy}","received_events_url":"https://api.github.com/users/mattmoor/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"jonjohnsonjr","id":17863526,"node_id":"MDQ6VXNlcjE3ODYzNTI2","avatar_url":"https://avatars1.githubusercontent.com/u/17863526?v=4","gravatar_id":"","url":"https://api.github.com/users/jonjohnsonjr","html_url":"https://github.com/jonjohnsonjr","followers_url":"https://api.github.com/users/jonjohnsonjr/followers","following_url":"https://api.github.com/users/jonjohnsonjr/following{/other_user}","gists_url":"https://api.github.com/users/jonjohnsonjr/gists{/gist_id}","starred_url":"https://api.github.com/users/jonjohnsonjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonjohnsonjr/subscriptions","organizations_url":"https://api.github.com/users/jonjohnsonjr/orgs","repos_url":"https://api.github.com/users/jonjohnsonjr/repos","events_url":"https://api.github.com/users/jonjohnsonjr/events{/privacy}","received_events_url":"https://api.github.com/users/jonjohnsonjr/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":862161916,"node_id":"MDU6TGFiZWw4NjIxNjE5MTY=","url":"https://api.github.com/repos/knative/serving/labels/do-not-merge/work-in-progress","name":"do-not-merge/work-in-progress","color":"b60205","default":false},{"id":859767870,"node_id":"MDU6TGFiZWw4NTk3Njc4NzA=","url":"https://api.github.com/repos/knative/serving/labels/size/M","name":"size/M","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/knative/serving/pulls/2220/commits","review_comments_url":"https://api.github.com/repos/knative/serving/pulls/2220/comments","review_comment_url":"https://api.github.com/repos/knative/serving/pulls/comments{/number}","comments_url":"https://api.github.com/repos/knative/serving/issues/2220/comments","statuses_url":"https://api.github.com/repos/knative/serving/statuses/e879b93121a7278a11742dec4d6aec793d22e354","head":{"label":"imikushin:config-domain-reconcile","ref":"config-domain-reconcile","sha":"e879b93121a7278a11742dec4d6aec793d22e354","user":{"login":"imikushin","id":931932,"node_id":"MDQ6VXNlcjkzMTkzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/931932?v=4","gravatar_id":"","url":"https://api.github.com/users/imikushin","html_url":"https://github.com/imikushin","followers_url":"https://api.github.com/users/imikushin/followers","following_url":"https://api.github.com/users/imikushin/following{/other_user}","gists_url":"https://api.github.com/users/imikushin/gists{/gist_id}","starred_url":"https://api.github.com/users/imikushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imikushin/subscriptions","organizations_url":"https://api.github.com/users/imikushin/orgs","repos_url":"https://api.github.com/users/imikushin/repos","events_url":"https://api.github.com/users/imikushin/events{/privacy}","received_events_url":"https://api.github.com/users/imikushin/received_events","type":"User","site_admin":false},"repo":{"id":143223440,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMyMjM0NDA=","name":"serving","full_name":"imikushin/serving","private":false,"owner":{"login":"imikushin","id":931932,"node_id":"MDQ6VXNlcjkzMTkzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/931932?v=4","gravatar_id":"","url":"https://api.github.com/users/imikushin","html_url":"https://github.com/imikushin","followers_url":"https://api.github.com/users/imikushin/followers","following_url":"https://api.github.com/users/imikushin/following{/other_user}","gists_url":"https://api.github.com/users/imikushin/gists{/gist_id}","starred_url":"https://api.github.com/users/imikushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imikushin/subscriptions","organizations_url":"https://api.github.com/users/imikushin/orgs","repos_url":"https://api.github.com/users/imikushin/repos","events_url":"https://api.github.com/users/imikushin/events{/privacy}","received_events_url":"https://api.github.com/users/imikushin/received_events","type":"User","site_admin":false},"html_url":"https://github.com/imikushin/serving","description":"Kubernetes-based, scale-to-zero, request-driven compute","fork":true,"url":"https://api.github.com/repos/imikushin/serving","forks_url":"https://api.github.com/repos/imikushin/serving/forks","keys_url":"https://api.github.com/repos/imikushin/serving/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imikushin/serving/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imikushin/serving/teams","hooks_url":"https://api.github.com/repos/imikushin/serving/hooks","issue_events_url":"https://api.github.com/repos/imikushin/serving/issues/events{/number}","events_url":"https://api.github.com/repos/imikushin/serving/events","assignees_url":"https://api.github.com/repos/imikushin/serving/assignees{/user}","branches_url":"https://api.github.com/repos/imikushin/serving/branches{/branch}","tags_url":"https://api.github.com/repos/imikushin/serving/tags","blobs_url":"https://api.github.com/repos/imikushin/serving/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imikushin/serving/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imikushin/serving/git/refs{/sha}","trees_url":"https://api.github.com/repos/imikushin/serving/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imikushin/serving/statuses/{sha}","languages_url":"https://api.github.com/repos/imikushin/serving/languages","stargazers_url":"https://api.github.com/repos/imikushin/serving/stargazers","contributors_url":"https://api.github.com/repos/imikushin/serving/contributors","subscribers_url":"https://api.github.com/repos/imikushin/serving/subscribers","subscription_url":"https://api.github.com/repos/imikushin/serving/subscription","commits_url":"https://api.github.com/repos/imikushin/serving/commits{/sha}","git_commits_url":"https://api.github.com/repos/imikushin/serving/git/commits{/sha}","comments_url":"https://api.github.com/repos/imikushin/serving/comments{/number}","issue_comment_url":"https://api.github.com/repos/imikushin/serving/issues/comments{/number}","contents_url":"https://api.github.com/repos/imikushin/serving/contents/{+path}","compare_url":"https://api.github.com/repos/imikushin/serving/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imikushin/serving/merges","archive_url":"https://api.github.com/repos/imikushin/serving/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imikushin/serving/downloads","issues_url":"https://api.github.com/repos/imikushin/serving/issues{/number}","pulls_url":"https://api.github.com/repos/imikushin/serving/pulls{/number}","milestones_url":"https://api.github.com/repos/imikushin/serving/milestones{/number}","notifications_url":"https://api.github.com/repos/imikushin/serving/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imikushin/serving/labels{/name}","releases_url":"https://api.github.com/repos/imikushin/serving/releases{/id}","deployments_url":"https://api.github.com/repos/imikushin/serving/deployments","created_at":"2018-08-02T00:54:05Z","updated_at":"2018-10-09T22:20:55Z","pushed_at":"2018-10-12T00:15:39Z","git_url":"git://github.com/imikushin/serving.git","ssh_url":"git@github.com:imikushin/serving.git","clone_url":"https://github.com/imikushin/serving.git","svn_url":"https://github.com/imikushin/serving","homepage":"","size":23130,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"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":"knative:master","ref":"master","sha":"55c6c1defdd5eb30a65408ad5c5fc55ca2d79436","user":{"login":"knative","id":35583233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NTgzMjMz","avatar_url":"https://avatars2.githubusercontent.com/u/35583233?v=4","gravatar_id":"","url":"https://api.github.com/users/knative","html_url":"https://github.com/knative","followers_url":"https://api.github.com/users/knative/followers","following_url":"https://api.github.com/users/knative/following{/other_user}","gists_url":"https://api.github.com/users/knative/gists{/gist_id}","starred_url":"https://api.github.com/users/knative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knative/subscriptions","organizations_url":"https://api.github.com/users/knative/orgs","repos_url":"https://api.github.com/users/knative/repos","events_url":"https://api.github.com/users/knative/events{/privacy}","received_events_url":"https://api.github.com/users/knative/received_events","type":"Organization","site_admin":false},"repo":{"id":118828329,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg4MjgzMjk=","name":"serving","full_name":"knative/serving","private":false,"owner":{"login":"knative","id":35583233,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NTgzMjMz","avatar_url":"https://avatars2.githubusercontent.com/u/35583233?v=4","gravatar_id":"","url":"https://api.github.com/users/knative","html_url":"https://github.com/knative","followers_url":"https://api.github.com/users/knative/followers","following_url":"https://api.github.com/users/knative/following{/other_user}","gists_url":"https://api.github.com/users/knative/gists{/gist_id}","starred_url":"https://api.github.com/users/knative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knative/subscriptions","organizations_url":"https://api.github.com/users/knative/orgs","repos_url":"https://api.github.com/users/knative/repos","events_url":"https://api.github.com/users/knative/events{/privacy}","received_events_url":"https://api.github.com/users/knative/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/knative/serving","description":"Kubernetes-based, scale-to-zero, request-driven compute","fork":false,"url":"https://api.github.com/repos/knative/serving","forks_url":"https://api.github.com/repos/knative/serving/forks","keys_url":"https://api.github.com/repos/knative/serving/keys{/key_id}","collaborators_url":"https://api.github.com/repos/knative/serving/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/knative/serving/teams","hooks_url":"https://api.github.com/repos/knative/serving/hooks","issue_events_url":"https://api.github.com/repos/knative/serving/issues/events{/number}","events_url":"https://api.github.com/repos/knative/serving/events","assignees_url":"https://api.github.com/repos/knative/serving/assignees{/user}","branches_url":"https://api.github.com/repos/knative/serving/branches{/branch}","tags_url":"https://api.github.com/repos/knative/serving/tags","blobs_url":"https://api.github.com/repos/knative/serving/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/knative/serving/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/knative/serving/git/refs{/sha}","trees_url":"https://api.github.com/repos/knative/serving/git/trees{/sha}","statuses_url":"https://api.github.com/repos/knative/serving/statuses/{sha}","languages_url":"https://api.github.com/repos/knative/serving/languages","stargazers_url":"https://api.github.com/repos/knative/serving/stargazers","contributors_url":"https://api.github.com/repos/knative/serving/contributors","subscribers_url":"https://api.github.com/repos/knative/serving/subscribers","subscription_url":"https://api.github.com/repos/knative/serving/subscription","commits_url":"https://api.github.com/repos/knative/serving/commits{/sha}","git_commits_url":"https://api.github.com/repos/knative/serving/git/commits{/sha}","comments_url":"https://api.github.com/repos/knative/serving/comments{/number}","issue_comment_url":"https://api.github.com/repos/knative/serving/issues/comments{/number}","contents_url":"https://api.github.com/repos/knative/serving/contents/{+path}","compare_url":"https://api.github.com/repos/knative/serving/compare/{base}...{head}","merges_url":"https://api.github.com/repos/knative/serving/merges","archive_url":"https://api.github.com/repos/knative/serving/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/knative/serving/downloads","issues_url":"https://api.github.com/repos/knative/serving/issues{/number}","pulls_url":"https://api.github.com/repos/knative/serving/pulls{/number}","milestones_url":"https://api.github.com/repos/knative/serving/milestones{/number}","notifications_url":"https://api.github.com/repos/knative/serving/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/knative/serving/labels{/name}","releases_url":"https://api.github.com/repos/knative/serving/releases{/id}","deployments_url":"https://api.github.com/repos/knative/serving/deployments","created_at":"2018-01-24T22:07:44Z","updated_at":"2018-10-12T08:56:11Z","pushed_at":"2018-10-12T10:28:35Z","git_url":"git://github.com/knative/serving.git","ssh_url":"git@github.com:knative/serving.git","clone_url":"https://github.com/knative/serving.git","svn_url":"https://github.com/knative/serving","homepage":"","size":23143,"stargazers_count":765,"watchers_count":765,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":138,"mirror_url":null,"archived":false,"open_issues_count":337,"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":138,"open_issues":337,"watchers":765,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/knative/serving/pulls/2220"},"html":{"href":"https://github.com/knative/serving/pull/2220"},"issue":{"href":"https://api.github.com/repos/knative/serving/issues/2220"},"comments":{"href":"https://api.github.com/repos/knative/serving/issues/2220/comments"},"review_comments":{"href":"https://api.github.com/repos/knative/serving/pulls/2220/comments"},"review_comment":{"href":"https://api.github.com/repos/knative/serving/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/knative/serving/pulls/2220/commits"},"statuses":{"href":"https://api.github.com/repos/knative/serving/statuses/e879b93121a7278a11742dec4d6aec793d22e354"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mattmoor"}}