From 6824eb41ea6a99df67a080d8a2dae87d122fbbd3 Mon Sep 17 00:00:00 2001 From: Miccah Date: Tue, 30 Jan 2024 12:21:37 -0800 Subject: [PATCH] Fix filesystem enumeration ignore paths bug (#2355) --- pkg/sources/filesystem/filesystem.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/sources/filesystem/filesystem.go b/pkg/sources/filesystem/filesystem.go index 9a1c4ceb9975..ca4edd947bd3 100644 --- a/pkg/sources/filesystem/filesystem.go +++ b/pkg/sources/filesystem/filesystem.go @@ -240,6 +240,9 @@ func (s *Source) Enumerate(ctx context.Context, reporter sources.UnitReporter) e return nil } fullPath := filepath.Join(path, relativePath) + if s.filter != nil && !s.filter.Pass(fullPath) { + return nil + } item := sources.CommonSourceUnit{ID: fullPath} return reporter.UnitOk(ctx, item) })