diff --git a/cleanup_k8s.py b/cleanup_k8s.py index db4b1bb3..8d1a226e 100644 --- a/cleanup_k8s.py +++ b/cleanup_k8s.py @@ -1,13 +1,19 @@ +import os import logging from ocw.lib.gke import GKE from ocw.lib.eks import EKS from ocw.lib.aks import AKS from ocw.enums import ProviderChoice -from webui.PCWConfig import PCWConfig +from webui.PCWConfig import PCWConfig, ConfigFile, CONFIG_FILE def main(): + loglevel = 'INFO' + if os.path.exists(CONFIG_FILE): + loglevel = ConfigFile().get('default/loglevel', loglevel) + logger = logging.getLogger(__name__) + logging.basicConfig(level=loglevel) for namespace in PCWConfig.get_namespaces_for('k8sclusters'): providers = PCWConfig.get_providers_for("k8sclusters", namespace)