Skip to content

Commit

Permalink
change the order
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerKahani committed May 12, 2020
1 parent 2ef1503 commit 231fbea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions provider/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 231fbea

Please sign in to comment.