Copy annotations around where necessary

Make sure that the newly added annotations are copied around appropriately.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger
2019-03-06 12:22:56 -05:00
parent c6703d4c76
commit 0b711d616a
8 changed files with 50 additions and 37 deletions

View File

@@ -143,9 +143,10 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
return nil, fmt.Errorf("unsupported checkpoint type %q", r.Checkpoint.MediaType)
}
reader, err := l.store.ReaderAt(ctx, ocispec.Descriptor{
MediaType: r.Checkpoint.MediaType,
Digest: r.Checkpoint.Digest,
Size: r.Checkpoint.Size_,
MediaType: r.Checkpoint.MediaType,
Digest: r.Checkpoint.Digest,
Size: r.Checkpoint.Size_,
Annotations: r.Checkpoint.Annotations,
})
if err != nil {
return nil, err
@@ -624,9 +625,10 @@ func (l *local) writeContent(ctx context.Context, mediaType, ref string, r io.Re
return nil, err
}
return &types.Descriptor{
MediaType: mediaType,
Digest: writer.Digest(),
Size_: size,
MediaType: mediaType,
Digest: writer.Digest(),
Size_: size,
Annotations: make(map[string]string),
}, nil
}