registry/mdns: fix deregister bug (#1771)

* registry/mdns: fix deregister bug

* Update registry/mdns_registry.go

Co-authored-by: Dominic Wong <domwongemail@googlemail.com>
This commit is contained in:
ben-toogood 2020-07-01 11:09:20 +01:00 committed by GitHub
parent 979af853b9
commit 1b5c83f3cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -359,6 +359,11 @@ func (m *mdnsRegistry) Deregister(service *Service, opts ...DeregisterOption) er
} }
} }
// we have no new entries, we can exit
if len(newEntries) == 0 {
return nil
}
// we have more than one entry remaining, we can exit // we have more than one entry remaining, we can exit
if len(newEntries) > 1 { if len(newEntries) > 1 {
m.domains[options.Domain][service.Name] = newEntries m.domains[options.Domain][service.Name] = newEntries