mirror of https://github.com/docker/cli.git
cli/registry/client: remove unused GetRegistryAuth()
This was added infd2f1b3b66
as part of the `docker engine` sub-commands, which were deprecated, and removed in43b2f52d0c
. This function is not used by anyone, so safe to remove. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
68cad50f61
commit
e83d6cd2c8
|
@ -7,7 +7,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
manifesttypes "github.com/docker/cli/cli/manifest/types"
|
manifesttypes "github.com/docker/cli/cli/manifest/types"
|
||||||
"github.com/docker/cli/cli/trust"
|
|
||||||
"github.com/docker/distribution"
|
"github.com/docker/distribution"
|
||||||
"github.com/docker/distribution/reference"
|
"github.com/docker/distribution/reference"
|
||||||
distributionclient "github.com/docker/distribution/registry/client"
|
distributionclient "github.com/docker/distribution/registry/client"
|
||||||
|
@ -207,16 +206,3 @@ func getManifestOptionsFromReference(ref reference.Named) (digest.Digest, []dist
|
||||||
}
|
}
|
||||||
return "", nil, errors.Errorf("%s no tag or digest", ref)
|
return "", nil, errors.Errorf("%s no tag or digest", ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRegistryAuth returns the auth config given an input image
|
|
||||||
func GetRegistryAuth(ctx context.Context, resolver AuthConfigResolver, imageName string) (*types.AuthConfig, error) {
|
|
||||||
distributionRef, err := reference.ParseNormalizedNamed(imageName)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("Failed to parse image name: %s: %s", imageName, err)
|
|
||||||
}
|
|
||||||
imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, nil, resolver, distributionRef.String())
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("Failed to get imgRefAndAuth: %s", err)
|
|
||||||
}
|
|
||||||
return imgRefAndAuth.AuthConfig(), nil
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue