Skip to content

Commit

Permalink
Broadcast container name as name of service
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested committed Jan 5, 2021
1 parent 002801c commit 5fd41e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion container.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func handleContainer(

hostname = rewriteHostname(ctx, hostname)

addToDNS(eg, hostname, ips, services)
addToDNS(eg, hostname, ips, services, container.Name[1:])
}

// extractIPnumbers from a container.
Expand Down
4 changes: 2 additions & 2 deletions dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/holoplot/go-avahi"
)

func addToDNS(eg *avahi.EntryGroup, hostname string, ips []string, services map[string]uint16) {
func addToDNS(eg *avahi.EntryGroup, hostname string, ips []string, services map[string]uint16, name string) {
if hostname == "" {
return
}
Expand All @@ -29,7 +29,7 @@ func addToDNS(eg *avahi.EntryGroup, hostname string, ips []string, services map[
int32(net.FlagLoopback),
avahi.ProtoInet,
0,
hostname,
name,
service,
"local",
hostname,
Expand Down

0 comments on commit 5fd41e7

Please sign in to comment.