BUG: R53_ALIAS false positive during duplicate checking (#505)

This commit is contained in:
Tom Limoncelli 2019-06-20 08:34:36 -04:00 committed by GitHub
parent 2d9d93653b
commit 98232b0933
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.