From 231fbeafcb5630e7a4b14a1459baac3fb985743b Mon Sep 17 00:00:00 2001 From: Omer Kahani Date: Tue, 5 May 2020 16:49:00 +0300 Subject: [PATCH] change the order --- provider/aws/aws.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 91961c9e1f..d69f2eb2f8 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -589,7 +589,8 @@ func (p *AWSProvider) tagsForZone(ctx context.Context, zoneID string) (map[strin func batchChangeSet(cs []*route53.Change, batchSize int) [][]*route53.Change { if len(cs) <= batchSize { - return [][]*route53.Change{cs} + res := sortChangesByActionNameType(cs) + return [][]*route53.Change{res} } batchChanges := make([][]*route53.Change, 0) @@ -636,10 +637,10 @@ func batchChangeSet(cs []*route53.Change, batchSize int) [][]*route53.Change { func sortChangesByActionNameType(cs []*route53.Change) []*route53.Change { sort.SliceStable(cs, func(i, j int) bool { - if *cs[i].Action < *cs[j].Action { + if *cs[i].Action > *cs[j].Action { return true } - if *cs[i].Action > *cs[j].Action { + if *cs[i].Action < *cs[j].Action { return false } if *cs[i].ResourceRecordSet.Name < *cs[j].ResourceRecordSet.Name {