content: change Writer/ReaderAt to take OCI
This change allows implementations to resolve the location of the actual data using OCI descriptor fields such as MediaType. No OCI descriptor field is written to the store. No change on gRPC API. Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
@@ -506,7 +506,9 @@ func create(obj object, tx *bolt.Tx, is images.Store, cs content.Store, sn snaps
|
||||
case testContent:
|
||||
ctx := WithTransactionContext(ctx, tx)
|
||||
expected := digest.FromBytes(v.data)
|
||||
w, err := cs.Writer(ctx, "test-ref", int64(len(v.data)), expected)
|
||||
w, err := cs.Writer(ctx,
|
||||
content.WithRef("test-ref"),
|
||||
content.WithDescriptor(ocispec.Descriptor{Size: int64(len(v.data)), Digest: expected}))
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to create writer")
|
||||
}
|
||||
|
Reference in New Issue
Block a user