1package client // import "github.com/docker/docker/client"
2
3import (
4	"context"
5	"net/url"
6	"strconv"
7
8	"github.com/docker/docker/api/types/swarm"
9)
10
11// SecretUpdate attempts to update a Secret
12func (cli *Client) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error {
13	if err := cli.NewVersionError("1.25", "secret update"); err != nil {
14		return err
15	}
16	query := url.Values{}
17	query.Set("version", strconv.FormatUint(version.Index, 10))
18	resp, err := cli.post(ctx, "/secrets/"+id+"/update", query, secret, nil)
19	ensureReaderClosed(resp)
20	return err
21}
22