|
@@ -122,6 +122,8 @@ type DescriptorProviderPair struct {
|
|
Provider content.Provider
|
|
Provider content.Provider
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+var _ withCheckDescriptor = DescriptorProviderPair{}
|
|
|
|
+
|
|
func (p DescriptorProviderPair) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) (content.ReaderAt, error) {
|
|
func (p DescriptorProviderPair) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) (content.ReaderAt, error) {
|
|
return p.Provider.ReaderAt(ctx, desc)
|
|
return p.Provider.ReaderAt(ctx, desc)
|
|
}
|
|
}
|
|
@@ -156,6 +158,13 @@ func (p DescriptorProviderPair) SnapshotLabels(descs []ocispecs.Descriptor, inde
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func (p DescriptorProviderPair) CheckDescriptor(ctx context.Context, desc ocispecs.Descriptor) error {
|
|
|
|
+ if cd, ok := p.Provider.(withCheckDescriptor); ok {
|
|
|
|
+ return cd.CheckDescriptor(ctx, desc)
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
|
|
+}
|
|
|
|
+
|
|
// item is an implementation of a record in the cache chain. After validation,
|
|
// item is an implementation of a record in the cache chain. After validation,
|
|
// normalization and marshalling into the cache config, the item results form
|
|
// normalization and marshalling into the cache config, the item results form
|
|
// into the "layers", while the digests and the links form into the "records".
|
|
// into the "layers", while the digests and the links form into the "records".
|