Proposal: Implement ref deleting command
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.
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.0andv2.0;v1.0containlayer1, andv2.0containlayer1andlayer2.When I delete
v2.0,layer2should 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).
#5 is a great job, I'd like it be merged ASAP:)
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.