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)
|
||||
}
|
||||
|
||||
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)
|
||||
if is.allMetadata {
|
||||
// Filter manifests by platforms but allow to handle manifest
|
||||
|
@ -45,10 +45,10 @@ func init() {
|
||||
// Initialize with hosts, authorizer callback, and headers
|
||||
func NewOCIRegistry(ref string, headers http.Header, creds CredentialHelper) *OCIRegistry {
|
||||
// Create an authorizer
|
||||
var ropts []docker.RegistryOpt
|
||||
var aopts []docker.AuthorizerOpt
|
||||
if creds != nil {
|
||||
// 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)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
@ -56,7 +56,10 @@ func NewOCIRegistry(ref string, headers http.Header, creds CredentialHelper) *OC
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user