Skip to content

Commit

Permalink
Do not detect gateway configuration changes on default changes
Browse files Browse the repository at this point in the history
  • Loading branch information
r4victor committed Feb 3, 2025
1 parent caaf2ff commit 2f35571
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit 2f35571

Please sign in to comment.