mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
NEW FEATURE: NO_PURGE reports what is not purged (diff2 only) (#2031)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package diff
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/StackExchange/dnscontrol/v3/models"
|
||||
"github.com/StackExchange/dnscontrol/v3/pkg/diff2"
|
||||
)
|
||||
@@ -62,6 +64,9 @@ func (d *differCompat) IncrementalDiff(existing []*models.RecordConfig) (unchang
|
||||
for _, inst := range instructions {
|
||||
cor := Correlation{d: d.OldDiffer}
|
||||
switch inst.Type {
|
||||
case diff2.REPORT:
|
||||
// Sadly the NewCompat function doesn't have a way to do this.
|
||||
// Purge reports are silently skipped.
|
||||
case diff2.CREATE:
|
||||
cor.Desired = inst.New[0]
|
||||
create = append(create, cor)
|
||||
@@ -72,6 +77,8 @@ func (d *differCompat) IncrementalDiff(existing []*models.RecordConfig) (unchang
|
||||
case diff2.DELETE:
|
||||
cor.Existing = inst.Old[0]
|
||||
toDelete = append(toDelete, cor)
|
||||
default:
|
||||
panic(fmt.Sprintf("unhandled inst.Type %s", inst.Type))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user