Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*layout.layoutIndex implements Layer(Hash) for compatibility with remote.WriteIndex #1865

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkg/v1/layout/index.go
Expand Up @@ -126,6 +126,19 @@ func (i *layoutIndex) Blob(h v1.Hash) (io.ReadCloser, error) {
return i.path.Blob(h)
}

// Workaround for #819.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this comment in other locations where the private interfaces exposing extra extensibility are implemented

func (i *layoutIndex) Layer(h v1.Hash) (v1.Layer, error) {
desc, err := i.findDescriptor(h)
if err != nil {
return nil, err
}
layer := &compressedBlob{
path: i.path,
desc: *desc,
}
return partial.CompressedToLayer(layer)
}

func (i *layoutIndex) findDescriptor(h v1.Hash) (*v1.Descriptor, error) {
im, err := i.IndexManifest()
if err != nil {
Expand Down