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 (
|
2018-04-19 22:30:59 +00:00
|
|
|
"context"
|
2016-12-12 23:05:53 +00:00
|
|
|
"io"
|
2021-08-26 19:08:38 +00:00
|
|
|
|
|
|
|
"github.com/docker/docker/api/types/registry"
|
2016-09-06 18:46:37 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// PluginPush pushes a plugin to a registry
|
2016-12-12 23:05:53 +00:00
|
|
|
func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) {
|
2021-08-26 19:08:38 +00:00
|
|
|
headers := map[string][]string{registry.AuthHeader: {registryAuth}}
|
2016-09-06 18:46:37 +00:00
|
|
|
resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, headers)
|
2016-12-12 23:05:53 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return resp.body, nil
|
2016-09-06 18:46:37 +00:00
|
|
|
}
|