Skip to content

Commit

Permalink
GCLOUD: display all correction messages affecting same label + type i…
Browse files Browse the repository at this point in the history
…n a zone (StackExchange#2759)
  • Loading branch information
asn-iac authored Jan 3, 2024
1 parent 4270259 commit b71fd63
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions providers/gcloud/gcloudProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,25 @@ func (g *gcloudProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, exis

changedKeys := map[key]string{}
for _, c := range create {
changedKeys[keyForRec(c.Desired)] = fmt.Sprintln(c)
msg := fmt.Sprintln(c)
if k, ok := changedKeys[keyForRec(c.Desired)]; ok {
msg = strings.Join([]string{k, msg}, "")
}
changedKeys[keyForRec(c.Desired)] = msg
}
for _, d := range toDelete {
changedKeys[keyForRec(d.Existing)] = fmt.Sprintln(d)
msg := fmt.Sprintln(d)
if k, ok := changedKeys[keyForRec(d.Existing)]; ok {
msg = strings.Join([]string{k, msg}, "")
}
changedKeys[keyForRec(d.Existing)] = msg
}
for _, m := range modify {
changedKeys[keyForRec(m.Existing)] = fmt.Sprintln(m)
msg := fmt.Sprintln(m)
if k, ok := changedKeys[keyForRec(m.Existing)]; ok {
msg = strings.Join([]string{k, msg}, "")
}
changedKeys[keyForRec(m.Existing)] = msg
}
if len(changedKeys) == 0 {
return nil, nil
Expand Down

0 comments on commit b71fd63

Please sign in to comment.