mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:21:58 +00:00
Remove unnecessary field 'UnhealthyContainers'
This commit is contained in:
@@ -16,7 +16,6 @@ namespace GitHub.Runner.Worker.Container
|
||||
{
|
||||
string DockerPath { get; }
|
||||
string DockerInstanceLabel { get; }
|
||||
IList<ContainerInfo> UnhealthyContainers {get; set; }
|
||||
Task<DockerVersion> DockerVersion(IExecutionContext context);
|
||||
Task<int> DockerPull(IExecutionContext context, string image);
|
||||
Task<int> DockerPull(IExecutionContext context, string image, string configFileDirectory);
|
||||
@@ -43,8 +42,6 @@ namespace GitHub.Runner.Worker.Container
|
||||
|
||||
public string DockerInstanceLabel { get; private set; }
|
||||
|
||||
public IList<ContainerInfo> UnhealthyContainers {get; set; }
|
||||
|
||||
public override void Initialize(IHostContext hostContext)
|
||||
{
|
||||
base.Initialize(hostContext);
|
||||
|
||||
@@ -101,14 +101,14 @@ namespace GitHub.Runner.Worker
|
||||
|
||||
executionContext.Output("##[group]Waiting for all services to be ready");
|
||||
|
||||
_dockerManager.UnhealthyContainers = new List<ContainerInfo>();
|
||||
var unhealthyContainers = new List<ContainerInfo>();
|
||||
foreach (var container in containers.Where(c => !c.IsJobContainer))
|
||||
{
|
||||
var healthcheck = await Healthcheck(executionContext, container);
|
||||
|
||||
if (!string.Equals(healthcheck, "healthy", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_dockerManager.UnhealthyContainers.Add(container);
|
||||
unhealthyContainers.Add(container);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -117,9 +117,9 @@ namespace GitHub.Runner.Worker
|
||||
}
|
||||
executionContext.Output("##[endgroup]");
|
||||
|
||||
if (_dockerManager.UnhealthyContainers.Count > 0)
|
||||
if (unhealthyContainers.Count > 0)
|
||||
{
|
||||
foreach (var container in _dockerManager.UnhealthyContainers)
|
||||
foreach (var container in unhealthyContainers)
|
||||
{
|
||||
executionContext.Output($"##[group]Service container {container.ContainerNetworkAlias} failed.");
|
||||
await ContainerErrorLogs(executionContext, container);
|
||||
|
||||
Reference in New Issue
Block a user