o
    ³3Ihç  ã                   @   sT   d dl mZmZ ddlmZ ddlmZ ddlmZm	Z	m
Z
mZmZmZ dd„ ZdS )	é    )ÚexistsÚ
expanduseré   )ÚConfigException)Úload_incluster_config)ÚKUBE_CONFIG_DEFAULT_LOCATIONÚlist_kube_config_contextsÚload_kube_configÚload_kube_config_from_dictÚnew_client_from_configÚnew_client_from_config_dictc                  K   sŠ   d|   ¡ v rtdi | ¤Ž dS d|   ¡ v r&|  dd¡| d< tdi | ¤Ž dS tttƒƒr5tdi | ¤Ž dS td t¡ƒ tdi | ¤Ž dS )a©  
    Wrapper function to load the kube_config.
    It will initially try to load_kube_config from provided path,
    then check if the KUBE_CONFIG_DEFAULT_LOCATION exists
    If neither exists, it will fall back to load_incluster_config
    and inform the user accordingly.

    :param kwargs: A combination of all possible kwargs that
    can be passed to either load_kube_config or
    load_incluster_config functions.
    Úconfig_fileÚkube_config_pathNzukube_config_path not provided and default location ({0}) does not exist. Using inCluster Config. This might not work.© )	Úkeysr	   Úpopr   r   r   ÚprintÚformatr   )Úkwargsr   r   úZ/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/kubernetes/config/__init__.pyÚload_config   s   ür   N)Úos.pathr   r   Úconfig_exceptionr   Úincluster_configr   Úkube_configr   r   r	   r
   r   r   r   r   r   r   r   Ú<module>   s
    