Skip to content

Commit

Permalink
csfilter-kfp: handle lines consisting of white-spaces only
Browse files Browse the repository at this point in the history
... as empty lines

Related: https://issues.redhat.com/browse/OSH-755
Closes: csutils#206
  • Loading branch information
kdudka committed Sep 12, 2024
1 parent 12da743 commit 78d26ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/csfilter-kfp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def construct_path_filter(args):
cmd += ' re=\n'
cmd += ' while read line; do\n'
cmd += ' re="${re}|(${line})"\n'
cmd += ' done < <(grep -Esv \'^(#|$)\' "$ep")\n'
cmd += ' done < <(grep -Esv \'^(#| *$)\' "$ep")\n'
cmd += ' if test -n "$re"; then\n'
cmd += ' csgrep --mode=json --invert-match --path="${re#|}"\n'
cmd += ' else\n'
Expand Down
2 changes: 1 addition & 1 deletion tests/csfilter-kfp/0002-stdout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ path_filter() {
re=
while read line; do
re="${re}|(${line})"
done < <(grep -Esv '^(#|$)' "$ep")
done < <(grep -Esv '^(#| *$)' "$ep")
if test -n "$re"; then
csgrep --mode=json --invert-match --path="${re#|}"
else
Expand Down
2 changes: 1 addition & 1 deletion tests/csfilter-kfp/0004-kfp/WALinuxAgent/exclude-paths.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

WALinuxAgent[^/]*/dcr/.*
# dcr' is a testing pipeline for WALA and it is packaged by an oversight, the code is not used. It was removed in the current upstream so this will be gone with WALA rebase.

0 comments on commit 78d26ba

Please sign in to comment.