From fae047f6ae387a1daa2312d7a59282b660405ac4 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Fri, 24 Mar 2023 14:54:52 -0700 Subject: [PATCH] Make sky status -r updates the owner of the cluster (#1809) * update the owner list if the owner identity is less than the current one * Update the comments * rephrase --- sky/backends/backend_utils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sky/backends/backend_utils.py b/sky/backends/backend_utils.py index a37ea9abc97..3d9c463cabc 100644 --- a/sky/backends/backend_utils.py +++ b/sky/backends/backend_utils.py @@ -1768,8 +1768,16 @@ def check_owner_identity(cluster_name: str) -> None: f'The cluster was owned by {owner_identity}, but ' f'a new identity {current_user_identity} is activated. We still ' 'allow the operation as the two identities are likely to have ' - 'the same access to the cluster, but please be aware that ' - 'this is not guaranteed.') + 'the same access to the cluster. Please be aware that this can ' + 'cause unexpected cluster leakage if the two identities are not ' + 'actually equivalent (e.g., belong to the same person).' + ) + if i != 0 or len(owner_identity) != len(current_user_identity): + # We update the owner of a cluster, when: + # 1. The strictest identty (i.e. the first one) does not + # match, but the latter ones match. + # 2. The length of the two identities are different, which + # will only happen when the cluster is launched before #1808. # Update the user identity to avoid showing the warning above # again. global_user_state.set_owner_identity_for_cluster(