MCPcopy Create free account
hub / github.com/linuxkit/linuxkit / rewriteReference

Method rewriteReference

src/cmd/linuxkit/registry/remote.go:254–268  ·  view source on GitHub ↗
(ref name.Reference)

Source from the content-addressed store, hash-verified

252}
253
254func (r *Remote) rewriteReference(ref name.Reference) (name.Reference, error) {
255 newRepo, opts, err := r.rewriteRepositoryBase(ref.Context())
256 if err != nil {
257 return nil, fmt.Errorf("rewriting repository %q: %w", ref.Context().Name(), err)
258 }
259
260 switch typed := ref.(type) {
261 case name.Tag:
262 return name.NewTag(newRepo+":"+typed.TagStr(), opts...)
263 case name.Digest:
264 return name.NewDigest(newRepo+"@"+typed.DigestStr(), opts...)
265 default:
266 return nil, fmt.Errorf("unsupported reference type: %T", ref)
267 }
268}
269
270func (r *Remote) rewriteRepository(repo name.Repository) (name.Repository, error) {
271 newRepo, opts, err := r.rewriteRepositoryBase(repo)

Callers 9

GetMethod · 0.95
HeadMethod · 0.95
PushMethod · 0.95
PutMethod · 0.95
WriteMethod · 0.95
WriteIndexMethod · 0.95
IndexMethod · 0.95
ImageMethod · 0.95
DeleteMethod · 0.95

Calls 1

rewriteRepositoryBaseMethod · 0.95

Tested by

no test coverage detected