From 3ff79da50cd4f02cb789eee12461ad70ba151303 Mon Sep 17 00:00:00 2001 From: ACXLM Date: Tue, 2 Jun 2020 13:55:43 +0800 Subject: [PATCH] fix cfg is none, load kube config error Signed-off-by: zhu hui --- config/kube_config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/kube_config.py b/config/kube_config.py index 43676728..cb7a9bb3 100644 --- a/config/kube_config.py +++ b/config/kube_config.py @@ -663,9 +663,8 @@ def load_config(self, path): for item in ('clusters', 'contexts', 'users'): config_merged[item] = [] self.config_merged = ConfigNode(path, config_merged, path) - for item in ('clusters', 'contexts', 'users'): - self._merge(item, config.get(item, {}), path) + self._merge(item, config.get(item, []) or [], path) self.config_files[path] = config def _merge(self, item, add_cfg, path):