Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Run scripts/update-pycodestyle.sh to fix the pycodestyle test failure #200

Merged
merged 1 commit into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
9 changes: 7 additions & 2 deletions config/kube_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,13 +688,15 @@ 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(
filename=filename,
persist_config=persist_config,
**kwargs)


def _get_kube_config_loader(
filename=None,
config_dict=None,
Expand All @@ -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:
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions config/kube_config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down