mirror of
https://github.com/containers/skopeo.git
synced 2025-10-25 05:39:01 +00:00
vendor containers/image for DockerAuthConfig
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
7
vendor/github.com/containers/image/docker/docker_client.go
generated
vendored
7
vendor/github.com/containers/image/docker/docker_client.go
generated
vendored
@@ -52,7 +52,7 @@ func newDockerClient(ctx *types.SystemContext, ref dockerReference, write bool)
|
||||
if registry == dockerHostname {
|
||||
registry = dockerRegistry
|
||||
}
|
||||
username, password, err := getAuth(ref.ref.Hostname())
|
||||
username, password, err := getAuth(ctx, ref.ref.Hostname())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -243,7 +243,10 @@ func (c *dockerClient) getBearerToken(realm, service, scope string) (string, err
|
||||
return tokenStruct.Token, nil
|
||||
}
|
||||
|
||||
func getAuth(registry string) (string, string, error) {
|
||||
func getAuth(ctx *types.SystemContext, registry string) (string, string, error) {
|
||||
if ctx != nil && ctx.DockerAuthConfig != nil {
|
||||
return ctx.DockerAuthConfig.Username, ctx.DockerAuthConfig.Password, nil
|
||||
}
|
||||
// TODO(runcom): get this from *cli.Context somehow
|
||||
//if username != "" && password != "" {
|
||||
//return username, password, nil
|
||||
|
||||
Reference in New Issue
Block a user