Skip to content

Commit 6000c7b

Browse files
committed
Force buffer flush for non-infinite timeout
1 parent 0380f95 commit 6000c7b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs

+6
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,12 @@ public static ExecCredentialResponse ExecuteExternalCommand(ExternalExecution co
553553
throw new KubeConfigException("external exec failed due to timeout");
554554
}
555555

556+
// Force flush the output buffer to avoid case of missing data
557+
if (ExecTimeout != Timeout.InfiniteTimeSpan)
558+
{
559+
process.WaitForExit();
560+
}
561+
556562
var responseObject = KubernetesJson.Deserialize<ExecCredentialResponse>(output.ToString());
557563

558564
if (responseObject == null || responseObject.ApiVersion != config.ApiVersion)

0 commit comments

Comments
 (0)