Skip to content

Commit

Permalink
fixed KubernetesClientConfiguration.BuildConfigFromConfigFile not res…
Browse files Browse the repository at this point in the history
…pecting the currentContext parameter (#269)
  • Loading branch information
gaziqbal authored and k8s-ci-robot committed Mar 23, 2019
1 parent bf995e5 commit fd1736f
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -48,14 +48,15 @@ public partial class KubernetesClientConfiguration
/// <summary>
/// Initializes a new instance of the <see cref="KubernetesClientConfiguration" /> from config file
/// </summary>
/// <param name="masterUrl">kube api server endpoint</param>
/// <param name="kubeconfigPath">Explicit file path to kubeconfig. Set to null to use the default file path</param>
/// <param name="currentContext">override the context in config file, set null if do not want to override</param>
/// <param name="masterUrl">kube api server endpoint</param>
/// <param name="useRelativePaths">When <see langword="true"/>, the paths in the kubeconfig file will be considered to be relative to the directory in which the kubeconfig
/// file is located. When <see langword="false"/>, the paths will be considered to be relative to the current working directory.</param>
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);
}

Expand Down Expand Up @@ -363,7 +364,7 @@ public static K8SConfiguration LoadKubeConfig(string kubeconfigPath = null, bool
return LoadKubeConfigAsync(kubeconfigPath, useRelativePaths).GetAwaiter().GetResult();
}

// <summary>
/// <summary>
/// Loads Kube Config
/// </summary>
/// <param name="kubeconfig">Kube config file contents</param>
Expand Down Expand Up @@ -402,7 +403,7 @@ public static K8SConfiguration LoadKubeConfig(FileInfo kubeconfig, bool useRelat
return LoadKubeConfigAsync(kubeconfig, useRelativePaths).GetAwaiter().GetResult();
}

// <summary>
/// <summary>
/// Loads Kube Config
/// </summary>
/// <param name="kubeconfigStream">Kube config file contents stream</param>
Expand Down

0 comments on commit fd1736f

Please sign in to comment.