From a6bf3541c5af662b73cfd9d7425900cacc2119a1 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Fri, 13 Sep 2024 17:31:40 +0200 Subject: [PATCH] Do not skip /run when counting the size (#538) --- pkg/config/spec.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/config/spec.go b/pkg/config/spec.go index 962c918..e2ef44e 100644 --- a/pkg/config/spec.go +++ b/pkg/config/spec.go @@ -826,12 +826,11 @@ func GetSourceSize(config *Config, source *v1.ImageSource) (int64, error) { hostDir = "/host" } err = fsutils.WalkDirFs(config.Fs, source.Value(), func(path string, d fs.DirEntry, err error) error { - // If its empty we are just not setting it, so probably out of the k8s upgrade path if hostDir != "" && strings.HasPrefix(path, hostDir) { config.Logger.Logger.Debug().Str("path", path).Str("hostDir", hostDir).Msg("Skipping file as it is a host directory") - } else if strings.HasPrefix(path, "/proc") || strings.HasPrefix(path, "/dev") || strings.HasPrefix(path, "/run") { - config.Logger.Logger.Debug().Str("path", path).Str("hostDir", hostDir).Msg("Skipping dir as it is a system directory (/proc, /dev or /run)") + } else if strings.HasPrefix(path, "/proc") || strings.HasPrefix(path, "/dev") { + config.Logger.Logger.Debug().Str("path", path).Str("hostDir", hostDir).Msg("Skipping dir as it is a runtime directory (/proc or /dev)") } else { v := getSize(&size, filesVisited, path, d, err) return v