From 15c4d897454b44ca61f9b85d966e657edb2f4490 Mon Sep 17 00:00:00 2001 From: Ivan Josipovic <9521987+IvanJosipovic@users.noreply.github.com> Date: Tue, 18 Apr 2023 13:56:49 -0700 Subject: [PATCH] chore: fix logic --- .../KubernetesClientConfiguration.ConfigFile.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs b/src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs index 4faac6fb6..8ab64e527 100644 --- a/src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs +++ b/src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs @@ -569,6 +569,11 @@ public static ExecCredentialResponse ExecuteExternalCommand(ExternalExecution co // Wait for a maximum of 5 seconds, if a response takes longer probably something went wrong... if (!process.WaitForExitAsync().Wait(TimeSpan.FromSeconds(5))) { + if (!string.IsNullOrWhiteSpace(stderr)) + { + throw new KubeConfigException($"external exec failed due to: {stderr}"); + } + throw new KubeConfigException("external exec failed due to timeout"); }