Fixup pull authorization and labeling
Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
parent
478f1c934d
commit
e88baa0873
@ -62,7 +62,7 @@ func (is *Store) String() string {
|
|||||||
return fmt.Sprintf("Local Image Store (%s)", is.imageName)
|
return fmt.Sprintf("Local Image Store (%s)", is.imageName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (is *Store) FilterHandler(h images.HandlerFunc, cs content.Store) images.HandlerFunc {
|
func (is *Store) ImageFilter(h images.HandlerFunc, cs content.Store) images.HandlerFunc {
|
||||||
h = images.SetChildrenMappedLabels(cs, h, is.labelMap)
|
h = images.SetChildrenMappedLabels(cs, h, is.labelMap)
|
||||||
if is.allMetadata {
|
if is.allMetadata {
|
||||||
// Filter manifests by platforms but allow to handle manifest
|
// Filter manifests by platforms but allow to handle manifest
|
||||||
|
@ -45,10 +45,10 @@ func init() {
|
|||||||
// Initialize with hosts, authorizer callback, and headers
|
// Initialize with hosts, authorizer callback, and headers
|
||||||
func NewOCIRegistry(ref string, headers http.Header, creds CredentialHelper) *OCIRegistry {
|
func NewOCIRegistry(ref string, headers http.Header, creds CredentialHelper) *OCIRegistry {
|
||||||
// Create an authorizer
|
// Create an authorizer
|
||||||
var ropts []docker.RegistryOpt
|
var aopts []docker.AuthorizerOpt
|
||||||
if creds != nil {
|
if creds != nil {
|
||||||
// TODO: Support bearer
|
// TODO: Support bearer
|
||||||
authorizer := docker.NewDockerAuthorizer(docker.WithAuthCreds(func(host string) (string, string, error) {
|
aopts = append(aopts, docker.WithAuthCreds(func(host string) (string, string, error) {
|
||||||
c, err := creds.GetCredentials(context.Background(), ref, host)
|
c, err := creds.GetCredentials(context.Background(), ref, host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", err
|
return "", "", err
|
||||||
@ -56,7 +56,10 @@ func NewOCIRegistry(ref string, headers http.Header, creds CredentialHelper) *OC
|
|||||||
|
|
||||||
return c.Username, c.Secret, nil
|
return c.Username, c.Secret, nil
|
||||||
}))
|
}))
|
||||||
ropts = append(ropts, docker.WithAuthorizer(authorizer))
|
}
|
||||||
|
|
||||||
|
ropts := []docker.RegistryOpt{
|
||||||
|
docker.WithAuthorizer(docker.NewDockerAuthorizer(aopts...)),
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Apply local configuration, maybe dynamically create resolver when requested
|
// TODO: Apply local configuration, maybe dynamically create resolver when requested
|
||||||
|
Loading…
Reference in New Issue
Block a user