github.com/hms58/moby@v1.13.1/client/secret_update.go (about)

     1  package client
     2  
     3  import (
     4  	"net/url"
     5  	"strconv"
     6  
     7  	"github.com/docker/docker/api/types/swarm"
     8  	"golang.org/x/net/context"
     9  )
    10  
    11  // SecretUpdate updates a Secret. Currently, the only part of a secret spec
    12  // which can be updated is Labels.
    13  func (cli *Client) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error {
    14  	query := url.Values{}
    15  	query.Set("version", strconv.FormatUint(version.Index, 10))
    16  	resp, err := cli.post(ctx, "/secrets/"+id+"/update", query, secret, nil)
    17  	ensureReaderClosed(resp)
    18  	return err
    19  }