summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-28 15:14:19 +0200
committerGitHub <noreply@github.com>2022-03-28 15:14:19 +0200
commite1699d8591ab87717ae018583c896561c43efb29 (patch)
treef9ce0e691659969510b13714b047c3af49a5ed80 /pkg/specgen
parentaeae59804990e98fea6cd64388c99a1d863a7cb5 (diff)
parentd106b294b428fbb10f59d4cafe72c3dcaa4e73bb (diff)
downloadpodman-e1699d8591ab87717ae018583c896561c43efb29.tar.gz
podman-e1699d8591ab87717ae018583c896561c43efb29.tar.bz2
podman-e1699d8591ab87717ae018583c896561c43efb29.zip
Merge pull request #13668 from rhatdan/walk
Switch all calls to filepath.Walk to filepath.WalkDir
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/generate/config_linux.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/specgen/generate/config_linux.go b/pkg/specgen/generate/config_linux.go
index 35d7f0252..8f83fc09b 100644
--- a/pkg/specgen/generate/config_linux.go
+++ b/pkg/specgen/generate/config_linux.go
@@ -2,6 +2,7 @@ package generate
import (
"fmt"
+ "io/fs"
"io/ioutil"
"os"
"path"
@@ -101,8 +102,8 @@ func DevicesFromPath(g *generate.Generator, devicePath string) error {
}
// mount the internal devices recursively
- if err := filepath.Walk(resolvedDevicePath, func(dpath string, f os.FileInfo, e error) error {
- if f.Mode()&os.ModeDevice == os.ModeDevice {
+ if err := filepath.WalkDir(resolvedDevicePath, func(dpath string, d fs.DirEntry, e error) error {
+ if d.Type()&os.ModeDevice == os.ModeDevice {
found = true
device := fmt.Sprintf("%s:%s", dpath, filepath.Join(dest, strings.TrimPrefix(dpath, src)))
if devmode != "" {