Skip to content

Commit 9565638

Browse files
authored
make kube config path os agnostic (#307)
This is because the current default will not work on windows. So it's better to delegate this to pathlib
1 parent b93a4e5 commit 9565638

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kubernetes_asyncio/config/kube_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import json
2121
import logging
2222
import os
23+
import pathlib
2324
import platform
2425
import tempfile
2526

@@ -34,7 +35,7 @@
3435
from .openid import OpenIDRequestor
3536

3637
EXPIRY_SKEW_PREVENTION_DELAY = datetime.timedelta(minutes=5)
37-
KUBE_CONFIG_DEFAULT_LOCATION = os.environ.get('KUBECONFIG', '~/.kube/config')
38+
KUBE_CONFIG_DEFAULT_LOCATION = os.environ.get('KUBECONFIG', (pathlib.Path.home() / '.kube/config').as_posix())
3839
ENV_KUBECONFIG_PATH_SEPARATOR = ';' if platform.system() == 'Windows' else ':'
3940
PROVIDER_TYPE_OIDC = 'oidc'
4041
_temp_files = {}

0 commit comments

Comments
 (0)