From fa263df6e1130a2ed0c6cb208fe17021fbd30a1e Mon Sep 17 00:00:00 2001 From: Cary Goltermann Date: Wed, 7 Aug 2024 14:20:54 -0400 Subject: [PATCH] Check provider_config.use_internal_ips --- sky/provision/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sky/provision/common.py b/sky/provision/common.py index a588fbe94e8..6a5f4ac9ac8 100644 --- a/sky/provision/common.py +++ b/sky/provision/common.py @@ -205,7 +205,13 @@ def _get_ips(self, use_internal_ips: bool) -> List[str]: def get_feasible_ips(self, force_internal_ips: bool = False) -> List[str]: """Get external IPs if they exist, otherwise get internal ones.""" - return self._get_ips(not self.has_external_ips() or force_internal_ips) + if self.provider_config is not None: + use_internal_ips = self.provider_config.get('use_internal_ips', + False) + else: + use_internal_ips = False + return self._get_ips(use_internal_ips or not self.has_external_ips() or + force_internal_ips) def get_ssh_ports(self) -> List[int]: """Get the SSH port of all the instances."""