From 67e71e18edbd6f49d401d4707bdfe1628df8dabc Mon Sep 17 00:00:00 2001 From: Kartik Suryavanshi <158498247+KartikSuryavanshi@users.noreply.github.com> Date: Wed, 15 Jul 2026 21:29:36 +0530 Subject: [PATCH] fix: address review feedback on error routing - Route os.Lstat(resolved) errors through walkFn with original symlink info, so callers can decide whether to skip based on .helmignore - Keep info reassignment from Lstat to prevent infinite recursion on symlink-to-directory paths Signed-off-by: Kartik Suryavanshi Signed-off-by: Kartik Suryavanshi <158498247+KartikSuryavanshi@users.noreply.github.com> --- internal/sympath/walk.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/sympath/walk.go b/internal/sympath/walk.go index 0da7b1fc8..caacec306 100644 --- a/internal/sympath/walk.go +++ b/internal/sympath/walk.go @@ -74,7 +74,9 @@ func symwalk(path string, info os.FileInfo, walkFn filepath.WalkFunc) error { // This log message is to highlight a symlink that is being used within a chart, symlinks can be used for nefarious reasons. slog.Info("found symbolic link in path. Contents of linked file included and used", "path", path, "resolved", resolved) if info, err = os.Lstat(resolved); err != nil { - return err + // Route through walkFn with the original symlink info so callers + // can decide whether to skip it based on .helmignore rules. + return walkFn(path, info, err) } if err := symwalk(path, info, walkFn); err != nil && err != filepath.SkipDir { return err