type SDPublisher struct {
AdvertiseHost string
+ SRVHost string
AdvertisePort uint16
Domain string
Protocol Layer4Protocol
errors := make([]string, 0)
+ if s.SRVHost == "" {
+ if s.AdvertiseHost != "" {
+ s.SRVHost = s.AdvertiseHost
+ } else {
+ if hostname.Containerization() == hostname.ContainerKubernetes {
+ s.SRVHost = fmt.Sprintf("%s.%s.%s", hostname.Hostname(), s.Service, constants.SDDomain)
+ } else {
+ s.SRVHost = hostname.Fqdn()
+ }
+ }
+ }
+
if s.AdvertiseHost == "" {
s.AdvertiseHost = hostname.Fqdn()
}
prio = 10
}
recordValue, _ := json.Marshal(srvRecord{
- Host: s.AdvertiseHost,
+ Host: s.SRVHost,
Port: s.AdvertisePort,
Priority: prio,
TTL: uint(leaseRenewalInterval),