{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/70694551","id":70694551,"diff_hunk":"@@ -41,26 +52,77 @@ func (rrsets ResourceRecordSets) List() ([]dnsprovider.ResourceRecordSet, error)\n \t}\n \tlist := make([]dnsprovider.ResourceRecordSet, len(response.ResourceRecordSets))\n \tfor i, rrset := range response.ResourceRecordSets {\n-\t\tlist[i] = &ResourceRecordSet{rrset, &rrsets}\n+\t\tlist[i] = ResourceRecordSet{rrset, &rrsets}\n \t}\n \treturn list, nil\n }\n \n-func (rrsets ResourceRecordSets) Add(rrset dnsprovider.ResourceRecordSet) (dnsprovider.ResourceRecordSet, error) {\n-\tservice := rrsets.zone.zones.interface_.service\n-\tinput := getChangeResourceRecordSetsInput(\"CREATE\", rrset.Name(), string(rrset.Type()), *rrset.(ResourceRecordSet).rrsets.zone.impl.Id, rrset.Rrdatas(), rrset.Ttl())\n-\t_, err := service.ChangeResourceRecordSets(input)\n-\tif err != nil {\n-\t\t// Cast err to awserr.Error to get the Code and\n-\t\t// Message from an error.\n-\t\treturn nil, err\n+func (r ResourceRecordSets) StartChangeset() dnsprovider.ResourceRecordChangeset {\n+\treturn &ResourceRecordChangeset{\n+\t\tzone:   r.zone,\n+\t\trrsets: &r,\n+\t}\n+}\n+\n+func (c *ResourceRecordChangeset) Add(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset {\n+\tc.additions = append(c.additions, rrset)\n+\treturn c\n+}\n+\n+func (c *ResourceRecordChangeset) Remove(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset {\n+\tc.removals = append(c.removals, rrset)\n+\treturn c\n+}\n+\n+// buildRoute53Change converts a dnsprovider.ResourceRecordSet to a route53.Change request\n+func buildRoute53Change(action string, rrs dnsprovider.ResourceRecordSet) *route53.Change {\n+\tchange := &route53.Change{\n+\t\tAction: aws.String(action),\n+\t\tResourceRecordSet: &route53.ResourceRecordSet{\n+\t\t\tName: aws.String(rrs.Name()),\n+\t\t\tType: aws.String(string(rrs.Type())),\n+\t\t\tTTL:  aws.Int64(rrs.Ttl()),\n+\t\t},\n+\t}\n+\n+\tfor _, rrdata := range rrs.Rrdatas() {\n+\t\trr := &route53.ResourceRecord{\n+\t\t\tValue: aws.String(rrdata),\n+\t\t}\n+\t\tchange.ResourceRecordSet.ResourceRecords = append(change.ResourceRecordSet.ResourceRecords, rr)\n \t}\n-\treturn ResourceRecordSet{input.ChangeBatch.Changes[0].ResourceRecordSet, &rrsets}, nil\n+\treturn change\n }\n \n-func (rrsets ResourceRecordSets) Remove(rrset dnsprovider.ResourceRecordSet) error {\n-\tinput := getChangeResourceRecordSetsInput(\"DELETE\", rrset.Name(), string(rrset.Type()), *rrset.(ResourceRecordSet).rrsets.zone.impl.Id, rrset.Rrdatas(), rrset.Ttl())\n-\t_, err := rrsets.zone.zones.interface_.service.ChangeResourceRecordSets(input)\n+func (c *ResourceRecordChangeset) Apply() error {\n+\thostedZoneID := c.zone.impl.Id\n+\n+\tvar changes []*route53.Change\n+\n+\tfor _, removal := range c.removals {\n+\t\tchange := buildRoute53Change(\"DELETE\", removal)","path":"federation/pkg/dnsprovider/providers/aws/route53/rrsets.go","position":91,"original_position":91,"commit_id":"dd54223dfe542dfd4b7546417407eb4c5869fe65","original_commit_id":"dd54223dfe542dfd4b7546417407eb4c5869fe65","user":{"login":"quinton-hoole","id":10390785,"avatar_url":"https://avatars.githubusercontent.com/u/10390785?v=3","gravatar_id":"","url":"https://api.github.com/users/quinton-hoole","html_url":"https://github.com/quinton-hoole","followers_url":"https://api.github.com/users/quinton-hoole/followers","following_url":"https://api.github.com/users/quinton-hoole/following{/other_user}","gists_url":"https://api.github.com/users/quinton-hoole/gists{/gist_id}","starred_url":"https://api.github.com/users/quinton-hoole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quinton-hoole/subscriptions","organizations_url":"https://api.github.com/users/quinton-hoole/orgs","repos_url":"https://api.github.com/users/quinton-hoole/repos","events_url":"https://api.github.com/users/quinton-hoole/events{/privacy}","received_events_url":"https://api.github.com/users/quinton-hoole/received_events","type":"User","site_admin":false},"body":"I will admit to having an irrational hatred for string literals buried deep in code :-)","created_at":"2016-07-13T19:43:26Z","updated_at":"2016-07-13T19:43:26Z","html_url":"https://github.com/kubernetes/kubernetes/pull/28668#discussion_r70694551","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28668","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/70694551"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/28668#discussion_r70694551"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28668"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28668","id":76707538,"html_url":"https://github.com/kubernetes/kubernetes/pull/28668","diff_url":"https://github.com/kubernetes/kubernetes/pull/28668.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/28668.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28668","number":28668,"state":"open","locked":false,"title":"Expose Changesets (transactions) in dns provider","user":{"login":"justinsb","id":100893,"avatar_url":"https://avatars.githubusercontent.com/u/100893?v=3","gravatar_id":"","url":"https://api.github.com/users/justinsb","html_url":"https://github.com/justinsb","followers_url":"https://api.github.com/users/justinsb/followers","following_url":"https://api.github.com/users/justinsb/following{/other_user}","gists_url":"https://api.github.com/users/justinsb/gists{/gist_id}","starred_url":"https://api.github.com/users/justinsb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinsb/subscriptions","organizations_url":"https://api.github.com/users/justinsb/orgs","repos_url":"https://api.github.com/users/justinsb/repos","events_url":"https://api.github.com/users/justinsb/events{/privacy}","received_events_url":"https://api.github.com/users/justinsb/received_events","type":"User","site_admin":false},"body":"This makes the dnsprovider usable in more scenarios, and it also solves\r\nsome TODOs in the federation code.\r\n\r\nWIP  - I'm going to test this to make sure this both works and is sufficient for use in my dns controller, but I wanted to put some code behind the talk in #28477.  cc @quinton-hoole \r\n\r\nIssue #28477","created_at":"2016-07-08T06:34:11Z","updated_at":"2016-07-13T19:43:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f1645824c407de5e938a7b74fd6b41decaee9aa","assignee":{"login":"quinton-hoole","id":10390785,"avatar_url":"https://avatars.githubusercontent.com/u/10390785?v=3","gravatar_id":"","url":"https://api.github.com/users/quinton-hoole","html_url":"https://github.com/quinton-hoole","followers_url":"https://api.github.com/users/quinton-hoole/followers","following_url":"https://api.github.com/users/quinton-hoole/following{/other_user}","gists_url":"https://api.github.com/users/quinton-hoole/gists{/gist_id}","starred_url":"https://api.github.com/users/quinton-hoole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quinton-hoole/subscriptions","organizations_url":"https://api.github.com/users/quinton-hoole/orgs","repos_url":"https://api.github.com/users/quinton-hoole/repos","events_url":"https://api.github.com/users/quinton-hoole/events{/privacy}","received_events_url":"https://api.github.com/users/quinton-hoole/received_events","type":"User","site_admin":false},"assignees":[{"login":"quinton-hoole","id":10390785,"avatar_url":"https://avatars.githubusercontent.com/u/10390785?v=3","gravatar_id":"","url":"https://api.github.com/users/quinton-hoole","html_url":"https://github.com/quinton-hoole","followers_url":"https://api.github.com/users/quinton-hoole/followers","following_url":"https://api.github.com/users/quinton-hoole/following{/other_user}","gists_url":"https://api.github.com/users/quinton-hoole/gists{/gist_id}","starred_url":"https://api.github.com/users/quinton-hoole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quinton-hoole/subscriptions","organizations_url":"https://api.github.com/users/quinton-hoole/orgs","repos_url":"https://api.github.com/users/quinton-hoole/repos","events_url":"https://api.github.com/users/quinton-hoole/events{/privacy}","received_events_url":"https://api.github.com/users/quinton-hoole/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28668/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28668/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28668/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/dd54223dfe542dfd4b7546417407eb4c5869fe65","head":{"label":"justinsb:update_dns","ref":"update_dns","sha":"dd54223dfe542dfd4b7546417407eb4c5869fe65","user":{"login":"justinsb","id":100893,"avatar_url":"https://avatars.githubusercontent.com/u/100893?v=3","gravatar_id":"","url":"https://api.github.com/users/justinsb","html_url":"https://github.com/justinsb","followers_url":"https://api.github.com/users/justinsb/followers","following_url":"https://api.github.com/users/justinsb/following{/other_user}","gists_url":"https://api.github.com/users/justinsb/gists{/gist_id}","starred_url":"https://api.github.com/users/justinsb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinsb/subscriptions","organizations_url":"https://api.github.com/users/justinsb/orgs","repos_url":"https://api.github.com/users/justinsb/repos","events_url":"https://api.github.com/users/justinsb/events{/privacy}","received_events_url":"https://api.github.com/users/justinsb/received_events","type":"User","site_admin":false},"repo":{"id":26103010,"name":"kubernetes","full_name":"justinsb/kubernetes","owner":{"login":"justinsb","id":100893,"avatar_url":"https://avatars.githubusercontent.com/u/100893?v=3","gravatar_id":"","url":"https://api.github.com/users/justinsb","html_url":"https://github.com/justinsb","followers_url":"https://api.github.com/users/justinsb/followers","following_url":"https://api.github.com/users/justinsb/following{/other_user}","gists_url":"https://api.github.com/users/justinsb/gists{/gist_id}","starred_url":"https://api.github.com/users/justinsb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinsb/subscriptions","organizations_url":"https://api.github.com/users/justinsb/orgs","repos_url":"https://api.github.com/users/justinsb/repos","events_url":"https://api.github.com/users/justinsb/events{/privacy}","received_events_url":"https://api.github.com/users/justinsb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/justinsb/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/justinsb/kubernetes","forks_url":"https://api.github.com/repos/justinsb/kubernetes/forks","keys_url":"https://api.github.com/repos/justinsb/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/justinsb/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/justinsb/kubernetes/teams","hooks_url":"https://api.github.com/repos/justinsb/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/justinsb/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/justinsb/kubernetes/events","assignees_url":"https://api.github.com/repos/justinsb/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/justinsb/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/justinsb/kubernetes/tags","blobs_url":"https://api.github.com/repos/justinsb/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/justinsb/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/justinsb/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/justinsb/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/justinsb/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/justinsb/kubernetes/languages","stargazers_url":"https://api.github.com/repos/justinsb/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/justinsb/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/justinsb/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/justinsb/kubernetes/subscription","commits_url":"https://api.github.com/repos/justinsb/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/justinsb/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/justinsb/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/justinsb/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/justinsb/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/justinsb/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/justinsb/kubernetes/merges","archive_url":"https://api.github.com/repos/justinsb/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/justinsb/kubernetes/downloads","issues_url":"https://api.github.com/repos/justinsb/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/justinsb/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/justinsb/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/justinsb/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/justinsb/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/justinsb/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/justinsb/kubernetes/deployments","created_at":"2014-11-03T03:53:05Z","updated_at":"2015-12-02T03:20:46Z","pushed_at":"2016-07-13T05:05:36Z","git_url":"git://github.com/justinsb/kubernetes.git","ssh_url":"git@github.com:justinsb/kubernetes.git","clone_url":"https://github.com/justinsb/kubernetes.git","svn_url":"https://github.com/justinsb/kubernetes","homepage":null,"size":276055,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"708e753c7295d821f95205c39c6c6fbf8028ef95","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-07-13T19:42:08Z","pushed_at":"2016-07-13T19:37:51Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":490524,"stargazers_count":15500,"watchers_count":15500,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4864,"mirror_url":null,"open_issues_count":3929,"forks":4864,"open_issues":3929,"watchers":15500,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28668"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/28668"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/28668"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/28668/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28668/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28668/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/dd54223dfe542dfd4b7546417407eb4c5869fe65"}}}}
{"actor":{"display_login":"quinton-hoole"}}