Skip to content

Commit 914c78b

Browse files
authored
Fix reading incorrect stream in ExecuteExternalCommand (#444)
1 parent b32f9d1 commit 914c78b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,14 @@ public static string RenewAzureToken(string tenantId, string clientId, string ap
420420
/// https://github.com/kubernetes-client/python-base/blob/master/config/exec_provider.py
421421
/// </summary>
422422
/// <param name="config">The external command execution configuration</param>
423-
/// <returns>The token received from the external commmand execution</returns>
423+
/// <returns>The token received from the external command execution</returns>
424424
public static string ExecuteExternalCommand(ExternalExecution config)
425425
{
426426
var execInfo = new Dictionary<string, dynamic>
427427
{
428428
{"apiVersion", config.ApiVersion },
429429
{"kind", "ExecCredentials" },
430-
{"spec", new Dictionary<string, bool> {{"interactive", Environment.UserInteractive } } },
430+
{"spec", new Dictionary<string, bool> { {"interactive", Environment.UserInteractive } } },
431431
};
432432

433433
var process = new Process();
@@ -464,7 +464,7 @@ public static string ExecuteExternalCommand(ExternalExecution config)
464464
}
465465

466466
var stdout = process.StandardOutput.ReadToEnd();
467-
var stderr = process.StandardOutput.ReadToEnd();
467+
var stderr = process.StandardError.ReadToEnd();
468468
if (string.IsNullOrWhiteSpace(stderr) == false)
469469
{
470470
throw new KubeConfigException($"external exec failed due to: {stderr}");
@@ -660,7 +660,7 @@ private static string GetFullPath(K8SConfiguration configuration, string path)
660660
/// <param name="mergek8SConfig">The <see cref="K8SConfiguration"/> to merge from</param>
661661
private static void MergeKubeConfig(K8SConfiguration basek8SConfig, K8SConfiguration mergek8SConfig)
662662
{
663-
// For scalar values, prefer local values
663+
// For scalar values, prefer local values
664664
basek8SConfig.CurrentContext = basek8SConfig.CurrentContext ?? mergek8SConfig.CurrentContext;
665665
basek8SConfig.FileName = basek8SConfig.FileName ?? mergek8SConfig.FileName;
666666

0 commit comments

Comments
 (0)