mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-09-30 18:00:33 +02:00
check for filepath.Walk error everywhere
This commit is contained in:
@@ -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
|
||||
|
||||
+5
-1
@@ -188,7 +188,11 @@ 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 {
|
||||
return errors.Wrap(err, fmt.Sprintf("walking path %s", path))
|
||||
}
|
||||
|
||||
if CheckWhitelist(path) {
|
||||
if !isExist(path) {
|
||||
logrus.Debugf("Path %s whitelisted, but not exists", path)
|
||||
|
||||
Reference in New Issue
Block a user