libnetwork: drop vestigial endpoint-rename logic
The logic to rename an endpoint includes code which would synchronize the renamed service records to peers through the distributed datastore. It would trigger the remote peers to pick up the rename by touching a datastore object which remote peers would have subscribed to events on. The code also asserts that the local peer is subscribed to updates on the network associated with the endpoint, presumably as a proxy for asserting that the remote peers would also be subscribed. https://github.com/moby/libnetwork/pull/712 Libnetwork no longer has support for distributed datastores or subscribing to datastore object updates, so this logic can be deleted. Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
parent
29da565133
commit
c85398b020
1 changed files with 0 additions and 15 deletions
|
@ -589,13 +589,6 @@ func (ep *Endpoint) rename(name string) error {
|
|||
return types.InternalErrorf("Could not delete service state for endpoint %s from cluster on rename: %v", ep.Name(), err)
|
||||
}
|
||||
} else {
|
||||
c.mu.Lock()
|
||||
_, ok = c.nmap[n.ID()]
|
||||
c.mu.Unlock()
|
||||
if !ok {
|
||||
// FIXME(thaJeztah): what is this check for, or is this to prevent a race condition (network removed)?
|
||||
return fmt.Errorf("watch null for network %q", n.Name())
|
||||
}
|
||||
n.updateSvcRecord(ep, false)
|
||||
}
|
||||
|
||||
|
@ -636,14 +629,6 @@ func (ep *Endpoint) rename(name string) error {
|
|||
if err = c.updateToStore(ep); err != nil {
|
||||
return err
|
||||
}
|
||||
// After the name change do a dummy endpoint count update to
|
||||
// trigger the service record update in the peer nodes
|
||||
|
||||
// Ignore the error because updateStore fail for EpCnt is a
|
||||
// benign error. Besides there is no meaningful recovery that
|
||||
// we can do. When the cluster recovers subsequent EpCnt update
|
||||
// will force the peers to get the correct EP name.
|
||||
_ = n.getEpCnt().updateStore()
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue