diff --git a/docs/source/reference/config.rst b/docs/source/reference/config.rst index d5ee4d2134a..4cec951216c 100644 --- a/docs/source/reference/config.rst +++ b/docs/source/reference/config.rst @@ -31,11 +31,9 @@ Available fields and semantics: cpus: 4+ # number of vCPUs, max concurrent spot jobs = 2 * cpus disk_size: 100 - # Allow list for clouds to be used in `sky check` + # Allow list for clouds to be used # - # This field is used to restrict the clouds that SkyPilot will check and use - # when running `sky check`. Any cloud already enabled but not specified here - # will be disabled on the next `sky check` run. + # This field is used to restrict the clouds that SkyPilot will check and use. # If this field is not set, SkyPilot will check and use all supported clouds. # # Default: null (use all supported clouds). diff --git a/sky/clouds/service_catalog/__init__.py b/sky/clouds/service_catalog/__init__.py index d28b530ff06..f71e804b34f 100644 --- a/sky/clouds/service_catalog/__init__.py +++ b/sky/clouds/service_catalog/__init__.py @@ -4,6 +4,7 @@ import typing from typing import Dict, List, Optional, Set, Tuple, Union +from sky import skypilot_config from sky.clouds.service_catalog.config import fallback_to_default_catalog from sky.clouds.service_catalog.constants import ALL_CLOUDS from sky.clouds.service_catalog.constants import CATALOG_DIR @@ -20,7 +21,12 @@ def _map_clouds_catalog(clouds: CloudFilter, method_name: str, *args, **kwargs): if clouds is None: - clouds = list(ALL_CLOUDS) + # Honor the allowed_clouds config when clouds is not specified. + # Note: no op if disabled clouds are specified, since Optimizer will + # error out to user in the end. + clouds = typing.cast( + List[str], + skypilot_config.get_nested(('allowed_clouds',), list(ALL_CLOUDS))) # TODO(hemil): Remove this once the common service catalog # functions are refactored from clouds/kubernetes.py to