Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csfilter-kfp: fix handling of empty lines in exclude-paths.txt #206

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions tests/csfilter-kfp/0004-args.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--kfp-dir "$PROJECT_ROOT/tests/csfilter-kfp/0004-kfp" --project-nvr WALinuxAgent-2.7.0.6-8.el8_8
4 changes: 4 additions & 0 deletions tests/csfilter-kfp/0004-kfp/WALinuxAgent/exclude-paths.txt
Original file line number Diff line number Diff line change
@@ -0,0 +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.

10 changes: 10 additions & 0 deletions tests/csfilter-kfp/0004-kfp/WALinuxAgent/ignore.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

Error: SNYK_CODE_WARNING (CWE-547):
WALinuxAgent-2.7.0.6/azurelinuxagent/common/utils/cryptutil.py:33:1: error[python/HardcodedNonCryptoSecret]: Avoid hardcoding values that are meant to be secret. Found a hardcoded string used in here.
# 31|
# 32|
# 33|-> DECRYPT_SECRET_CMD = "{0} cms -decrypt -inform DER -inkey {1} -in /dev/stdin"
# 34|
# 35|
# DECRYPT_SECRET_CMD is not a hardcoded secret, it is a openssl command template, there's nothing secret in it.

Loading