Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Serve] Allow purging controller for identity mismatch #3094

Merged
merged 1 commit into from
Feb 15, 2024
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
12 changes: 11 additions & 1 deletion sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3125,9 +3125,19 @@ def _down_or_stop_clusters(
controller_name)
assert controller is not None
hint_or_raise = _CONTROLLER_TO_HINT_OR_RAISE[controller]
hint_or_raise(controller_name)
try:
hint_or_raise(controller_name)
except exceptions.ClusterOwnerIdentityMismatchError as e:
if purge:
click.echo(common_utils.format_exception(e))
else:
raise
confirm_str = 'delete'
input_prefix = ('Since --purge is set, errors will be ignored '
'and controller will be removed from '
'local state.\n') if purge else ''
user_input = click.prompt(
f'{input_prefix}'
f'To proceed, please type {colorama.Style.BRIGHT}'
f'{confirm_str!r}{colorama.Style.RESET_ALL}',
type=str)
Expand Down
Loading