From 02decfe14d99f7b0dff8a872955f70e3cef87876 Mon Sep 17 00:00:00 2001 From: Victor Skvortsov Date: Mon, 29 Jul 2024 15:04:36 +0500 Subject: [PATCH] Require nodes or ssh_config in fleet configurations (#1464) --- src/dstack/_internal/server/services/fleets.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dstack/_internal/server/services/fleets.py b/src/dstack/_internal/server/services/fleets.py index 9d1165e1d..d578ac27c 100644 --- a/src/dstack/_internal/server/services/fleets.py +++ b/src/dstack/_internal/server/services/fleets.py @@ -325,6 +325,8 @@ def _remove_fleet_spec_sensitive_info(spec: FleetSpec): def _validate_fleet_spec(spec: FleetSpec): if spec.configuration.name is not None: validate_dstack_resource_name(spec.configuration.name) + if spec.configuration.ssh_config is None and spec.configuration.nodes is None: + raise ServerClientError("No ssh_config or nodes specified") if spec.configuration.ssh_config is not None: for host in spec.configuration.ssh_config.hosts: if isinstance(host, str):