From 98232b0933deca551bf6bffb39763b3aee115cff Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Thu, 20 Jun 2019 08:34:36 -0400 Subject: [PATCH] BUG: R53_ALIAS false positive during duplicate checking (#505) --- models/target.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/models/target.go b/models/target.go index 9e46a9552..dca5be589 100644 --- a/models/target.go +++ b/models/target.go @@ -47,9 +47,16 @@ func (rc *RecordConfig) GetTargetIP() net.IP { // GetTargetCombined returns a string with the various fields combined. // For example, an MX record might output `10 mx10.example.tld`. func (rc *RecordConfig) GetTargetCombined() string { - // If this is a pseudo record, just return the target. + // Pseudo records: if _, ok := dns.StringToType[rc.Type]; !ok { - return rc.Target + switch rc.Type { // #rtype_variations + case "R53_ALIAS": + // Differentiate between multiple R53_ALIASs on the same label. + return fmt.Sprintf("%s type=%s zone_id=%s", rc.Target, rc.R53Alias["type"], rc.R53Alias["zone_id"]) + default: + // Just return the target. + return rc.Target + } } // We cheat by converting to a dns.RR and use the String() function.