Update subscription pattern in check_logs function of checker.py to improve error message handling. Enhanced regex to capture error types more accurately, ensuring whitespace is stripped from error messages. This change refines log analysis and improves clarity in health check reporting.

This commit is contained in:
vvzvlad 2025-01-19 11:34:57 +03:00
parent 43dbcd0a17
commit 246e073092

View File

@ -138,7 +138,7 @@ def check_logs(log_handler):
except subprocess.CalledProcessError as e:
raise RuntimeError(f"Error running docker logs: {e}")
subscription_pattern = r'Ignored subscription creation.*id=(\d+).*err=([^\s]+)'
subscription_pattern = r'\[info\s*\].*Ignored subscription creation.*id=(\d+).*err=(.+?)(?=\s+\[|$)'
matches = list(re.finditer(subscription_pattern, log_content))
if not matches:
@ -147,7 +147,7 @@ def check_logs(log_handler):
last_match = matches[-1]
last_id = last_match.group(1)
error_type = last_match.group(2)
error_type = last_match.group(2).strip()
if error_type == "Container-set not supported":
status = f"Container error (id: {last_id})"