libnet: remove arg options from (*Endpoint).Leave()

This arg is never set by any caller. Better remove it

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:
Albin Kerouanton 2023-11-03 10:35:51 +01:00
parent 12c7411b6b
commit 21136865ac
No known key found for this signature in database
GPG key ID: 630B8E1DCBDB1864

View file

@ -639,7 +639,7 @@ func (ep *Endpoint) hasInterface(iName string) bool {
}
// Leave detaches the network resources populated in the sandbox.
func (ep *Endpoint) Leave(sb *Sandbox, options ...EndpointOption) error {
func (ep *Endpoint) Leave(sb *Sandbox) error {
if sb == nil || sb.ID() == "" || sb.Key() == "" {
return types.InvalidParameterErrorf("invalid Sandbox passed to endpoint leave: %v", sb)
}
@ -647,10 +647,10 @@ func (ep *Endpoint) Leave(sb *Sandbox, options ...EndpointOption) error {
sb.joinLeaveStart()
defer sb.joinLeaveEnd()
return ep.sbLeave(sb, false, options...)
return ep.sbLeave(sb, false)
}
func (ep *Endpoint) sbLeave(sb *Sandbox, force bool, options ...EndpointOption) error {
func (ep *Endpoint) sbLeave(sb *Sandbox, force bool) error {
n, err := ep.getNetworkFromStore()
if err != nil {
return fmt.Errorf("failed to get network from store during leave: %v", err)
@ -672,8 +672,6 @@ func (ep *Endpoint) sbLeave(sb *Sandbox, force bool, options ...EndpointOption)
return types.ForbiddenErrorf("unexpected sandbox ID in leave request. Expected %s. Got %s", ep.sandboxID, sb.ID())
}
ep.processOptions(options...)
d, err := n.driver(!force)
if err != nil {
return fmt.Errorf("failed to get driver during endpoint leave: %v", err)