@@ -221,13 +221,7 @@ func (c *route53Client) computeChanges(name string, records map[string]string, e
221
221
}
222
222
records = lrecords
223
223
224
- var (
225
- changes []types.Change
226
- inserts int
227
- upserts int
228
- skips int
229
- )
230
-
224
+ var changes []types.Change
231
225
for path , newValue := range records {
232
226
prevRecords , exists := existing [path ]
233
227
prevValue := strings .Join (prevRecords .values , "" )
@@ -243,30 +237,20 @@ func (c *route53Client) computeChanges(name string, records map[string]string, e
243
237
244
238
if ! exists {
245
239
// Entry is unknown, push a new one
246
- log .Debug (fmt .Sprintf ("Creating %s = %s" , path , newValue ))
240
+ log .Info (fmt .Sprintf ("Creating %s = %s" , path , newValue ))
247
241
changes = append (changes , newTXTChange ("CREATE" , path , ttl , newValue ))
248
- inserts ++
249
242
} else if prevValue != newValue || prevRecords .ttl != ttl {
250
243
// Entry already exists, only change its content.
251
244
log .Info (fmt .Sprintf ("Updating %s from %s to %s" , path , prevValue , newValue ))
252
245
changes = append (changes , newTXTChange ("UPSERT" , path , ttl , newValue ))
253
- upserts ++
254
246
} else {
255
247
log .Debug (fmt .Sprintf ("Skipping %s = %s" , path , newValue ))
256
- skips ++
257
248
}
258
249
}
259
250
260
251
// Iterate over the old records and delete anything stale.
261
- deletions := makeDeletionChanges (existing , records )
262
- changes = append (changes , deletions ... )
263
-
264
- log .Info ("Computed DNS changes" ,
265
- "changes" , len (changes ),
266
- "inserts" , inserts ,
267
- "skips" , skips ,
268
- "deleted" , len (deletions ),
269
- "upserts" , upserts )
252
+ changes = append (changes , makeDeletionChanges (existing , records )... )
253
+
270
254
// Ensure changes are in the correct order.
271
255
sortChanges (changes )
272
256
return changes
@@ -279,7 +263,7 @@ func makeDeletionChanges(records map[string]recordSet, keep map[string]string) [
279
263
if _ , ok := keep [path ]; ok {
280
264
continue
281
265
}
282
- log .Debug (fmt .Sprintf ("Deleting %s = %s" , path , strings .Join (set .values , "" )))
266
+ log .Info (fmt .Sprintf ("Deleting %s = %s" , path , strings .Join (set .values , "" )))
283
267
changes = append (changes , newTXTChange ("DELETE" , path , set .ttl , set .values ... ))
284
268
}
285
269
return changes
0 commit comments