Change KUBE_CONFIG_DEFAULT_LOCATION to use pathlib.Path.home instead of hard-coded "~". This is a more "Pythonic" way of setting that value.

This commit is contained in:
Moshe Shitrit 2020-12-25 12:11:42 -05:00
parent fdc9907ff0
commit 7199c14a8d

View File

@ -19,6 +19,7 @@ import datetime
import json
import logging
import os
import pathlib
import platform
import subprocess
import tempfile
@ -45,7 +46,7 @@ except ImportError:
pass
EXPIRY_SKEW_PREVENTION_DELAY = datetime.timedelta(minutes=5)
KUBE_CONFIG_DEFAULT_LOCATION = os.environ.get('KUBECONFIG', '~/.kube/config')
KUBE_CONFIG_DEFAULT_LOCATION = os.environ.get('KUBECONFIG', f'{pathlib.Path.home()}/.kube/config')
ENV_KUBECONFIG_PATH_SEPARATOR = ';' if platform.system() == 'Windows' else ':'
_temp_files = {}