Skip to content

Commit da447cd

Browse files
committed
only tag node if needed
1 parent 4eeaa5c commit da447cd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

services/autoscaling/src/simcore_service_autoscaling/utils/utils_docker.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,14 @@ async def tag_node(
521521
tags: dict[DockerLabelKey, str],
522522
available: bool,
523523
) -> Node:
524+
assert node.spec # nosec
525+
if (node.spec.labels == tags) and (
526+
(node.spec.availability is Availability.active) == available
527+
):
528+
# nothing to do
529+
return node
524530
with log_context(
525-
logger, logging.DEBUG, msg=f"tagging {node.id=} with {tags=} and {available=}"
531+
logger, logging.DEBUG, msg=f"tag {node.id=} with {tags=} and {available=}"
526532
):
527533
assert node.id # nosec
528534

0 commit comments

Comments
 (0)