Skip to content

Commit a607fb2

Browse files
committed
Handle backward compatibility
1 parent 01e6097 commit a607fb2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/dstack/_internal/core/compatibility/fleets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ def get_fleet_spec_excludes(fleet_spec: FleetSpec) -> Optional[IncludeExcludeDic
5757
profile_excludes.add("startup_order")
5858
if profile.stop_criteria is None:
5959
profile_excludes.add("stop_criteria")
60+
if profile.schedule is None:
61+
profile_excludes.add("schedule")
6062
if configuration_excludes:
6163
spec_excludes["configuration"] = configuration_excludes
6264
if profile_excludes:

src/dstack/_internal/core/compatibility/runs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ def get_run_spec_excludes(run_spec: RunSpec) -> IncludeExcludeDictType:
126126
configuration_excludes["files"] = True
127127
if not run_spec.file_archives:
128128
spec_excludes["file_archives"] = True
129+
if configuration.schedule is None:
130+
configuration_excludes["schedule"] = True
131+
if profile is not None and profile.schedule is None:
132+
profile_excludes.add("schedule")
129133

130134
if configuration_excludes:
131135
spec_excludes["configuration"] = configuration_excludes

0 commit comments

Comments
 (0)