diff --git a/performance_measurement/check_utils.py b/performance_measurement/check_utils.py index b0d95ccfa..1b9ab161e 100644 --- a/performance_measurement/check_utils.py +++ b/performance_measurement/check_utils.py @@ -1,3 +1,4 @@ +import logging from typing import List import kubernetes.client.models as k8s_models @@ -89,8 +90,11 @@ def check_tolerations( def check_affinity(desired_affinity: dict, sts_object: k8s_models.V1StatefulSet) -> bool: # check if affinity match current_affinity = sts_object["spec"]["template"]["spec"]["affinity"] + if desired_affinity is None or desired_affinity == {}: + return current_affinity is None or current_affinity == {} deepdiff = DeepDiff(desired_affinity, current_affinity, ignore_order=True) if deepdiff: + logging.info("Affinity not match: %s", deepdiff) return False else: return True