Skip to content

Commit 3cfbc94

Browse files
committed
chore: simplify logic
1 parent 978b0d0 commit 3cfbc94

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -566,13 +566,8 @@ public static ExecCredentialResponse ExecuteExternalCommand(ExternalExecution co
566566
}
567567

568568
// Wait for a maximum of 5 seconds, if a response takes longer probably something went wrong...
569-
if (!process.WaitForExit(5000))
569+
if (!process.WaitForExit(5000) && string.IsNullOrWhiteSpace(stderr))
570570
{
571-
if (!string.IsNullOrWhiteSpace(stderr))
572-
{
573-
throw new KubeConfigException($"external exec failed due to: {stderr}");
574-
}
575-
576571
throw new KubeConfigException("external exec failed due to timeout");
577572
}
578573

0 commit comments

Comments
 (0)