-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
verify post execution kafka warnings (#510)
* verify post execution kafka warnings * fix
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Checks Kafka logs for unsupported warning patterns | ||
# Only specified warnings are allowed, all others should trigger failure | ||
|
||
allowed_patterns=( | ||
"Performing controller activation" | ||
"registered with feature metadata.version" | ||
) | ||
|
||
# Get all warnings | ||
warnings=$(docker logs kafka | grep WARN) | ||
exit_code=0 | ||
|
||
while IFS= read -r line; do | ||
allowed=0 | ||
for pattern in "${allowed_patterns[@]}"; do | ||
if echo "$line" | grep -q "$pattern"; then | ||
allowed=1 | ||
break | ||
fi | ||
done | ||
|
||
if [ $allowed -eq 0 ]; then | ||
echo "Unexpected warning found:" | ||
echo "$line" | ||
exit_code=1 | ||
fi | ||
done <<< "$warnings" | ||
|
||
exit $exit_code |