plugin_push.go 420 B

1234567891011121314151617
  1. package client
  2. import (
  3. "io"
  4. "golang.org/x/net/context"
  5. )
  6. // PluginPush pushes a plugin to a registry
  7. func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) {
  8. headers := map[string][]string{"X-Registry-Auth": {registryAuth}}
  9. resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, headers)
  10. if err != nil {
  11. return nil, err
  12. }
  13. return resp.body, nil
  14. }