Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/dstack/_internal/core/models/fleets.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ class FleetNodesSpec(CoreModel):
),
] = None

def dict(self, *args, **kwargs) -> Dict:
# super() does not work with pydantic-duality
res = CoreModel.dict(self, *args, **kwargs)
# For backward compatibility with old clients
# that do not ignore extra fields due to https://github.com/dstackai/dstack/issues/3066
if hasattr(res, "target") and res["target"] == res["min"]:
del res["target"]
return res

@root_validator(pre=True)
def set_min_and_target_defaults(cls, values):
min_ = values.get("min")
Expand Down
Loading