@@ -39,6 +39,7 @@ public static KubernetesClientConfiguration BuildConfigFromConfigFile(string kub
39
39
}
40
40
41
41
/// <summary>
42
+ /// Initializes a new instance of the <see cref="KubernetesClientConfiguration" /> from config file
42
43
/// </summary>
43
44
/// <param name="kubeconfig">Fileinfo of the kubeconfig, cannot be null</param>
44
45
/// <param name="currentContext">override the context in config file, set null if do not want to override</param>
@@ -60,10 +61,11 @@ public static KubernetesClientConfiguration BuildConfigFromConfigFile(FileInfo k
60
61
}
61
62
62
63
/// <summary>
64
+ /// Initializes a new instance of the <see cref="KubernetesClientConfiguration" /> from config file
63
65
/// </summary>
64
- /// <param name="kubeconfig">Fileinfo of the kubeconfig, cannot be null, whitespaced or empty </param>
65
- /// <param name="currentContext">override the context in config file , set null if do not want to override</param>
66
- /// <param name="masterUrl">overrider kube api server endpoint, set null if do not want to override</param>
66
+ /// <param name="kubeconfig">Stream of the kubeconfig, cannot be null</param>
67
+ /// <param name="currentContext">Override the current context in config, set null if do not want to override</param>
68
+ /// <param name="masterUrl">Override the Kubernetes API server endpoint, set null if do not want to override</param>
67
69
public static KubernetesClientConfiguration BuildConfigFromConfigFile ( Stream kubeconfig ,
68
70
string currentContext = null , string masterUrl = null )
69
71
{
@@ -85,6 +87,15 @@ public static KubernetesClientConfiguration BuildConfigFromConfigFile(Stream kub
85
87
return k8SConfiguration ;
86
88
}
87
89
90
+ /// <summary>
91
+ /// Initializes a new instance of <see cref="KubernetesClientConfiguration"/> from pre-loaded config object.
92
+ /// </summary>
93
+ /// <param name="k8sConfig">A <see cref="K8SConfiguration"/>, for example loaded from <see cref="LoadKubeConfigAsync(string, bool)" /></param>
94
+ /// <param name="currentContext">Override the current context in config, set null if do not want to override</param>
95
+ /// <param name="masterUrl">Override the Kubernetes API server endpoint, set null if do not want to override</param>
96
+ public static KubernetesClientConfiguration BuildConfigFromConfigObject ( K8SConfiguration k8SConfig , string currentContext = null , string masterUrl = null )
97
+ => GetKubernetesClientConfiguration ( currentContext , masterUrl , k8SConfig ) ;
98
+
88
99
private static KubernetesClientConfiguration GetKubernetesClientConfiguration ( string currentContext , string masterUrl , K8SConfiguration k8SConfig )
89
100
{
90
101
var k8SConfiguration = new KubernetesClientConfiguration ( ) ;
0 commit comments