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