Skip to content

Commit

Permalink
fix auth scope claim (#331)
Browse files Browse the repository at this point in the history
Signed-off-by: Shiwei Zhang <[email protected]>
  • Loading branch information
shizhMSFT authored Oct 29, 2021
1 parent 09cb565 commit 6d6ddbd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/remotes/docker/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/reference"
"github.com/containerd/containerd/remotes"
"github.com/containerd/containerd/remotes/docker"
remoteserrors "github.com/containerd/containerd/remotes/errors"
Expand All @@ -27,6 +28,15 @@ func (d *dockerDiscoverer) Pusher(ctx context.Context, ref string) (remotes.Push
func (d *dockerDiscoverer) Push(ctx context.Context, desc ocispec.Descriptor) (content.Writer, error) {
switch desc.MediaType {
case artifactspec.MediaTypeArtifactManifest:
r, err := reference.Parse(d.reference)
if err != nil {
return nil, err
}
ctx, err := docker.ContextWithRepositoryScope(ctx, r, true)
if err != nil {
return nil, err
}

h, err := d.filterHosts(docker.HostCapabilityPush)
if err != nil {
return nil, err
Expand Down

0 comments on commit 6d6ddbd

Please sign in to comment.