cli/registry/client: remove unused GetRegistryAuth()
This was added in fd2f1b3b6650b53ed1367b84910e0f81e89220cd as part of the `docker engine` sub-commands, which were deprecated, and removed in 43b2f52d0ca4b57bddd0fd541d8440e1f17fd0a6. 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"
|
||||
|
||||
manifesttypes "github.com/docker/cli/cli/manifest/types"
|
||||
"github.com/docker/cli/cli/trust"
|
||||
"github.com/docker/distribution"
|
||||
"github.com/docker/distribution/reference"
|
||||
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)
|
||||
}
|
||||
|
||||
// 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…
x
Reference in New Issue
Block a user