Skip to content

Commit

Permalink
[Core][RunPod] Fix list instances in RunPod Provisioner (#3878)
Browse files Browse the repository at this point in the history
* fix

* simplify

* Revert "simplify"

This reverts commit 1057b90.
  • Loading branch information
cblmemo authored Aug 28, 2024
1 parent c7ee6a2 commit f73debf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sky/provision/runpod/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ def list_instances() -> Dict[str, Dict[str, Any]]:
info['name'] = instance['name']
info['port2endpoint'] = {}

if instance['desiredStatus'] == 'RUNNING' and instance.get('runtime'):
# Sometimes when the cluster is in the process of being created,
# the `port` field in the runtime is None and we need to check for it.
if (instance['desiredStatus'] == 'RUNNING' and
instance.get('runtime') and
instance.get('runtime').get('ports')):
for port in instance['runtime']['ports']:
if port['isIpPublic']:
if port['privatePort'] == 22:
Expand Down

0 comments on commit f73debf

Please sign in to comment.