image-tools icon indicating copy to clipboard operation
image-tools copied to clipboard

Proposal: Implement ref deleting command

Open hustcat opened this issue 9 years ago • 3 comments

Consider a OCI layout contain two refs: v1.0 and v2.0; v1.0 contain layer1, and v2.0 contain layer1 and layer2.

When I delete v2.0, layer2 should be deleted.

hustcat avatar Nov 17 '16 08:11 hustcat

Shallow ref-deletion is handled in #5 with commands like:

$ oci-refs delete image.tar v2.0

On Thu, Nov 17, 2016 at 12:29:30AM -0800, Ye Yin wrote:

Consider a OCI layout contain two refs: v1.0 and v2.0; v1.0 contain layer1, and v2.0 contain layer1 and layer2.

When I delete v2.0, layer2 should be deleted.

It's not quite that simple. For example, perhaps layer2 is part of a new v3.0 that is being pushed from the bottom up in parallel. In that case, removing layer2 could break the published v3.0. A more robust approach is to add a garbage-collection command which somehow protects from this sort of situation. I've been planning to write one up if/when #5 lands here, and @cyphar already has an exclusive-lock mark/sweep implemenation in umoci (cyphar/umoci#17).

wking avatar Nov 17 '16 18:11 wking

#5 is a great job, I'd like it be merged ASAP:)

hustcat avatar Nov 18 '16 02:11 hustcat

This project is no longer actively maintained. However, umoci is a much more full-featured tool for manipulating OCI images, and is now an OCI project as a reference implementation of the OCI image-spec. I would strongly suggest people move to using umoci.

cyphar avatar Jun 22 '20 04:06 cyphar