|
3 | 3 | import base64 |
4 | 4 | import ipaddress |
5 | 5 | import json |
| 6 | +import logging |
6 | 7 | import os |
7 | 8 | import pathlib |
8 | 9 | import ssl |
|
14 | 15 | from ._config import KubeConfigSet |
15 | 16 | from ._types import PathType |
16 | 17 |
|
| 18 | +logger = logging.getLogger(__name__) |
| 19 | + |
17 | 20 |
|
18 | 21 | class KubeAuth: |
19 | 22 | """Load kubernetes auth from kubeconfig, service account, or url.""" |
@@ -69,6 +72,7 @@ async def reauthenticate(self) -> None: |
69 | 72 | """Reauthenticate with the server.""" |
70 | 73 | async with self.__auth_lock: |
71 | 74 | if self._url: |
| 75 | + logger.debug("URL specified manually") |
72 | 76 | self.server = self._url |
73 | 77 | else: |
74 | 78 | if self._kubeconfig_path_or_dict is not False: |
@@ -110,6 +114,7 @@ def namespace(self, value: str): |
110 | 114 |
|
111 | 115 | async def _load_kubeconfig(self) -> None: |
112 | 116 | """Load kubernetes auth from kubeconfig.""" |
| 117 | + logger.debug("Loading kubeconfig") |
113 | 118 | if isinstance(self._kubeconfig_path_or_dict, str) or isinstance( |
114 | 119 | self._kubeconfig_path_or_dict, pathlib.Path |
115 | 120 | ): |
@@ -254,6 +259,7 @@ async def _load_kubeconfig(self) -> None: |
254 | 259 |
|
255 | 260 | async def _load_service_account(self) -> None: |
256 | 261 | """Load credentials from service account.""" |
| 262 | + logger.debug("Loading service account") |
257 | 263 | self._serviceaccount = os.path.expanduser(self._serviceaccount) |
258 | 264 | if not os.path.isdir(self._serviceaccount): |
259 | 265 | return |
|
0 commit comments