Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gu <[email protected]>
  • Loading branch information
tylergu committed Nov 12, 2023
1 parent 619dd8b commit a937561
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions performance_measurement/check_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from typing import List

import kubernetes.client.models as k8s_models
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a937561

Please sign in to comment.