We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7e8f939 + 2b5c0ae commit c809249Copy full SHA for c809249
main.go
@@ -213,9 +213,19 @@ func toDiscoveryPort(entry *mdns.ServiceEntry) *discovery.Port {
213
}
214
215
216
+ var name string
217
+ if split := strings.Split(entry.Host, "."); len(split) > 0 {
218
+ // Use the first part of the entry host name to display
219
+ // the address label
220
+ name = split[0]
221
+ } else {
222
+ // Fallback
223
+ name = entry.Name
224
+ }
225
+
226
return &discovery.Port{
227
Address: ip,
- AddressLabel: fmt.Sprintf("%s at %s", entry.Name, ip),
228
+ AddressLabel: fmt.Sprintf("%s at %s", name, ip),
229
Protocol: "network",
230
ProtocolLabel: "Network Port",
231
Properties: props,
0 commit comments