Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 10 additions & 1 deletion src/dstack/_internal/cli/services/configurators/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
GatewayStatus,
)
from dstack._internal.core.models.repos.base import Repo
from dstack._internal.core.services.diff import diff_models
from dstack._internal.utils.common import local_time
from dstack.api._public import Client

Expand Down Expand Up @@ -56,7 +57,15 @@ def apply_configuration(
confirm_message += "Create the gateway?"
else:
action_message += f"Found gateway [code]{plan.spec.configuration.name}[/]."
if plan.current_resource.configuration == plan.spec.configuration:
diff = diff_models(
plan.spec.configuration,
plan.current_resource.configuration,
)
changed_fields = list(diff.keys())
if (
plan.current_resource.configuration == plan.spec.configuration
or changed_fields == ["default"]
):
if command_args.yes and not command_args.force:
# --force is required only with --yes,
# otherwise we may ask for force apply interactively.
Expand Down
2 changes: 1 addition & 1 deletion src/dstack/_internal/server/services/fleets.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ async def get_plan(
user: UserModel,
spec: FleetSpec,
) -> FleetPlan:
# TODO: refactor offers logic into a separate module to avoid depending on runs
current_fleet: Optional[Fleet] = None
current_fleet_id: Optional[uuid.UUID] = None
if spec.configuration.name is not None:
Expand All @@ -259,6 +258,7 @@ async def get_plan(
requirements=_get_fleet_requirements(spec),
)
offers = [offer for _, offer in offers_with_backends]
_remove_fleet_spec_sensitive_info(spec)
plan = FleetPlan(
project_name=project.name,
user=user.name,
Expand Down