Conversation
13d3ebf to
41446dc
Compare
|
Added |
| } | ||
| defer reader.Close() | ||
|
|
||
| // This makes a full copy; instead, if possible, we could only digest the file and reflink (hard link?) |
There was a problem hiding this comment.
Note to self: c/storage/drivers/copy.CopyRegular…
|
i accidentally deleted my earlier comment, but I have been using the layout.List portion of this PR and it is working nicely. Will test the latest addition here soon. |
Port all tests from containers#1677 , and see what else! Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
WIP: For this to actually make any sense, it should be able to avoid the copy. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
| // It computes, and returns, the digest and size of the used file. | ||
| // | ||
| // This function can be used instead of dest.PutBlob() where the ImageDestination requires PutBlob() to be called. | ||
| func PutBlobFromLocalFile(ctx context.Context, dest types.ImageDestination, file string) (digest.Digest, int64, error) { |
There was a problem hiding this comment.
I think we need a means to configure the mime type of the blob to serve artifacts. Going forward, I anticipate users to create their custom layer types for LLM etc.
There was a problem hiding this comment.
The way the ImageDestination API works, PutBlob doesn’t typically need to worry about the MIME type: the MIME type comes via PutManifest.
While it is true that the PutBlobWithOptions gets a full types.BlobInfo, and
Line 852 in 0c42f2f
Line 168 in 0c42f2f
PutBlobOptions.IsConfig).
Also, specifically in the OCI transport, the PutBlob* code really doesn’t care about the MIME type. It is going to create a sha256-named file, and as far as the layout definition is concerned, it’s perfectly valid to refer to a single blob in two different manifests using two different MIME types. So, for this OCI-transport-specific function, I don’t think adding a MIME type is right.
|
Opened #2633 to kick this PR over the finish line. |
|
Closing in favor of #2633. |
Includes @sourceIndex code from #1677 .
Do not merge:
oci/archiveat the same time? Structureoci/internalaccordingly either way.