{"action":"created","comment":{"url":"https://api.github.com/repos/cilium/cilium/pulls/comments/245262106","pull_request_review_id":189321271,"id":245262106,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTI2MjEwNg==","diff_hunk":"@@ -99,10 +103,15 @@ func injectToCIDRSetRules(rule *api.Rule, cache *DNSCache, reMap *regexpmap.Rege\n \t\t\t\t\t}).Debug(\"Emitting matching DNS Name -> IPs for ToFQDNs Rule\")\n \t\t\t\t\tdelete(missing, ToFQDN.MatchPattern)\n \t\t\t\t\temitted[name] = append(emitted[name], ips...)\n-\t\t\t\t\tegressRule.ToCIDRSet = append(egressRule.ToCIDRSet, api.IPsToCIDRRules(ips)...)\n+\t\t\t\t\tallIPs = append(allIPs, ips...)\n \t\t\t\t}\n \t\t\t}\n \t\t}\n+\n+\t\t// Only overwrite ToCIDRSet for rules with FQDN elements\n+\t\tif len(allIPs) > 0 {\n+\t\t\tegressRule.ToCIDRSet = api.IPsToCIDRRules(ip.KeepUniqueIPs(allIPs))","path":"pkg/fqdn/helpers.go","position":39,"original_position":39,"commit_id":"d7503ddfce05888e8526cec740055b985f62deb1","original_commit_id":"d7503ddfce05888e8526cec740055b985f62deb1","user":{"login":"raybejjani","id":744312,"node_id":"MDQ6VXNlcjc0NDMxMg==","avatar_url":"https://avatars0.githubusercontent.com/u/744312?v=4","gravatar_id":"","url":"https://api.github.com/users/raybejjani","html_url":"https://github.com/raybejjani","followers_url":"https://api.github.com/users/raybejjani/followers","following_url":"https://api.github.com/users/raybejjani/following{/other_user}","gists_url":"https://api.github.com/users/raybejjani/gists{/gist_id}","starred_url":"https://api.github.com/users/raybejjani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raybejjani/subscriptions","organizations_url":"https://api.github.com/users/raybejjani/orgs","repos_url":"https://api.github.com/users/raybejjani/repos","events_url":"https://api.github.com/users/raybejjani/events{/privacy}","received_events_url":"https://api.github.com/users/raybejjani/received_events","type":"User","site_admin":false},"body":"oh, one last thing. The comment on`injectToCIDRSetRules` already existing rules are preserved. We should remove that line (44) above.","created_at":"2019-01-04T10:31:22Z","updated_at":"2019-01-04T10:31:26Z","html_url":"https://github.com/cilium/cilium/pull/6542#discussion_r245262106","pull_request_url":"https://api.github.com/repos/cilium/cilium/pulls/6542","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/cilium/cilium/pulls/comments/245262106"},"html":{"href":"https://github.com/cilium/cilium/pull/6542#discussion_r245262106"},"pull_request":{"href":"https://api.github.com/repos/cilium/cilium/pulls/6542"}}},"pull_request":{"url":"https://api.github.com/repos/cilium/cilium/pulls/6542","id":242210483,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQyMjEwNDgz","html_url":"https://github.com/cilium/cilium/pull/6542","diff_url":"https://github.com/cilium/cilium/pull/6542.diff","patch_url":"https://github.com/cilium/cilium/pull/6542.patch","issue_url":"https://api.github.com/repos/cilium/cilium/issues/6542","number":6542,"state":"open","locked":false,"title":"fqdn: Fix duplicate CIDRSet generation","user":{"login":"tgraf","id":1417913,"node_id":"MDQ6VXNlcjE0MTc5MTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1417913?v=4","gravatar_id":"","url":"https://api.github.com/users/tgraf","html_url":"https://github.com/tgraf","followers_url":"https://api.github.com/users/tgraf/followers","following_url":"https://api.github.com/users/tgraf/following{/other_user}","gists_url":"https://api.github.com/users/tgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/tgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgraf/subscriptions","organizations_url":"https://api.github.com/users/tgraf/orgs","repos_url":"https://api.github.com/users/tgraf/repos","events_url":"https://api.github.com/users/tgraf/events{/privacy}","received_events_url":"https://api.github.com/users/tgraf/received_events","type":"User","site_admin":false},"body":"When using match patterns, the FQDN cache returns a map of results, each\r\ncontaining a list of IPs. This can lead to duplicate IPs inserted into the list\r\nof rules.\r\n\r\nFixes: #6541\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cilium/cilium/6542)\n<!-- Reviewable:end -->\n","created_at":"2019-01-04T09:22:47Z","updated_at":"2019-01-04T10:31:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5c724bd0571f5a4c5e9c618f4ea6fb5720baa38","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"janitors","id":2519796,"node_id":"MDQ6VGVhbTI1MTk3OTY=","slug":"janitors","description":"Rotating team of janitors for unowned code","privacy":"closed","url":"https://api.github.com/teams/2519796","members_url":"https://api.github.com/teams/2519796/members{/member}","repositories_url":"https://api.github.com/teams/2519796/repos","permission":"pull"}],"labels":[{"id":300384439,"node_id":"MDU6TGFiZWwzMDAzODQ0Mzk=","url":"https://api.github.com/repos/cilium/cilium/labels/kind/bug","name":"kind/bug","color":"fc2929","default":false},{"id":1157227922,"node_id":"MDU6TGFiZWwxMTU3MjI3OTIy","url":"https://api.github.com/repos/cilium/cilium/labels/needs-backport/1.4","name":"needs-backport/1.4","color":"56eadb","default":false}],"milestone":{"url":"https://api.github.com/repos/cilium/cilium/milestones/20","html_url":"https://github.com/cilium/cilium/milestone/20","labels_url":"https://api.github.com/repos/cilium/cilium/milestones/20/labels","id":3736769,"node_id":"MDk6TWlsZXN0b25lMzczNjc2OQ==","number":20,"title":"1.4-bugfix","description":"","creator":{"login":"tgraf","id":1417913,"node_id":"MDQ6VXNlcjE0MTc5MTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1417913?v=4","gravatar_id":"","url":"https://api.github.com/users/tgraf","html_url":"https://github.com/tgraf","followers_url":"https://api.github.com/users/tgraf/followers","following_url":"https://api.github.com/users/tgraf/following{/other_user}","gists_url":"https://api.github.com/users/tgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/tgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgraf/subscriptions","organizations_url":"https://api.github.com/users/tgraf/orgs","repos_url":"https://api.github.com/users/tgraf/repos","events_url":"https://api.github.com/users/tgraf/events{/privacy}","received_events_url":"https://api.github.com/users/tgraf/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":110,"state":"open","created_at":"2018-10-14T10:00:35Z","updated_at":"2019-01-04T09:42:23Z","due_on":"2018-12-03T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/cilium/cilium/pulls/6542/commits","review_comments_url":"https://api.github.com/repos/cilium/cilium/pulls/6542/comments","review_comment_url":"https://api.github.com/repos/cilium/cilium/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cilium/cilium/issues/6542/comments","statuses_url":"https://api.github.com/repos/cilium/cilium/statuses/d7503ddfce05888e8526cec740055b985f62deb1","head":{"label":"cilium:pr/tgraf/fix-fqdn-duplicates","ref":"pr/tgraf/fix-fqdn-duplicates","sha":"d7503ddfce05888e8526cec740055b985f62deb1","user":{"login":"cilium","id":21054566,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDU0NTY2","avatar_url":"https://avatars0.githubusercontent.com/u/21054566?v=4","gravatar_id":"","url":"https://api.github.com/users/cilium","html_url":"https://github.com/cilium","followers_url":"https://api.github.com/users/cilium/followers","following_url":"https://api.github.com/users/cilium/following{/other_user}","gists_url":"https://api.github.com/users/cilium/gists{/gist_id}","starred_url":"https://api.github.com/users/cilium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilium/subscriptions","organizations_url":"https://api.github.com/users/cilium/orgs","repos_url":"https://api.github.com/users/cilium/repos","events_url":"https://api.github.com/users/cilium/events{/privacy}","received_events_url":"https://api.github.com/users/cilium/received_events","type":"Organization","site_admin":false},"repo":{"id":48109239,"node_id":"MDEwOlJlcG9zaXRvcnk0ODEwOTIzOQ==","name":"cilium","full_name":"cilium/cilium","private":false,"owner":{"login":"cilium","id":21054566,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDU0NTY2","avatar_url":"https://avatars0.githubusercontent.com/u/21054566?v=4","gravatar_id":"","url":"https://api.github.com/users/cilium","html_url":"https://github.com/cilium","followers_url":"https://api.github.com/users/cilium/followers","following_url":"https://api.github.com/users/cilium/following{/other_user}","gists_url":"https://api.github.com/users/cilium/gists{/gist_id}","starred_url":"https://api.github.com/users/cilium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilium/subscriptions","organizations_url":"https://api.github.com/users/cilium/orgs","repos_url":"https://api.github.com/users/cilium/repos","events_url":"https://api.github.com/users/cilium/events{/privacy}","received_events_url":"https://api.github.com/users/cilium/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cilium/cilium","description":"API Aware Networking and Security using BPF and XDP","fork":false,"url":"https://api.github.com/repos/cilium/cilium","forks_url":"https://api.github.com/repos/cilium/cilium/forks","keys_url":"https://api.github.com/repos/cilium/cilium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cilium/cilium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cilium/cilium/teams","hooks_url":"https://api.github.com/repos/cilium/cilium/hooks","issue_events_url":"https://api.github.com/repos/cilium/cilium/issues/events{/number}","events_url":"https://api.github.com/repos/cilium/cilium/events","assignees_url":"https://api.github.com/repos/cilium/cilium/assignees{/user}","branches_url":"https://api.github.com/repos/cilium/cilium/branches{/branch}","tags_url":"https://api.github.com/repos/cilium/cilium/tags","blobs_url":"https://api.github.com/repos/cilium/cilium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cilium/cilium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cilium/cilium/git/refs{/sha}","trees_url":"https://api.github.com/repos/cilium/cilium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cilium/cilium/statuses/{sha}","languages_url":"https://api.github.com/repos/cilium/cilium/languages","stargazers_url":"https://api.github.com/repos/cilium/cilium/stargazers","contributors_url":"https://api.github.com/repos/cilium/cilium/contributors","subscribers_url":"https://api.github.com/repos/cilium/cilium/subscribers","subscription_url":"https://api.github.com/repos/cilium/cilium/subscription","commits_url":"https://api.github.com/repos/cilium/cilium/commits{/sha}","git_commits_url":"https://api.github.com/repos/cilium/cilium/git/commits{/sha}","comments_url":"https://api.github.com/repos/cilium/cilium/comments{/number}","issue_comment_url":"https://api.github.com/repos/cilium/cilium/issues/comments{/number}","contents_url":"https://api.github.com/repos/cilium/cilium/contents/{+path}","compare_url":"https://api.github.com/repos/cilium/cilium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cilium/cilium/merges","archive_url":"https://api.github.com/repos/cilium/cilium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cilium/cilium/downloads","issues_url":"https://api.github.com/repos/cilium/cilium/issues{/number}","pulls_url":"https://api.github.com/repos/cilium/cilium/pulls{/number}","milestones_url":"https://api.github.com/repos/cilium/cilium/milestones{/number}","notifications_url":"https://api.github.com/repos/cilium/cilium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cilium/cilium/labels{/name}","releases_url":"https://api.github.com/repos/cilium/cilium/releases{/id}","deployments_url":"https://api.github.com/repos/cilium/cilium/deployments","created_at":"2015-12-16T12:33:31Z","updated_at":"2019-01-04T10:07:25Z","pushed_at":"2019-01-04T10:20:06Z","git_url":"git://github.com/cilium/cilium.git","ssh_url":"git@github.com:cilium/cilium.git","clone_url":"https://github.com/cilium/cilium.git","svn_url":"https://github.com/cilium/cilium","homepage":"","size":78402,"stargazers_count":3264,"watchers_count":3264,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":291,"mirror_url":null,"archived":false,"open_issues_count":583,"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":291,"open_issues":583,"watchers":3264,"default_branch":"master"}},"base":{"label":"cilium:master","ref":"master","sha":"20a808dbe197c578e42d55b9bb3a7ce04e02e2ac","user":{"login":"cilium","id":21054566,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDU0NTY2","avatar_url":"https://avatars0.githubusercontent.com/u/21054566?v=4","gravatar_id":"","url":"https://api.github.com/users/cilium","html_url":"https://github.com/cilium","followers_url":"https://api.github.com/users/cilium/followers","following_url":"https://api.github.com/users/cilium/following{/other_user}","gists_url":"https://api.github.com/users/cilium/gists{/gist_id}","starred_url":"https://api.github.com/users/cilium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilium/subscriptions","organizations_url":"https://api.github.com/users/cilium/orgs","repos_url":"https://api.github.com/users/cilium/repos","events_url":"https://api.github.com/users/cilium/events{/privacy}","received_events_url":"https://api.github.com/users/cilium/received_events","type":"Organization","site_admin":false},"repo":{"id":48109239,"node_id":"MDEwOlJlcG9zaXRvcnk0ODEwOTIzOQ==","name":"cilium","full_name":"cilium/cilium","private":false,"owner":{"login":"cilium","id":21054566,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDU0NTY2","avatar_url":"https://avatars0.githubusercontent.com/u/21054566?v=4","gravatar_id":"","url":"https://api.github.com/users/cilium","html_url":"https://github.com/cilium","followers_url":"https://api.github.com/users/cilium/followers","following_url":"https://api.github.com/users/cilium/following{/other_user}","gists_url":"https://api.github.com/users/cilium/gists{/gist_id}","starred_url":"https://api.github.com/users/cilium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cilium/subscriptions","organizations_url":"https://api.github.com/users/cilium/orgs","repos_url":"https://api.github.com/users/cilium/repos","events_url":"https://api.github.com/users/cilium/events{/privacy}","received_events_url":"https://api.github.com/users/cilium/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cilium/cilium","description":"API Aware Networking and Security using BPF and XDP","fork":false,"url":"https://api.github.com/repos/cilium/cilium","forks_url":"https://api.github.com/repos/cilium/cilium/forks","keys_url":"https://api.github.com/repos/cilium/cilium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cilium/cilium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cilium/cilium/teams","hooks_url":"https://api.github.com/repos/cilium/cilium/hooks","issue_events_url":"https://api.github.com/repos/cilium/cilium/issues/events{/number}","events_url":"https://api.github.com/repos/cilium/cilium/events","assignees_url":"https://api.github.com/repos/cilium/cilium/assignees{/user}","branches_url":"https://api.github.com/repos/cilium/cilium/branches{/branch}","tags_url":"https://api.github.com/repos/cilium/cilium/tags","blobs_url":"https://api.github.com/repos/cilium/cilium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cilium/cilium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cilium/cilium/git/refs{/sha}","trees_url":"https://api.github.com/repos/cilium/cilium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cilium/cilium/statuses/{sha}","languages_url":"https://api.github.com/repos/cilium/cilium/languages","stargazers_url":"https://api.github.com/repos/cilium/cilium/stargazers","contributors_url":"https://api.github.com/repos/cilium/cilium/contributors","subscribers_url":"https://api.github.com/repos/cilium/cilium/subscribers","subscription_url":"https://api.github.com/repos/cilium/cilium/subscription","commits_url":"https://api.github.com/repos/cilium/cilium/commits{/sha}","git_commits_url":"https://api.github.com/repos/cilium/cilium/git/commits{/sha}","comments_url":"https://api.github.com/repos/cilium/cilium/comments{/number}","issue_comment_url":"https://api.github.com/repos/cilium/cilium/issues/comments{/number}","contents_url":"https://api.github.com/repos/cilium/cilium/contents/{+path}","compare_url":"https://api.github.com/repos/cilium/cilium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cilium/cilium/merges","archive_url":"https://api.github.com/repos/cilium/cilium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cilium/cilium/downloads","issues_url":"https://api.github.com/repos/cilium/cilium/issues{/number}","pulls_url":"https://api.github.com/repos/cilium/cilium/pulls{/number}","milestones_url":"https://api.github.com/repos/cilium/cilium/milestones{/number}","notifications_url":"https://api.github.com/repos/cilium/cilium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cilium/cilium/labels{/name}","releases_url":"https://api.github.com/repos/cilium/cilium/releases{/id}","deployments_url":"https://api.github.com/repos/cilium/cilium/deployments","created_at":"2015-12-16T12:33:31Z","updated_at":"2019-01-04T10:07:25Z","pushed_at":"2019-01-04T10:20:06Z","git_url":"git://github.com/cilium/cilium.git","ssh_url":"git@github.com:cilium/cilium.git","clone_url":"https://github.com/cilium/cilium.git","svn_url":"https://github.com/cilium/cilium","homepage":"","size":78402,"stargazers_count":3264,"watchers_count":3264,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":291,"mirror_url":null,"archived":false,"open_issues_count":583,"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":291,"open_issues":583,"watchers":3264,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cilium/cilium/pulls/6542"},"html":{"href":"https://github.com/cilium/cilium/pull/6542"},"issue":{"href":"https://api.github.com/repos/cilium/cilium/issues/6542"},"comments":{"href":"https://api.github.com/repos/cilium/cilium/issues/6542/comments"},"review_comments":{"href":"https://api.github.com/repos/cilium/cilium/pulls/6542/comments"},"review_comment":{"href":"https://api.github.com/repos/cilium/cilium/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cilium/cilium/pulls/6542/commits"},"statuses":{"href":"https://api.github.com/repos/cilium/cilium/statuses/d7503ddfce05888e8526cec740055b985f62deb1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"raybejjani"}}