Skip to content

Conversation

Michaelvll
Copy link
Collaborator

Tested (run the relevant ones):

  • Code formatting: install pre-commit (auto-check on commit) or bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: /smoke-test (CI) or pytest tests/test_smoke.py (local)
  • Relevant individual tests: /smoke-test -k test_name (CI) or pytest tests/test_smoke.py::test_name (local)
  • Backward compatibility: /quicktest-core (CI) or pytest tests/smoke_tests/test_backward_compat.py (local)

Comment on lines -625 to -652
if cloud_name == repr(sky_clouds.Kubernetes()):
# Get enabled contexts for Kubernetes
existing_contexts = sky_clouds.Kubernetes.existing_allowed_contexts()
if not existing_contexts:
return _green_color(cloud_and_capabilities)

# Check if allowed_contexts is explicitly set in config
allowed_contexts = skypilot_config.get_effective_region_config(
cloud='kubernetes',
region=None,
keys=('allowed_contexts',),
default_value=None)

# Format the context info with consistent styling
if allowed_contexts is not None:
contexts_formatted = []
for i, context in enumerate(existing_contexts):
symbol = (ux_utils.INDENT_LAST_SYMBOL
if i == len(existing_contexts) -
1 else ux_utils.INDENT_SYMBOL)
contexts_formatted.append(f'\n {symbol}{context}')
context_info = f' Allowed contexts:{"".join(contexts_formatted)}'
else:
context_info = f' Active context: {existing_contexts[0]}'

return (f'{_green_color(cloud_and_capabilities)}\n'
f' {colorama.Style.DIM}{context_info}'
f'{colorama.Style.RESET_ALL}')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow I just realized this never gets run because of L621-623

Copy link
Collaborator

@SeungjinYang SeungjinYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Michaelvll for the catch!

@Michaelvll Michaelvll merged commit ee7390a into master Sep 30, 2025
19 checks passed
@Michaelvll Michaelvll deleted the remove-unnecessary-k8s-handling branch September 30, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants