mirror of
https://github.com/containers/image.git
synced 2025-04-18 19:44:05 +03:00
Merge pull request #2494 from TomSweeneyRedHat/dev/tsweeney/release-5.29_accel268
[release-5.29] blobinfocache: add function to delete the cache directory
This commit is contained in:
commit
46c933366a
@ -74,3 +74,15 @@ func DefaultCache(sys *types.SystemContext) types.BlobInfoCache {
|
||||
logrus.Debugf("Using SQLite blob info cache at %s", path)
|
||||
return cache
|
||||
}
|
||||
|
||||
// CleanupDefaultCache removes the blob info cache directory.
|
||||
// It deletes the cache directory but it does not affect any file or memory buffer currently
|
||||
// in use.
|
||||
func CleanupDefaultCache(sys *types.SystemContext) error {
|
||||
dir, err := blobInfoCacheDir(sys, rootless.GetRootlessEUID())
|
||||
if err != nil {
|
||||
// Mirror the DefaultCache behavior that does not fail in this case
|
||||
return nil
|
||||
}
|
||||
return os.RemoveAll(dir)
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ const (
|
||||
// VersionMinor is for functionality in a backwards-compatible manner
|
||||
VersionMinor = 29
|
||||
// VersionPatch is for backwards-compatible bug fixes
|
||||
VersionPatch = 5
|
||||
VersionPatch = 6
|
||||
|
||||
// VersionDev indicates development branch. Releases will be empty string.
|
||||
VersionDev = "-dev"
|
||||
|
Loading…
x
Reference in New Issue
Block a user