From 56781f846d7466dbce81ecd4a6a5532eb5bfc9a4 Mon Sep 17 00:00:00 2001 From: Andre Dietisheim Date: Tue, 21 Nov 2023 15:41:01 +0100 Subject: [PATCH] dont set namespace when switching (kubeconfig) context (#669) Signed-off-by: Andre Dietisheim --- .../intellij/kubernetes/model/client/ClientConfig.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/redhat/devtools/intellij/kubernetes/model/client/ClientConfig.kt b/src/main/kotlin/com/redhat/devtools/intellij/kubernetes/model/client/ClientConfig.kt index 7320470b5..76f871534 100644 --- a/src/main/kotlin/com/redhat/devtools/intellij/kubernetes/model/client/ClientConfig.kt +++ b/src/main/kotlin/com/redhat/devtools/intellij/kubernetes/model/client/ClientConfig.kt @@ -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 ) ) ) {