Skip to content
Open
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
7 changes: 7 additions & 0 deletions oks_cli/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ def cluster_logout(ctx, profile):
"""Clear the current default cluster selection."""
_, _, profile = ctx_update(ctx, None, None, profile)
login_profile(profile)

current_cluster = get_cluster_id()

if not current_cluster:
click.echo("You are not connected to any cluster.")
return

set_cluster_id("")
click.echo("Logged out from the current cluster")

Expand Down
7 changes: 7 additions & 0 deletions oks_cli/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ def project_logout(ctx, profile):
"""Unset the current default project and log out."""
_, _, profile = ctx_update(ctx, None, None, profile)
login_profile(profile)

current_project = get_project_id()

if not current_project:
click.echo("You are not connected to any project.")
return

set_project_id("")
set_cluster_id("")
click.echo("Logged out from the current project")
Expand Down