oras-project / oras-go

ORAS Go library
https://oras.land
Apache License 2.0
176 stars 94 forks source link

allow an option to allow file store skip copying existed file #777

Open qweeah opened 3 months ago

qweeah commented 3 months ago

Suppose I am using oras-go to copy an artifact into a file store. The artifact contains several files and the copy process aborted half-way after completed copying the first file.

In current version (v2.5.0) If I retry copying the artifact, the first file will still be copied again. Need an option to skip the copying if the target file's name and digest both matches.

shizhMSFT commented 3 months ago

It looks like we need to add the file to the file store on executing Exists(). However, it does not make sense as the Exists() should not add the file to the file store even if the file sits on the disk.

shizhMSFT commented 3 months ago

If we add the files to the file store in advance, despite the performance issue, the improvement should be done in the CLI.