{"action":"created","issue":{"url":"https://api.github.com/repos/coreos/prometheus-operator/issues/1697","repository_url":"https://api.github.com/repos/coreos/prometheus-operator","labels_url":"https://api.github.com/repos/coreos/prometheus-operator/issues/1697/labels{/name}","comments_url":"https://api.github.com/repos/coreos/prometheus-operator/issues/1697/comments","events_url":"https://api.github.com/repos/coreos/prometheus-operator/issues/1697/events","html_url":"https://github.com/coreos/prometheus-operator/pull/1697","id":344481427,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzODY2NTg0","number":1697,"title":"client-go/informers: Add namespace indexer to SharedIndexInformers","user":{"login":"mxinden","id":7047859,"node_id":"MDQ6VXNlcjcwNDc4NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/7047859?v=4","gravatar_id":"","url":"https://api.github.com/users/mxinden","html_url":"https://github.com/mxinden","followers_url":"https://api.github.com/users/mxinden/followers","following_url":"https://api.github.com/users/mxinden/following{/other_user}","gists_url":"https://api.github.com/users/mxinden/gists{/gist_id}","starred_url":"https://api.github.com/users/mxinden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxinden/subscriptions","organizations_url":"https://api.github.com/users/mxinden/orgs","repos_url":"https://api.github.com/users/mxinden/repos","events_url":"https://api.github.com/users/mxinden/events{/privacy}","received_events_url":"https://api.github.com/users/mxinden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-25T14:58:53Z","updated_at":"2018-07-25T15:33:58Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/coreos/prometheus-operator/pulls/1697","html_url":"https://github.com/coreos/prometheus-operator/pull/1697","diff_url":"https://github.com/coreos/prometheus-operator/pull/1697.diff","patch_url":"https://github.com/coreos/prometheus-operator/pull/1697.patch"},"body":"`client-go/tools/cache.ListAllByNamespace` tries to search the given\r\ncache by the namespace index. If that index is not present, it logs a\r\nwarning message and iterates over the objects itself [1].\r\n\r\nInitially to remove the log line, but as a side effect also to improve query\r\nspeed, this patch adds the namespace index to all used SharedIndexInformers in\r\nthe Prometheus and Alertmanager operator.\r\n\r\n[1]\r\n```golang\r\nitems, err := indexer.Index(NamespaceIndex, &metav1.ObjectMeta{Namespace: namespace})\r\nif err != nil {\r\n\t// Ignore error; do slow search without index.\r\n\tglog.Warningf(\"can not retrieve list of objects using index : %v\", err)\r\n\tfor _, m := range indexer.List() {\r\n```\r\n\r\nFixes https://github.com/coreos/prometheus-operator/issues/1694\r\n\r\n//CC @prune998"},"comment":{"url":"https://api.github.com/repos/coreos/prometheus-operator/issues/comments/407797220","html_url":"https://github.com/coreos/prometheus-operator/pull/1697#issuecomment-407797220","issue_url":"https://api.github.com/repos/coreos/prometheus-operator/issues/1697","id":407797220,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzc5NzIyMA==","user":{"login":"brancz","id":4546722,"node_id":"MDQ6VXNlcjQ1NDY3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/4546722?v=4","gravatar_id":"","url":"https://api.github.com/users/brancz","html_url":"https://github.com/brancz","followers_url":"https://api.github.com/users/brancz/followers","following_url":"https://api.github.com/users/brancz/following{/other_user}","gists_url":"https://api.github.com/users/brancz/gists{/gist_id}","starred_url":"https://api.github.com/users/brancz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brancz/subscriptions","organizations_url":"https://api.github.com/users/brancz/orgs","repos_url":"https://api.github.com/users/brancz/repos","events_url":"https://api.github.com/users/brancz/events{/privacy}","received_events_url":"https://api.github.com/users/brancz/received_events","type":"User","site_admin":false},"created_at":"2018-07-25T15:33:58Z","updated_at":"2018-07-25T15:33:58Z","author_association":"MEMBER","body":"Nice! lgtm :+1: \r\n\r\nAlso that was a nice deep dive into the informer infrastructure! :smile: "}}
{"actor":{"display_login":"brancz"}}