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) })