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

BUG: diff2: ttl changes don't always work (#2093)

This commit is contained in:
Tom Limoncelli
2023-02-25 22:40:54 -05:00
committed by GitHub
parent ab872cc13f
commit 05dc26bf2e
8 changed files with 151 additions and 101 deletions

View File

@@ -307,6 +307,8 @@ func (rc *RecordConfig) GetLabelFQDN() string {
// ToDiffable returns a string that is comparable by a differ.
// extraMaps: a list of maps that should be included in the comparison.
// NB(tlim): This will be deprecated when pkg/diff is replaced by pkg/diff2.
// Use // ToComparableNoTTL() instead.
func (rc *RecordConfig) ToDiffable(extraMaps ...map[string]string) string {
var content string
switch rc.Type {
@@ -337,6 +339,16 @@ func (rc *RecordConfig) ToDiffable(extraMaps ...map[string]string) string {
return content
}
// ToComparableNoTTL returns a comparison string. If you need to compare two
// RecordConfigs, you can simply compare the string returned by this function.
// THe comparison includes all fields except TTL and any provider-specific
// metafields. Provider-specific metafields like CF_PROXY are not the same as
// pseudo-records like ANAME or R53_ALIAS
// This replaces ToDiff()
func (rc *RecordConfig) ToComparableNoTTL() string {
return rc.GetTargetCombined()
}
// ToRR converts a RecordConfig to a dns.RR.
func (rc *RecordConfig) ToRR() dns.RR {