{"action":"created","comment":{"url":"https://api.github.com/repos/giantswarm/route53-manager/pulls/comments/361498126","pull_request_review_id":336572786,"id":361498126,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM2MTQ5ODEyNg==","diff_hunk":"@@ -473,6 +482,70 @@ func (m *Manager) deleteTargetStack(targetStackName string) error {\n \treturn nil\n }\n \n+func (m *Manager) deleteTargetLeftovers() error {\n+\tinput := &route53.ListResourceRecordSetsInput{\n+\t\tHostedZoneId: &m.targetHostedZoneID,\n+\t}\n+\to, err := m.targetClient.ListResourceRecordSets(input)\n+\n+\tif err != nil {\n+\t\treturn microerror.Mask(err)\n+\t}\n+\n+\tresourceRecordSets := o.ResourceRecordSets\n+\n+\troute53Changes := []*route53.Change{}\n+\tfor _, rr := range resourceRecordSets {\n+\t\trrPattern := fmt.Sprintf(\"^*.%s.$\", m.targetHostedZoneName)\n+\t\tmatch, err := regexp.Match(rrPattern, []byte(*rr.Name))\n+\t\tif err != nil {\n+\t\t\treturn microerror.Mask(err)\n+\t\t}\n+\n+\t\tif match {\n+\t\t\troute53Change := &route53.Change{\n+\t\t\t\tAction: aws.String(\"DELETE\"),\n+\t\t\t\tResourceRecordSet: &route53.ResourceRecordSet{\n+\t\t\t\t\tAliasTarget:     rr.AliasTarget,\n+\t\t\t\t\tName:            rr.Name,\n+\t\t\t\t\tResourceRecords: rr.ResourceRecords,\n+\t\t\t\t\tTTL:             rr.TTL,\n+\t\t\t\t\tType:            rr.Type,\n+\t\t\t\t\tWeight:          rr.Weight,\n+\t\t\t\t\tSetIdentifier:   rr.SetIdentifier,\n+\t\t\t\t},\n+\t\t\t}\n+\n+\t\t\troute53Changes = append(route53Changes, route53Change)\n+\n+\t\t\tm.logger.Log(\"level\", \"debug\", \"message\", fmt.Sprintf(\"found non-managed record set %#q in hosted zone %#q\", *rr.Name, m.targetHostedZoneID))\n+\t\t}\n+\t}\n+\n+\tif len(route53Changes) > 0 {\n+\t\tm.logger.Log(\"level\", \"debug\", \"message\", fmt.Sprintf(\"deleteting non-managed record sets in hosted zone %#q\", m.targetHostedZoneID))","path":"pkg/recordset/recordset.go","position":68,"original_position":68,"commit_id":"d5959b7e6354b29929b71ab7b650705e0ec44580","original_commit_id":"d5959b7e6354b29929b71ab7b650705e0ec44580","user":{"login":"rossf7","id":311527,"node_id":"MDQ6VXNlcjMxMTUyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/311527?v=4","gravatar_id":"","url":"https://api.github.com/users/rossf7","html_url":"https://github.com/rossf7","followers_url":"https://api.github.com/users/rossf7/followers","following_url":"https://api.github.com/users/rossf7/following{/other_user}","gists_url":"https://api.github.com/users/rossf7/gists{/gist_id}","starred_url":"https://api.github.com/users/rossf7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossf7/subscriptions","organizations_url":"https://api.github.com/users/rossf7/orgs","repos_url":"https://api.github.com/users/rossf7/repos","events_url":"https://api.github.com/users/rossf7/events{/privacy}","received_events_url":"https://api.github.com/users/rossf7/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n\t\tm.logger.Log(\"level\", \"debug\", \"message\", fmt.Sprintf(\"deleting non-managed record sets in hosted zone %#q\", m.targetHostedZoneID))\r\n```","created_at":"2019-12-26T17:20:38Z","updated_at":"2019-12-26T17:21:00Z","html_url":"https://github.com/giantswarm/route53-manager/pull/28#discussion_r361498126","pull_request_url":"https://api.github.com/repos/giantswarm/route53-manager/pulls/28","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/giantswarm/route53-manager/pulls/comments/361498126"},"html":{"href":"https://github.com/giantswarm/route53-manager/pull/28#discussion_r361498126"},"pull_request":{"href":"https://api.github.com/repos/giantswarm/route53-manager/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/giantswarm/route53-manager/pulls/28","id":356985829,"node_id":"MDExOlB1bGxSZXF1ZXN0MzU2OTg1ODI5","html_url":"https://github.com/giantswarm/route53-manager/pull/28","diff_url":"https://github.com/giantswarm/route53-manager/pull/28.diff","patch_url":"https://github.com/giantswarm/route53-manager/pull/28.patch","issue_url":"https://api.github.com/repos/giantswarm/route53-manager/issues/28","number":28,"state":"open","locked":false,"title":"Cleanup external-dns records","user":{"login":"corest","id":1071648,"node_id":"MDQ6VXNlcjEwNzE2NDg=","avatar_url":"https://avatars1.githubusercontent.com/u/1071648?v=4","gravatar_id":"","url":"https://api.github.com/users/corest","html_url":"https://github.com/corest","followers_url":"https://api.github.com/users/corest/followers","following_url":"https://api.github.com/users/corest/following{/other_user}","gists_url":"https://api.github.com/users/corest/gists{/gist_id}","starred_url":"https://api.github.com/users/corest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corest/subscriptions","organizations_url":"https://api.github.com/users/corest/orgs","repos_url":"https://api.github.com/users/corest/repos","events_url":"https://api.github.com/users/corest/events{/privacy}","received_events_url":"https://api.github.com/users/corest/received_events","type":"User","site_admin":false},"body":"Towards https://github.com/giantswarm/giantswarm/issues/8182\r\n\r\nCleanup records, created by external-dns after the cluster was deleted","created_at":"2019-12-26T14:40:37Z","updated_at":"2019-12-26T17:21:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1732d12e56c1aaf5f6b3da1ef61d33c47ced136","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/giantswarm/route53-manager/pulls/28/commits","review_comments_url":"https://api.github.com/repos/giantswarm/route53-manager/pulls/28/comments","review_comment_url":"https://api.github.com/repos/giantswarm/route53-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/giantswarm/route53-manager/issues/28/comments","statuses_url":"https://api.github.com/repos/giantswarm/route53-manager/statuses/d5959b7e6354b29929b71ab7b650705e0ec44580","head":{"label":"giantswarm:cleanup_external_dns_records","ref":"cleanup_external_dns_records","sha":"d5959b7e6354b29929b71ab7b650705e0ec44580","user":{"login":"giantswarm","id":7556340,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1NTYzNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7556340?v=4","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"repo":{"id":140307180,"node_id":"MDEwOlJlcG9zaXRvcnkxNDAzMDcxODA=","name":"route53-manager","full_name":"giantswarm/route53-manager","private":false,"owner":{"login":"giantswarm","id":7556340,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1NTYzNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7556340?v=4","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/giantswarm/route53-manager","description":null,"fork":false,"url":"https://api.github.com/repos/giantswarm/route53-manager","forks_url":"https://api.github.com/repos/giantswarm/route53-manager/forks","keys_url":"https://api.github.com/repos/giantswarm/route53-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giantswarm/route53-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giantswarm/route53-manager/teams","hooks_url":"https://api.github.com/repos/giantswarm/route53-manager/hooks","issue_events_url":"https://api.github.com/repos/giantswarm/route53-manager/issues/events{/number}","events_url":"https://api.github.com/repos/giantswarm/route53-manager/events","assignees_url":"https://api.github.com/repos/giantswarm/route53-manager/assignees{/user}","branches_url":"https://api.github.com/repos/giantswarm/route53-manager/branches{/branch}","tags_url":"https://api.github.com/repos/giantswarm/route53-manager/tags","blobs_url":"https://api.github.com/repos/giantswarm/route53-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giantswarm/route53-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giantswarm/route53-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/giantswarm/route53-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giantswarm/route53-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/giantswarm/route53-manager/languages","stargazers_url":"https://api.github.com/repos/giantswarm/route53-manager/stargazers","contributors_url":"https://api.github.com/repos/giantswarm/route53-manager/contributors","subscribers_url":"https://api.github.com/repos/giantswarm/route53-manager/subscribers","subscription_url":"https://api.github.com/repos/giantswarm/route53-manager/subscription","commits_url":"https://api.github.com/repos/giantswarm/route53-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/giantswarm/route53-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/giantswarm/route53-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/giantswarm/route53-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/giantswarm/route53-manager/contents/{+path}","compare_url":"https://api.github.com/repos/giantswarm/route53-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giantswarm/route53-manager/merges","archive_url":"https://api.github.com/repos/giantswarm/route53-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giantswarm/route53-manager/downloads","issues_url":"https://api.github.com/repos/giantswarm/route53-manager/issues{/number}","pulls_url":"https://api.github.com/repos/giantswarm/route53-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/giantswarm/route53-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/giantswarm/route53-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giantswarm/route53-manager/labels{/name}","releases_url":"https://api.github.com/repos/giantswarm/route53-manager/releases{/id}","deployments_url":"https://api.github.com/repos/giantswarm/route53-manager/deployments","created_at":"2018-07-09T15:43:20Z","updated_at":"2019-12-26T13:04:54Z","pushed_at":"2019-12-26T16:09:16Z","git_url":"git://github.com/giantswarm/route53-manager.git","ssh_url":"git@github.com:giantswarm/route53-manager.git","clone_url":"https://github.com/giantswarm/route53-manager.git","svn_url":"https://github.com/giantswarm/route53-manager","homepage":null,"size":3390,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"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":1,"watchers":2,"default_branch":"master"}},"base":{"label":"giantswarm:master","ref":"master","sha":"fa2ae07a8b6c06f916d41aba5ab234c909cfbc9a","user":{"login":"giantswarm","id":7556340,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1NTYzNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7556340?v=4","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"repo":{"id":140307180,"node_id":"MDEwOlJlcG9zaXRvcnkxNDAzMDcxODA=","name":"route53-manager","full_name":"giantswarm/route53-manager","private":false,"owner":{"login":"giantswarm","id":7556340,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1NTYzNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7556340?v=4","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/giantswarm/route53-manager","description":null,"fork":false,"url":"https://api.github.com/repos/giantswarm/route53-manager","forks_url":"https://api.github.com/repos/giantswarm/route53-manager/forks","keys_url":"https://api.github.com/repos/giantswarm/route53-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giantswarm/route53-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giantswarm/route53-manager/teams","hooks_url":"https://api.github.com/repos/giantswarm/route53-manager/hooks","issue_events_url":"https://api.github.com/repos/giantswarm/route53-manager/issues/events{/number}","events_url":"https://api.github.com/repos/giantswarm/route53-manager/events","assignees_url":"https://api.github.com/repos/giantswarm/route53-manager/assignees{/user}","branches_url":"https://api.github.com/repos/giantswarm/route53-manager/branches{/branch}","tags_url":"https://api.github.com/repos/giantswarm/route53-manager/tags","blobs_url":"https://api.github.com/repos/giantswarm/route53-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giantswarm/route53-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giantswarm/route53-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/giantswarm/route53-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giantswarm/route53-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/giantswarm/route53-manager/languages","stargazers_url":"https://api.github.com/repos/giantswarm/route53-manager/stargazers","contributors_url":"https://api.github.com/repos/giantswarm/route53-manager/contributors","subscribers_url":"https://api.github.com/repos/giantswarm/route53-manager/subscribers","subscription_url":"https://api.github.com/repos/giantswarm/route53-manager/subscription","commits_url":"https://api.github.com/repos/giantswarm/route53-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/giantswarm/route53-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/giantswarm/route53-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/giantswarm/route53-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/giantswarm/route53-manager/contents/{+path}","compare_url":"https://api.github.com/repos/giantswarm/route53-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giantswarm/route53-manager/merges","archive_url":"https://api.github.com/repos/giantswarm/route53-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giantswarm/route53-manager/downloads","issues_url":"https://api.github.com/repos/giantswarm/route53-manager/issues{/number}","pulls_url":"https://api.github.com/repos/giantswarm/route53-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/giantswarm/route53-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/giantswarm/route53-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giantswarm/route53-manager/labels{/name}","releases_url":"https://api.github.com/repos/giantswarm/route53-manager/releases{/id}","deployments_url":"https://api.github.com/repos/giantswarm/route53-manager/deployments","created_at":"2018-07-09T15:43:20Z","updated_at":"2019-12-26T13:04:54Z","pushed_at":"2019-12-26T16:09:16Z","git_url":"git://github.com/giantswarm/route53-manager.git","ssh_url":"git@github.com:giantswarm/route53-manager.git","clone_url":"https://github.com/giantswarm/route53-manager.git","svn_url":"https://github.com/giantswarm/route53-manager","homepage":null,"size":3390,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"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":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/giantswarm/route53-manager/pulls/28"},"html":{"href":"https://github.com/giantswarm/route53-manager/pull/28"},"issue":{"href":"https://api.github.com/repos/giantswarm/route53-manager/issues/28"},"comments":{"href":"https://api.github.com/repos/giantswarm/route53-manager/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/giantswarm/route53-manager/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/giantswarm/route53-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/giantswarm/route53-manager/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/giantswarm/route53-manager/statuses/d5959b7e6354b29929b71ab7b650705e0ec44580"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rossf7"}}