gc: add a policy to skip garbage collecting new blobs

We perform inline garbage collection of orphan blobs. However, the
dist-spec poses a problem because blobs begin their life as orphan blobs
and then a manifest is add which refers to these blobs.

We use umoci's GC() to perform garbage collection and policy support
has been added recently which can control whether a blob can be skipped
for GC.

In this patch, we use a time-based policy to skip blobs.
This commit is contained in:
Ramkumar Chinchani
2020-06-30 10:56:58 -07:00
parent 80244f1282
commit 324a517ea3
6 changed files with 50 additions and 6 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ go 1.14
require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/apex/log v1.4.0
github.com/briandowns/spinner v1.11.1
github.com/chartmuseum/auth v0.4.0
github.com/dustin/go-humanize v1.0.0
@@ -21,7 +22,7 @@ require (
github.com/opencontainers/distribution-spec v1.0.0-rc0
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/umoci v0.4.6
github.com/opencontainers/umoci v0.4.7-0.20200704224433-977db481b72c
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/rs/zerolog v1.17.2
github.com/smartystreets/goconvey v1.6.4