Skip to content
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
18 changes: 16 additions & 2 deletions sky/provision/kubernetes/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1694,10 +1694,24 @@ def query_instances(

# Get all the pods with the label skypilot-cluster: <cluster_name>
try:
pods = kubernetes.core_api(context).list_namespaced_pod(
logger.debug(
f'Querying k8s api for pods in context: {context} and '
f'namespace: {namespace} with '
f'`skypilot-cluster={cluster_name_on_cloud}` label selector.')

response = kubernetes.core_api(context).list_namespaced_pod(
namespace,
label_selector=f'skypilot-cluster={cluster_name_on_cloud}',
_request_timeout=kubernetes.API_TIMEOUT).items
_request_timeout=kubernetes.API_TIMEOUT)
pods = response.items

# Log response metadata
# pylint: disable=protected-access
logger.debug(
f'Query response for skypilot cluster {cluster_name_on_cloud}: '
f'resource_version={response.metadata.resource_version}, '
f'pod_count={len(pods)}, '
f'continue_token={response.metadata._continue}')
Comment on lines +1710 to +1714
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we just print the entire response, instead of only the part of the members?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, do we want to place this before pods = response.items so that if there is any error getting response.items the logger can print out the message?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in this PR: #7852

except kubernetes.max_retry_error():
with ux_utils.print_exception_no_traceback():
if is_ssh:
Expand Down
Loading