mirror of
https://github.com/containers/podman.git
synced 2025-05-17 15:18:43 +08:00
libpod: cleanup default cache on system reset
Closes: https://github.com/containers/podman/issues/22825 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/containers/common/libimage"
|
||||
"github.com/containers/common/libnetwork/types"
|
||||
blobinfocache "github.com/containers/image/v5/pkg/blobinfocache"
|
||||
"github.com/containers/podman/v5/libpod/define"
|
||||
"github.com/containers/podman/v5/pkg/errorhandling"
|
||||
"github.com/containers/podman/v5/pkg/util"
|
||||
@ -257,6 +258,14 @@ func (r *Runtime) Reset(ctx context.Context) error {
|
||||
prevError = err
|
||||
}
|
||||
}
|
||||
|
||||
if err := blobinfocache.CleanupDefaultCache(nil); err != nil {
|
||||
if prevError != nil {
|
||||
logrus.Error(prevError)
|
||||
}
|
||||
prevError = err
|
||||
}
|
||||
|
||||
if storageConfPath, err := storage.DefaultConfigFile(); err == nil {
|
||||
switch storageConfPath {
|
||||
case stypes.SystemConfigFile:
|
||||
|
Reference in New Issue
Block a user