mirror of
https://github.com/containers/podman.git
synced 2026-07-10 15:25:00 -04:00
fix system df flake
When reading the mount path here it can be missing and thus fail with
ENOENT when the voluem is removed in parallel. Because we do not want to
block for a full directory walk of course with the volume lock the only
choice is to ignore the error.
I have seen this error many times in CI in the past weeks:
FAIL: podman system df --format '{{"\n"}}'
expected: = ''
actual: Error: lstat /home/ubuntu.guest/.local/share/containers/storage/volumes/v-t450-1djh1zmh/_data: no such file or directory
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -271,6 +272,12 @@ func (ic *ContainerEngine) SystemDf(ctx context.Context, _ entities.SystemDfOpti
|
||||
}
|
||||
volSize, err := directory.Size(mountPoint)
|
||||
if err != nil {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
// volume is not locked here, if the directory is missing
|
||||
// all of the sudden we must assume the volume was removed
|
||||
// in parallel and ignore it like in the case below
|
||||
continue
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
inUse, err := v.VolumeInUse()
|
||||
|
||||
Reference in New Issue
Block a user