From fd1736f3e79c2c815c10ddafd4514257145b6f4e Mon Sep 17 00:00:00 2001 From: Gaz Iqbal Date: Fri, 22 Mar 2019 17:00:09 -0700 Subject: [PATCH] fixed KubernetesClientConfiguration.BuildConfigFromConfigFile not respecting the currentContext parameter (#269) --- .../KubernetesClientConfiguration.ConfigFile.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs b/src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs index 84a23a6..b7f67dc 100644 --- a/src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs +++ b/src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs @@ -48,14 +48,15 @@ namespace k8s /// /// Initializes a new instance of the from config file /// - /// kube api server endpoint /// Explicit file path to kubeconfig. Set to null to use the default file path + /// override the context in config file, set null if do not want to override + /// kube api server endpoint /// When , the paths in the kubeconfig file will be considered to be relative to the directory in which the kubeconfig /// file is located. When , the paths will be considered to be relative to the current working directory. public static KubernetesClientConfiguration BuildConfigFromConfigFile(string kubeconfigPath = null, string currentContext = null, string masterUrl = null, bool useRelativePaths = true) { - return BuildConfigFromConfigFile(new FileInfo(kubeconfigPath ?? KubeConfigDefaultLocation), null, + return BuildConfigFromConfigFile(new FileInfo(kubeconfigPath ?? KubeConfigDefaultLocation), currentContext, masterUrl, useRelativePaths); } @@ -363,7 +364,7 @@ namespace k8s return LoadKubeConfigAsync(kubeconfigPath, useRelativePaths).GetAwaiter().GetResult(); } - // + /// /// Loads Kube Config /// /// Kube config file contents @@ -402,7 +403,7 @@ namespace k8s return LoadKubeConfigAsync(kubeconfig, useRelativePaths).GetAwaiter().GetResult(); } - // + /// /// Loads Kube Config /// /// Kube config file contents stream