From 007ac8138b0d7a6a0b236c8026906c84c78980e4 Mon Sep 17 00:00:00 2001 From: klassiker Date: Fri, 11 Dec 2020 19:08:45 +0100 Subject: [PATCH] Add proxy support for container actions (#840) * Add proxy support for container actions in Runner.Worker/StepsRunner * Move proxy modifications to ContainerActionHandler --- src/Runner.Worker/Container/ContainerInfo.cs | 5 +++++ src/Runner.Worker/Handlers/ContainerActionHandler.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Runner.Worker/Container/ContainerInfo.cs b/src/Runner.Worker/Container/ContainerInfo.cs index bd906c5a2..2173922b1 100644 --- a/src/Runner.Worker/Container/ContainerInfo.cs +++ b/src/Runner.Worker/Container/ContainerInfo.cs @@ -21,6 +21,11 @@ namespace GitHub.Runner.Worker.Container { } + public ContainerInfo(IHostContext hostContext) + { + UpdateWebProxyEnv(hostContext.WebProxy); + } + public ContainerInfo(IHostContext hostContext, Pipelines.JobContainer container, bool isJobContainer = true, string networkAlias = null) { this.ContainerName = container.Alias; diff --git a/src/Runner.Worker/Handlers/ContainerActionHandler.cs b/src/Runner.Worker/Handlers/ContainerActionHandler.cs index b25383459..1b9a87b6d 100644 --- a/src/Runner.Worker/Handlers/ContainerActionHandler.cs +++ b/src/Runner.Worker/Handlers/ContainerActionHandler.cs @@ -70,7 +70,7 @@ namespace GitHub.Runner.Worker.Handlers } // run container - var container = new ContainerInfo() + var container = new ContainerInfo(HostContext) { ContainerImage = Data.Image, ContainerName = ExecutionContext.Id.ToString("N"),