mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-05 17:16:59 +02:00
fix(idna): fix handling of domains
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
This commit is contained in:
parent
e9ec3acdaa
commit
474d5b3600
@ -734,58 +734,57 @@ func (p *AWSProvider) submitChanges(ctx context.Context, changes Route53Changes,
|
|||||||
log.Infof("Desired change: %s %s %s", c.Action, *c.ResourceRecordSet.Name, c.ResourceRecordSet.Type)
|
log.Infof("Desired change: %s %s %s", c.Action, *c.ResourceRecordSet.Name, c.ResourceRecordSet.Type)
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.dryRun {
|
if !p.dryRun {
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
params := &route53.ChangeResourceRecordSetsInput{
|
params := &route53.ChangeResourceRecordSetsInput{
|
||||||
HostedZoneId: aws.String(z),
|
HostedZoneId: aws.String(z),
|
||||||
ChangeBatch: &route53types.ChangeBatch{
|
ChangeBatch: &route53types.ChangeBatch{
|
||||||
Changes: b.Route53Changes(),
|
Changes: b.Route53Changes(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
successfulChanges := 0
|
successfulChanges := 0
|
||||||
|
|
||||||
client := p.clients[zones[z].profile]
|
client := p.clients[zones[z].profile]
|
||||||
if _, err := client.ChangeResourceRecordSets(ctx, params); err != nil {
|
if _, err := client.ChangeResourceRecordSets(ctx, params); err != nil {
|
||||||
log.Errorf("Failure in zone %s when submitting change batch: %v", *zones[z].zone.Name, err)
|
log.Errorf("Failure in zone %s when submitting change batch: %v", *zones[z].zone.Name, err)
|
||||||
|
|
||||||
changesByOwnership := groupChangesByNameAndOwnershipRelation(b)
|
changesByOwnership := groupChangesByNameAndOwnershipRelation(b)
|
||||||
|
|
||||||
if len(changesByOwnership) > 1 {
|
if len(changesByOwnership) > 1 {
|
||||||
log.Debug("Trying to submit change sets one-by-one instead")
|
log.Debug("Trying to submit change sets one-by-one instead")
|
||||||
for _, changes := range changesByOwnership {
|
for _, changes := range changesByOwnership {
|
||||||
if log.Logger.IsLevelEnabled(debugLevel) {
|
if log.Logger.IsLevelEnabled(debugLevel) {
|
||||||
for _, c := range changes {
|
for _, c := range changes {
|
||||||
log.Debugf("Desired change: %s %s %s", c.Action, *c.ResourceRecordSet.Name, c.ResourceRecordSet.Type)
|
log.Debugf("Desired change: %s %s %s", c.Action, *c.ResourceRecordSet.Name, c.ResourceRecordSet.Type)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
params.ChangeBatch = &route53types.ChangeBatch{
|
||||||
|
Changes: changes.Route53Changes(),
|
||||||
|
}
|
||||||
|
if _, err := client.ChangeResourceRecordSets(ctx, params); err != nil {
|
||||||
|
failedUpdate = true
|
||||||
|
log.Errorf("Failed submitting change (error: %v), it will be retried in a separate change batch in the next iteration", err)
|
||||||
|
p.failedChangesQueue[z] = append(p.failedChangesQueue[z], changes...)
|
||||||
|
} else {
|
||||||
|
successfulChanges = successfulChanges + len(changes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
params.ChangeBatch = &route53types.ChangeBatch{
|
} else {
|
||||||
Changes: changes.Route53Changes(),
|
failedUpdate = true
|
||||||
}
|
|
||||||
if _, err := client.ChangeResourceRecordSets(ctx, params); err != nil {
|
|
||||||
failedUpdate = true
|
|
||||||
log.Errorf("Failed submitting change (error: %v), it will be retried in a separate change batch in the next iteration", err)
|
|
||||||
p.failedChangesQueue[z] = append(p.failedChangesQueue[z], changes...)
|
|
||||||
} else {
|
|
||||||
successfulChanges = successfulChanges + len(changes)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
failedUpdate = true
|
successfulChanges = len(b)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
successfulChanges = len(b)
|
|
||||||
}
|
|
||||||
|
|
||||||
if successfulChanges > 0 {
|
if successfulChanges > 0 {
|
||||||
// z is the R53 Hosted Zone ID already as aws.StringValue
|
// z is the R53 Hosted Zone ID already as aws.StringValue
|
||||||
log.Infof("%d record(s) were successfully updated", successfulChanges)
|
log.Infof("%d record(s) were successfully updated", successfulChanges)
|
||||||
}
|
}
|
||||||
|
|
||||||
if i != len(batchCs)-1 {
|
if i != len(batchCs)-1 {
|
||||||
time.Sleep(p.batchChangeInterval)
|
time.Sleep(p.batchChangeInterval)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user