1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

diff2: Add a "hints" when change is TTL-only (#2249)

Co-authored-by: Tom Limoncelli <tal@whatexit.org>
This commit is contained in:
Tom Limoncelli
2023-03-29 11:34:10 -07:00
committed by GitHub
parent 6ac1961341
commit f676c4956e
3 changed files with 12 additions and 3 deletions

View File

@ -39,6 +39,10 @@ type Change struct {
Msgs []string // Human-friendly explanation of what changed
MsgsJoined string // strings.Join(Msgs, "\n")
MsgsByKey map[models.RecordKey][]string // Messages for a given key
// HintOnlyTTL is true only if (.Type == diff2.CHANGE) && (there is
// exactly 1 record being updated) && (the only change is the TTL)
HintOnlyTTL bool
}
/*
@ -223,6 +227,9 @@ func (c Change) String() string {
fmt.Fprintf(b, "Change: verb=%v\n", c.Type)
fmt.Fprintf(b, " key=%v\n", c.Key)
if c.HintOnlyTTL {
fmt.Fprint(b, " Hints=OnlyTTL\n", c.Key)
}
if len(c.Old) != 0 {
fmt.Fprintf(b, " old=%v\n", c.Old)
}