1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

fix for deleting wildcard from r53. includes failing integration test

This commit is contained in:
Craig Peterson
2018-03-01 10:09:02 -05:00
parent 43dc9ac92f
commit 19ca760072
2 changed files with 4 additions and 4 deletions

View File

@ -338,6 +338,8 @@ func makeTests(t *testing.T) []*TestCase {
tc("Delete one", a("@", "1.2.3.4").ttl(500), a("www", "5.6.7.8").ttl(400)), tc("Delete one", a("@", "1.2.3.4").ttl(500), a("www", "5.6.7.8").ttl(400)),
tc("Add back and change ttl", a("www", "5.6.7.8").ttl(700), a("www", "1.2.3.4").ttl(700)), tc("Add back and change ttl", a("www", "5.6.7.8").ttl(700), a("www", "1.2.3.4").ttl(700)),
tc("Change targets and ttls", a("www", "1.1.1.1"), a("www", "2.2.2.2")), tc("Change targets and ttls", a("www", "1.1.1.1"), a("www", "2.2.2.2")),
tc("Create wildcard", a("*", "1.2.3.4"), a("www", "1.1.1.1")),
tc("Delete wildcard", a("www", "1.1.1.1")),
// CNAMES // CNAMES
tc("Empty"), tc("Empty"),

View File

@ -81,9 +81,7 @@ func (r *route53Provider) getZones() error {
var nextMarker *string var nextMarker *string
r.zones = make(map[string]*r53.HostedZone) r.zones = make(map[string]*r53.HostedZone)
for { for {
if nextMarker != nil {
fmt.Println(*nextMarker)
}
inp := &r53.ListHostedZonesInput{Marker: nextMarker} inp := &r53.ListHostedZonesInput{Marker: nextMarker}
out, err := r.client.ListHostedZones(inp) out, err := r.client.ListHostedZones(inp)
if err != nil && strings.Contains(err.Error(), "is not authorized") { if err != nil && strings.Contains(err.Error(), "is not authorized") {
@ -212,7 +210,7 @@ func (r *route53Provider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
delDesc += strings.Join(namesToUpdate[k], "\n") + "\n" delDesc += strings.Join(namesToUpdate[k], "\n") + "\n"
// on delete just submit the original resource set we got from r53. // on delete just submit the original resource set we got from r53.
for _, r := range records { for _, r := range records {
if *r.Name == k.Name+"." && (*r.Type == k.Type || k.Type == "R53_ALIAS") { if unescape(r.Name) == k.Name && (*r.Type == k.Type || k.Type == "R53_ALIAS") {
rrset = r rrset = r
break break
} }