mirror of
https://github.com/actions/runner.git
synced 2025-12-15 22:47:01 +00:00
Warn for soon to be deprecated OS versions (#3413)
This commit is contained in:
@@ -44,6 +44,7 @@ namespace GitHub.DistributedTask.Pipelines
|
||||
IList<TemplateToken> defaults,
|
||||
ActionsEnvironmentReference actionsEnvironment,
|
||||
TemplateToken snapshot,
|
||||
IList<OSWarning> osWarnings,
|
||||
String messageType = JobRequestMessageTypes.PipelineAgentJobRequest)
|
||||
{
|
||||
this.MessageType = messageType;
|
||||
@@ -73,6 +74,11 @@ namespace GitHub.DistributedTask.Pipelines
|
||||
m_defaults = new List<TemplateToken>(defaults);
|
||||
}
|
||||
|
||||
if (osWarnings?.Count > 0)
|
||||
{
|
||||
m_osWarnings = new List<OSWarning>(osWarnings);
|
||||
}
|
||||
|
||||
this.ContextData = new Dictionary<String, PipelineContextData>(StringComparer.OrdinalIgnoreCase);
|
||||
if (contextData?.Count > 0)
|
||||
{
|
||||
@@ -288,6 +294,18 @@ namespace GitHub.DistributedTask.Pipelines
|
||||
}
|
||||
}
|
||||
|
||||
public IList<OSWarning> OSWarnings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_osWarnings == null)
|
||||
{
|
||||
m_osWarnings = new List<OSWarning>();
|
||||
}
|
||||
return m_osWarnings;
|
||||
}
|
||||
}
|
||||
|
||||
// todo: remove after feature-flag DistributedTask.EvaluateContainerOnRunner is enabled everywhere
|
||||
public void SetJobSidecarContainers(IDictionary<String, String> value)
|
||||
{
|
||||
@@ -425,6 +443,11 @@ namespace GitHub.DistributedTask.Pipelines
|
||||
{
|
||||
JobContainer = new StringToken(null, null, null, m_jobContainerResourceAlias);
|
||||
}
|
||||
|
||||
if (m_osWarnings?.Count == 0)
|
||||
{
|
||||
m_osWarnings = null;
|
||||
}
|
||||
}
|
||||
|
||||
[DataMember(Name = "EnvironmentVariables", EmitDefaultValue = false)]
|
||||
@@ -449,6 +472,9 @@ namespace GitHub.DistributedTask.Pipelines
|
||||
[DataMember(Name = "JobSidecarContainers", EmitDefaultValue = false)]
|
||||
private IDictionary<String, String> m_jobSidecarContainers;
|
||||
|
||||
[DataMember(Name = "OSWarnings", EmitDefaultValue = false)]
|
||||
private List<OSWarning> m_osWarnings;
|
||||
|
||||
// todo: remove after feature-flag DistributedTask.EvaluateContainerOnRunner is enabled everywhere
|
||||
[IgnoreDataMember]
|
||||
private string m_jobContainerResourceAlias;
|
||||
|
||||
Reference in New Issue
Block a user