checker: build owner FQDN from _domain subdomain label + apex
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e85d06d6cd
commit
355f2b92eb
1 changed files with 11 additions and 8 deletions
|
|
@ -318,9 +318,7 @@ func defaultResolveHost(ctx context.Context, target string) (verdict, detail str
|
||||||
|
|
||||||
// ownerFQDN returns the record owner FQDN, preferring the service's _domain field over subdomain+apex.
|
// ownerFQDN returns the record owner FQDN, preferring the service's _domain field over subdomain+apex.
|
||||||
func ownerFQDN(svcDomain, sub, apex string) string {
|
func ownerFQDN(svcDomain, sub, apex string) string {
|
||||||
if svcDomain != "" {
|
fallback := func() string {
|
||||||
return strings.TrimSuffix(svcDomain, ".")
|
|
||||||
}
|
|
||||||
if apex == "" {
|
if apex == "" {
|
||||||
return sub
|
return sub
|
||||||
}
|
}
|
||||||
|
|
@ -329,6 +327,11 @@ func ownerFQDN(svcDomain, sub, apex string) string {
|
||||||
}
|
}
|
||||||
return sub + "." + apex
|
return sub + "." + apex
|
||||||
}
|
}
|
||||||
|
if svcDomain == "" {
|
||||||
|
return fallback()
|
||||||
|
}
|
||||||
|
return preferRRName(svcDomain, fallback(), apex)
|
||||||
|
}
|
||||||
|
|
||||||
// preferRRName returns the RR header Name as an FQDN when present.
|
// preferRRName returns the RR header Name as an FQDN when present.
|
||||||
// happyDomain encodes service-embedded record owners relative to the zone
|
// happyDomain encodes service-embedded record owners relative to the zone
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue