Runner register labels during configuration (#130)

* Runners will add os and architecture labels during registration

* support github.localhost for dev.
This commit is contained in:
Tingluo Huang
2019-10-17 16:33:43 -04:00
committed by Christopher Johnson
parent 2f261f2c31
commit f5f14d4811
16 changed files with 52 additions and 408 deletions

View File

@@ -35,7 +35,6 @@ namespace GitHub.DistributedTask.WebApi
this.PoolId = requestToBeCloned.PoolId;
this.JobId = requestToBeCloned.JobId;
this.JobName = requestToBeCloned.JobName;
this.Demands = new List<Demand>(requestToBeCloned.Demands ?? new Demand[0]);
this.LockToken = requestToBeCloned.LockToken;
this.ExpectedDuration = requestToBeCloned.ExpectedDuration;
this.OrchestrationId = requestToBeCloned.OrchestrationId;
@@ -68,6 +67,11 @@ namespace GitHub.DistributedTask.WebApi
{
this.AgentSpecification = new JObject(requestToBeCloned.AgentSpecification);
}
if (requestToBeCloned.Labels != null)
{
this.Labels = new HashSet<string>(requestToBeCloned.Labels, StringComparer.OrdinalIgnoreCase);
}
}
/// <summary>
@@ -229,6 +233,7 @@ namespace GitHub.DistributedTask.WebApi
/// </summary>
/// <value></value>
[DataMember(Order = 16, EmitDefaultValue = false)]
[Obsolete("No more demands, use labels", true)]
public IList<Demand> Demands
{
get;
@@ -386,6 +391,13 @@ namespace GitHub.DistributedTask.WebApi
set;
}
[DataMember(Order = 33, EmitDefaultValue = false)]
public ISet<string> Labels
{
get;
set;
}
[IgnoreDataMember]
internal Guid? LockToken
{