Skip to content

Commit

Permalink
Fix incluster auth handling
Browse files Browse the repository at this point in the history
  • Loading branch information
romilbhardwaj committed Dec 10, 2024
1 parent 4e627bd commit 404acc4
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit 404acc4

Please sign in to comment.