Skip to content

Commit 62366ee

Browse files
authored
Merge pull request #246 from david0/fix-load-config
Fix load_config: expand ~
2 parents 0d4f822 + e2ba3fb commit 62366ee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

config/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import os
15+
from os.path import exists, expanduser
1616

1717
from .config_exception import ConfigException
1818
from .incluster_config import load_incluster_config
@@ -33,8 +33,7 @@ def load_config(**kwargs):
3333
can be passed to either load_kube_config or
3434
load_incluster_config functions.
3535
"""
36-
if "kube_config_path" in kwargs.keys() or os.path.exists(
37-
KUBE_CONFIG_DEFAULT_LOCATION):
36+
if "kube_config_path" in kwargs.keys() or exists(expanduser(KUBE_CONFIG_DEFAULT_LOCATION)):
3837
load_kube_config(**kwargs)
3938
else:
4039
print(

0 commit comments

Comments
 (0)