Remove paths from previous layers that conflict with new layer entries
before unpacking. This aligns with the OCI spec. [0]

This fixes a rootfs extraction failure with docker.io/grafana/otel-lgtm,
which was reported in the Proxmox Forum [1].

[0] 
https://github.com/opencontainers/image-spec/blob/26647a49f642c7d22a1cd3aa0a48e4650a542269/layer.md#changeset-over-existing-files
[1] https://forum.proxmox.com/threads/otel-lgtm-oci-create-lxc-failed.176996/

Filip Schauer (2):
  oci: fix rootfs extraction when paths already exist
  oci: test replacing files in subsequent layers

 proxmox-oci/src/lib.rs                        |  20 ++++++
 proxmox-oci/tests/extract_replace.rs          |  57 ++++++++++++++++++
 .../oci_test_replace_dir_with_file.tar        | Bin 0 -> 8704 bytes
 .../oci_image_data/oci_test_replace_file.tar  | Bin 0 -> 8704 bytes
 .../oci_test_replace_file_with_dir.tar        | Bin 0 -> 8704 bytes
 5 files changed, 77 insertions(+)
 create mode 100644 proxmox-oci/tests/extract_replace.rs
 create mode 100644 
proxmox-oci/tests/oci_image_data/oci_test_replace_dir_with_file.tar
 create mode 100644 proxmox-oci/tests/oci_image_data/oci_test_replace_file.tar
 create mode 100644 
proxmox-oci/tests/oci_image_data/oci_test_replace_file_with_dir.tar

-- 
2.47.3



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to