Files
cli/components/engine/api/client/push.go
T
Vincent Demeester 5c061ea6cc Migrate push command to cobra
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 9640e3a4514f96a890310757a09fd77a3c70e931
Component: engine
2016-06-10 12:07:28 +02:00

24 lines
559 B
Go

package client
import (
"io"
"golang.org/x/net/context"
"github.com/docker/engine-api/types"
)
// ImagePushPrivileged push the image
func (cli *DockerCli) ImagePushPrivileged(ctx context.Context, authConfig types.AuthConfig, ref string, requestPrivilege types.RequestPrivilegeFunc) (io.ReadCloser, error) {
encodedAuth, err := EncodeAuthToBase64(authConfig)
if err != nil {
return nil, err
}
options := types.ImagePushOptions{
RegistryAuth: encodedAuth,
PrivilegeFunc: requestPrivilege,
}
return cli.client.ImagePush(ctx, ref, options)
}