mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-07 21:54:59 +08:00
Route53 provider: pass the right correction message based on action (#151)
This commit is contained in:
parent
8b3bc9e5e6
commit
d1fba2c236
1 changed files with 7 additions and 4 deletions
|
@ -224,14 +224,15 @@ func (r *route53Provider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
|
|||
changeReq := &r53.ChangeResourceRecordSetsInput{
|
||||
ChangeBatch: &r53.ChangeBatch{Changes: changes},
|
||||
}
|
||||
|
||||
delReq := &r53.ChangeResourceRecordSetsInput{
|
||||
ChangeBatch: &r53.ChangeBatch{Changes: dels},
|
||||
}
|
||||
|
||||
addCorrection := func(req *r53.ChangeResourceRecordSetsInput) {
|
||||
addCorrection := func(msg string, req *r53.ChangeResourceRecordSetsInput) {
|
||||
corrections = append(corrections,
|
||||
&models.Correction{
|
||||
Msg: changeDesc,
|
||||
Msg: msg,
|
||||
F: func() error {
|
||||
req.HostedZoneId = zone.Id
|
||||
_, err := r.client.ChangeResourceRecordSets(req)
|
||||
|
@ -239,11 +240,13 @@ func (r *route53Provider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
|
|||
},
|
||||
})
|
||||
}
|
||||
|
||||
if len(dels) > 0 {
|
||||
addCorrection(delReq)
|
||||
addCorrection(delDesc, delReq)
|
||||
}
|
||||
|
||||
if len(changes) > 0 {
|
||||
addCorrection(changeReq)
|
||||
addCorrection(changeDesc, changeReq)
|
||||
}
|
||||
|
||||
return corrections, nil
|
||||
|
|
Loading…
Add table
Reference in a new issue