Merge pull request #246 from david0/fix-load-config

Fix load_config: expand ~
This commit is contained in:
Kubernetes Prow Robot 2021-07-12 10:28:48 -07:00 committed by GitHub
commit 62366eecf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from os.path import exists, expanduser
from .config_exception import ConfigException
from .incluster_config import load_incluster_config
@ -33,8 +33,7 @@ def load_config(**kwargs):
can be passed to either load_kube_config or
load_incluster_config functions.
"""
if "kube_config_path" in kwargs.keys() or os.path.exists(
KUBE_CONFIG_DEFAULT_LOCATION):
if "kube_config_path" in kwargs.keys() or exists(expanduser(KUBE_CONFIG_DEFAULT_LOCATION)):
load_kube_config(**kwargs)
else:
print(