Merge pull request #47236 from akerouanton/remove-sb-leave-options-param

libnet: remove arg `options` from (*Endpoint).Leave()
This commit is contained in:
Sebastiaan van Stijn 2024-01-30 16:57:36 +01:00 committed by GitHub
commit f472dda2e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -673,7 +673,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)
}
@ -681,10 +681,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)
@ -706,8 +706,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)