From 64673bce0a1dec6a473f143620a605228ac76659 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Wed, 22 Jun 2016 14:06:39 -0700 Subject: [PATCH] Remove locator check on endpoint force removal - If an endpoint is forcibly removed, it should not matter whether the locator info is present. If the daemon was started w/o the --cluster-advertise option (the option is not mandatory), then the locator would be empty for any endpoint. Signed-off-by: Alessandro Boch --- libnetwork/endpoint.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/libnetwork/endpoint.go b/libnetwork/endpoint.go index 3fa1b6dc3e..418017f80d 100644 --- a/libnetwork/endpoint.go +++ b/libnetwork/endpoint.go @@ -722,18 +722,6 @@ func (ep *endpoint) sbLeave(sb *sandbox, force bool, options ...EndpointOption) return nil } -func (n *network) validateForceDelete(locator string) error { - if n.Scope() == datastore.LocalScope { - return nil - } - - if locator == "" { - return fmt.Errorf("invalid endpoint locator identifier") - } - - return nil -} - func (ep *endpoint) Delete(force bool) error { var err error n, err := ep.getNetworkFromStore() @@ -750,15 +738,8 @@ func (ep *endpoint) Delete(force bool) error { epid := ep.id name := ep.name sbid := ep.sandboxID - locator := ep.locator ep.Unlock() - if force { - if err = n.validateForceDelete(locator); err != nil { - return fmt.Errorf("unable to force delete endpoint %s: %v", name, err) - } - } - sb, _ := n.getController().SandboxByID(sbid) if sb != nil && !force { return &ActiveContainerError{name: name, id: epid}