diff --git a/config/__init__.py b/config/__init__.py index 83bd581c..b57bf185 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -15,4 +15,4 @@ from .config_exception import ConfigException from .incluster_config import load_incluster_config from .kube_config import (list_kube_config_contexts, load_kube_config, - new_client_from_config, load_kube_config_from_dict) + load_kube_config_from_dict, new_client_from_config) diff --git a/config/kube_config.py b/config/kube_config.py index 423178b6..892e9043 100644 --- a/config/kube_config.py +++ b/config/kube_config.py @@ -688,6 +688,7 @@ def save_config(self, path): yaml.safe_dump(self.config_files[path], f, default_flow_style=False) + def _get_kube_config_loader_for_yaml_file( filename, persist_config=False, **kwargs): return _get_kube_config_loader( @@ -695,6 +696,7 @@ def _get_kube_config_loader_for_yaml_file( persist_config=persist_config, **kwargs) + def _get_kube_config_loader( filename=None, config_dict=None, @@ -719,6 +721,7 @@ def _get_kube_config_loader( config_base_path=None, **kwargs) + def list_kube_config_contexts(config_file=None): if config_file is None: @@ -757,9 +760,10 @@ def load_kube_config(config_file=None, context=None, else: loader.load_and_set(client_configuration) + def load_kube_config_from_dict(config_dict, context=None, - client_configuration=None, - persist_config=True): + client_configuration=None, + persist_config=True): """Loads authentication and cluster information from config_dict file and stores them in kubernetes.client.configuration. @@ -788,6 +792,7 @@ def load_kube_config_from_dict(config_dict, context=None, else: loader.load_and_set(client_configuration) + def new_client_from_config( config_file=None, context=None, diff --git a/config/kube_config_test.py b/config/kube_config_test.py index 25508d8b..3dca177c 100644 --- a/config/kube_config_test.py +++ b/config/kube_config_test.py @@ -1380,6 +1380,7 @@ def test__get_kube_config_loader_dict_no_persist(self): config_dict=self.TEST_KUBE_CONFIG) self.assertIsNone(actual._config_persister) + class TestKubernetesClientConfiguration(BaseTestCase): # Verifies properties of kubernetes.client.Configuration. # These tests guard against changes to the upstream configuration class,