Skip to content

Commit 06f8326

Browse files
committed
Support tags and reservation in-place update
1 parent a0839d4 commit 06f8326

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • src/dstack/_internal/server/services

src/dstack/_internal/server/services/fleets.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,8 +1219,11 @@ def _check_can_update_inner(current: M, new: M, updatable_fields: tuple[str, ...
12191219
return diff
12201220

12211221

1222-
@_check_can_update("configuration", "configuration_path")
1222+
@_check_can_update("configuration", "configuration_path", "merged_profile")
12231223
def _check_can_update_fleet_spec(current: FleetSpec, new: FleetSpec, diff: ModelDiff):
1224+
# Allow `merged_profile` only to absorb derived changes from supported configuration updates
1225+
# such as `configuration.reservation` and `configuration.tags`.
1226+
# Direct `profile` updates are still not in-place updatable.
12241227
if "configuration" in diff:
12251228
_check_can_update_fleet_configuration(current.configuration, new.configuration)
12261229

@@ -1235,7 +1238,9 @@ def _check_can_update_fleet_configuration(current: FleetConfiguration, new: Flee
12351238
# TODO: Support best-effort `nodes.target` apply semantics:
12361239
# create missing instances and terminate extra idle instances.
12371240
# Current in-place update only persists `target`; FleetPipeline reconciles `min`/`max`.
1238-
_check_can_update_inner(current, new, ("nodes",))
1241+
#
1242+
# For `reservation` and `tags`, update affects only future provisioning.
1243+
_check_can_update_inner(current, new, ("nodes", "reservation", "tags"))
12391244
return
12401245

12411246
if new_ssh_config is None:

0 commit comments

Comments
 (0)