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

[k8s] Fix show-gpus when running with incluster auth #4452

Merged
merged 3 commits into from
Dec 11, 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
4 changes: 4 additions & 0 deletions sky/clouds/service_catalog/kubernetes_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ def _list_accelerators(
# clusters defined by allowed_contexts.
if region_filter is None:
context = kubernetes_utils.get_current_kube_config_context_name()
if context is None and kubernetes_utils.is_incluster_config_available():
# If context is None and we are running in a kubernetes pod, use the
# in-cluster context as the current context.
context = kubernetes.in_cluster_context_name()
else:
context = region_filter
if context is None:
Expand Down
Loading