Merge pull request #1086 from tejal29/705
check for filepath.Walk error everywhere
This commit is contained in:
commit
9ceab7ff04
|
|
@ -62,6 +62,9 @@ func setupTestTemp() string {
|
|||
}
|
||||
cperr := filepath.Walk(srcPath,
|
||||
func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if path != srcPath {
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -188,7 +188,12 @@ func GetFSFromLayers(root string, layers []v1.Layer, opts ...FSOpt) ([]string, e
|
|||
// DeleteFilesystem deletes the extracted image file system
|
||||
func DeleteFilesystem() error {
|
||||
logrus.Info("Deleting filesystem...")
|
||||
return filepath.Walk(constants.RootDir, func(path string, info os.FileInfo, _ error) error {
|
||||
return filepath.Walk(constants.RootDir, func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
// ignore errors when deleting.
|
||||
return nil
|
||||
}
|
||||
|
||||
if CheckWhitelist(path) {
|
||||
if !isExist(path) {
|
||||
logrus.Debugf("Path %s whitelisted, but not exists", path)
|
||||
|
|
|
|||
Loading…
Reference in New Issue