Skip to content

Commit

Permalink
Merge pull request #12 from buildbuddy-io/debuglayers
Browse files Browse the repository at this point in the history
Log digests of layers in manifest when an unknown layer is requested
  • Loading branch information
iain-macdonald authored Sep 5, 2023
2 parents 0e5c1f9 + d3fa35e commit f3cbf40
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion store/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,15 @@ func (r *LayerManager) getLayer(ctx context.Context, refspec reference.Spec, dgs
}
preResolve = append(preResolve, l)
}

// Additional debug string for
// https://github.com/buildbuddy-io/buildbuddy-internal/issues/2570
if !found {
return nil, fmt.Errorf("unknown digest %v for ref %q", target, refspec.String())
layers := []string{}
for _, l := range manifest.Layers {
layers = append(layers, l.Digest.String())
}
return nil, fmt.Errorf("unknown digest %v for ref %q (known digests: [%s])", target, refspec.String(), strings.Join(layers, ","))
}
for _, l := range append([]ocispec.Descriptor{target}, preResolve...) {
l := l
Expand Down

0 comments on commit f3cbf40

Please sign in to comment.