mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
fix: oci cache store should fallback to copy when rename won't work (#96)
This commit is contained in:
parent
8135307283
commit
4e9738b959
@ -123,7 +123,10 @@ impl OciPackerCache {
|
||||
fs_path.push(format!("{}.{}", packed.digest, packed.format.extension()));
|
||||
manifest_path.push(format!("{}.manifest.json", packed.digest));
|
||||
config_path.push(format!("{}.config.json", packed.digest));
|
||||
fs::rename(&packed.path, &fs_path).await?;
|
||||
if fs::rename(&packed.path, &fs_path).await.is_err() {
|
||||
fs::copy(&packed.path, &fs_path).await?;
|
||||
fs::remove_file(&packed.path).await?;
|
||||
}
|
||||
fs::write(&config_path, packed.config.raw()).await?;
|
||||
fs::write(&manifest_path, packed.manifest.raw()).await?;
|
||||
manifests.retain(|item| {
|
||||
|
Loading…
Reference in New Issue
Block a user