From f7f9c1cebd9b09b2a6f5b7c69bd7e22043d5bb43 Mon Sep 17 00:00:00 2001 From: Jacob Tomlinson Date: Tue, 13 Feb 2024 18:05:08 +0100 Subject: [PATCH] Only load service account of kubeconfig was not found (#311) --- kr8s/_auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kr8s/_auth.py b/kr8s/_auth.py index c8d6af86..ac1833ad 100644 --- a/kr8s/_auth.py +++ b/kr8s/_auth.py @@ -58,7 +58,7 @@ async def reauthenticate(self) -> None: else: if self._kubeconfig is not False: await self._load_kubeconfig() - if self._serviceaccount: + if self._serviceaccount and not self.server: await self._load_service_account() if not self.server: raise ValueError("Unable to find valid credentials")