2018-02-05 21:05:59 +00:00
|
|
|
package client // import "github.com/docker/docker/client"
|
2016-09-06 18:46:37 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net/url"
|
|
|
|
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
)
|
|
|
|
|
2016-12-20 11:14:41 +00:00
|
|
|
// SwarmLeave leaves the swarm.
|
2016-09-06 18:46:37 +00:00
|
|
|
func (cli *Client) SwarmLeave(ctx context.Context, force bool) error {
|
|
|
|
query := url.Values{}
|
|
|
|
if force {
|
|
|
|
query.Set("force", "1")
|
|
|
|
}
|
|
|
|
resp, err := cli.post(ctx, "/swarm/leave", query, nil, nil)
|
|
|
|
ensureReaderClosed(resp)
|
|
|
|
return err
|
|
|
|
}
|