Skip to content

Commit

Permalink
registry: use the privileged client to get signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
mfojtik committed Sep 15, 2017
1 parent 3fddedc commit 5606ec5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pkg/dockerregistry/server/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ func (ac *AccessController) Authorized(ctx context.Context, accessRecords ...reg
if err := verifyImageSignatureAccess(ctx, namespace, name, osClient); err != nil {
return nil, ac.wrapErr(ctx, err)
}
default:
return nil, ac.wrapErr(ctx, ErrUnsupportedAction)
}

case "metrics":
Expand Down
6 changes: 3 additions & 3 deletions pkg/dockerregistry/server/signaturedispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ func (s *signatureHandler) Get(w http.ResponseWriter, req *http.Request) {
s.handleError(s.ctx, v2.ErrorCodeNameInvalid.WithDetail("missing image name or image ID"), w)
return
}
client, ok := userClientFrom(s.ctx)
if !ok {
s.handleError(s.ctx, errcode.ErrorCodeUnknown.WithDetail("unable to get origin client"), w)
client, err := RegistryClientFrom(s.ctx).Client()
if err != nil {
s.handleError(s.ctx, errcode.ErrorCodeUnknown.WithDetail(fmt.Sprintf("unable to get origin client: %v", err)), w)
return
}

Expand Down

0 comments on commit 5606ec5

Please sign in to comment.