Skip to content

Commit

Permalink
dont set namespace when switching (kubeconfig) context (#669)
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Dietisheim <[email protected]>
  • Loading branch information
adietish committed Nov 21, 2023
1 parent fd5082f commit 56781f8
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ open class ClientConfig(private val client: Client, private val executor: Execut
return@supplyAsync false
}
val fromFile = kubeConfig.load() ?: return@supplyAsync false
val currentContextInFile = KubeConfigUtils.getCurrentContext(fromFile)
if (setCurrentContext(
currentContext,
currentContextInFile,
KubeConfigUtils.getCurrentContext(fromFile),
fromFile
).or( // no short-circuit
setCurrentNamespace(
currentContext?.context,
currentContextInFile?.context
KubeConfigUtils.getCurrentContext(fromFile)?.context
)
)
) {
Expand Down

0 comments on commit 56781f8

Please sign in to comment.