Skip to content

Commit

Permalink
[v4.9-rhel] libpod: cleanup default cache on system reset
Browse files Browse the repository at this point in the history
Addresses: https://issues.redhat.com/browse/ACCELFIX-267

Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: tomsweeneyredhat <[email protected]>
  • Loading branch information
giuseppe authored and TomSweeneyRedHat committed Aug 6, 2024
1 parent ed34692 commit 6297789
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libpod/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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/v4/libpod/define"
"github.com/containers/podman/v4/pkg/errorhandling"
"github.com/containers/podman/v4/pkg/rootless"
Expand Down Expand Up @@ -259,6 +260,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(rootless.IsRootless()); err == nil {
switch storageConfPath {
case stypes.SystemConfigFile:
Expand Down

0 comments on commit 6297789

Please sign in to comment.