Skip to content

Commit 19854da

Browse files
overwrite existing external process environment variables to prevent throwing when a key is present that is already set (#520)
1 parent af7be86 commit 19854da

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,8 @@ public static Process CreateRunnableExternalProcess(ExternalExecution config)
442442
{
443443
if (configEnvironmentVariable.ContainsKey("name") && configEnvironmentVariable.ContainsKey("value"))
444444
{
445-
process.StartInfo.EnvironmentVariables.Add(
446-
configEnvironmentVariable["name"],
447-
configEnvironmentVariable["value"]);
445+
var name = configEnvironmentVariable["name"];
446+
process.StartInfo.EnvironmentVariables[name] = configEnvironmentVariable["value"];
448447
}
449448
else
450449
{

0 commit comments

Comments
 (0)