Skip to content

Commit d0132d1

Browse files
committed
Fix SSH fleet with proxy_jump in-place update check
Fixes: #3611
1 parent f934bb4 commit d0132d1

File tree

1 file changed

+12
-4
lines changed
  • src/dstack/_internal/server/services

1 file changed

+12
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,10 +1074,18 @@ def _calculate_ssh_hosts_changes(
10741074
if isinstance(current_host, str) or isinstance(new_host, str):
10751075
if current_host != new_host:
10761076
changed_hosts.add(host)
1077-
elif diff_models(
1078-
current_host, new_host, reset={"identity_file": True, "proxy_jump": {"identity_file"}}
1079-
):
1080-
changed_hosts.add(host)
1077+
else:
1078+
current_host = copy_model(current_host, reset={"identity_file"})
1079+
new_host = copy_model(new_host, reset={"identity_file"})
1080+
# XXX: cannot use copy_model() or diff_models() with
1081+
# `reset={..., "proxy_jump": {"identity_file"}}`
1082+
# as SSHProxyParams.identity_file has no default value
1083+
if current_host.proxy_jump is not None:
1084+
current_host.proxy_jump.identity_file = ""
1085+
if new_host.proxy_jump is not None:
1086+
new_host.proxy_jump.identity_file = ""
1087+
if diff_models(current_host, new_host):
1088+
changed_hosts.add(host)
10811089
return added_hosts, removed_hosts, changed_hosts
10821090

10831091

0 commit comments

Comments
 (0)