2017-03-15 18:04:32 -04:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/url"
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"github.com/docker/docker/api/types/swarm"
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
)
|
|
|
|
|
2017-05-14 01:05:41 -04:00
|
|
|
// ConfigUpdate attempts to update a Config
|
2017-03-15 18:04:32 -04:00
|
|
|
func (cli *Client) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error {
|
|
|
|
query := url.Values{}
|
|
|
|
query.Set("version", strconv.FormatUint(version.Index, 10))
|
|
|
|
resp, err := cli.post(ctx, "/configs/"+id+"/update", query, config, nil)
|
|
|
|
ensureReaderClosed(resp)
|
|
|
|
return err
|
|
|
|
}
|