diff --git a/pkg/blobinfocache/default.go b/pkg/blobinfocache/default.go index 037572b0ee..1e67211a1c 100644 --- a/pkg/blobinfocache/default.go +++ b/pkg/blobinfocache/default.go @@ -74,3 +74,12 @@ func DefaultCache(sys *types.SystemContext) types.BlobInfoCache { logrus.Debugf("Using SQLite blob info cache at %s", path) return cache } + +// Cleanup removes the blob info cache directory. +func Cleanup(sys *types.SystemContext) error { + dir, err := blobInfoCacheDir(sys, rootless.GetRootlessEUID()) + if err != nil { + return err + } + return os.RemoveAll(dir) +}