mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Route53 provider: pass the right correction message based on action (#151)
This commit is contained in:
committed by
Tom Limoncelli
parent
8b3bc9e5e6
commit
d1fba2c236
@ -224,14 +224,15 @@ func (r *route53Provider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
|
|||||||
changeReq := &r53.ChangeResourceRecordSetsInput{
|
changeReq := &r53.ChangeResourceRecordSetsInput{
|
||||||
ChangeBatch: &r53.ChangeBatch{Changes: changes},
|
ChangeBatch: &r53.ChangeBatch{Changes: changes},
|
||||||
}
|
}
|
||||||
|
|
||||||
delReq := &r53.ChangeResourceRecordSetsInput{
|
delReq := &r53.ChangeResourceRecordSetsInput{
|
||||||
ChangeBatch: &r53.ChangeBatch{Changes: dels},
|
ChangeBatch: &r53.ChangeBatch{Changes: dels},
|
||||||
}
|
}
|
||||||
|
|
||||||
addCorrection := func(req *r53.ChangeResourceRecordSetsInput) {
|
addCorrection := func(msg string, req *r53.ChangeResourceRecordSetsInput) {
|
||||||
corrections = append(corrections,
|
corrections = append(corrections,
|
||||||
&models.Correction{
|
&models.Correction{
|
||||||
Msg: changeDesc,
|
Msg: msg,
|
||||||
F: func() error {
|
F: func() error {
|
||||||
req.HostedZoneId = zone.Id
|
req.HostedZoneId = zone.Id
|
||||||
_, err := r.client.ChangeResourceRecordSets(req)
|
_, err := r.client.ChangeResourceRecordSets(req)
|
||||||
@ -239,11 +240,13 @@ func (r *route53Provider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(dels) > 0 {
|
if len(dels) > 0 {
|
||||||
addCorrection(delReq)
|
addCorrection(delDesc, delReq)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(changes) > 0 {
|
if len(changes) > 0 {
|
||||||
addCorrection(changeReq)
|
addCorrection(changeDesc, changeReq)
|
||||||
}
|
}
|
||||||
|
|
||||||
return corrections, nil
|
return corrections, nil
|
||||||
|
Reference in New Issue
Block a user