From 9bf2e09436b10577f92ccc768d12d965a4331340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Henning?= Date: Tue, 14 Nov 2023 17:52:33 +0100 Subject: [PATCH] Add 'true'/'false' operators that ignore threshold --- slo-checker/generic/app/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/slo-checker/generic/app/main.py b/slo-checker/generic/app/main.py index ff9de19b5..4c39d739d 100644 --- a/slo-checker/generic/app/main.py +++ b/slo-checker/generic/app/main.py @@ -59,6 +59,10 @@ def check_result(result, operator: str, threshold): return result > threshold if operator == 'gte': return result >= threshold + if operator == 'true': + return True # Mainly used for testing + if operator == 'false': + return False # Mainly used for testing else: raise ValueError('Invalid operator string.')