Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/AutomationUtils/Matchers/DockerEventMatcher.cs
Ben Marsh a3783d7322 Horde: Add a matcher for Docker disk space errors.
[CL 28222783 by Ben Marsh in ue5-main branch]
2023-09-26 08:53:53 -04:00

29 lines
696 B
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System.Text.RegularExpressions;
using EpicGames.Core;
using Microsoft.Extensions.Logging;
#nullable enable
namespace AutomationUtils.Matchers
{
/// <summary>
/// Matcher for docker errors
/// </summary>
class DockerEventMatcher : ILogEventMatcher
{
static readonly Regex s_noSpacePattern = new Regex(": no space left on device$");
public LogEventMatch? Match(ILogCursor cursor)
{
if (cursor.IsMatch(s_noSpacePattern))
{
LogEventBuilder builder = new LogEventBuilder(cursor);
return builder.ToMatch(LogEventPriority.Normal, LogLevel.Error, KnownLogEvents.Systemic_OutOfDiskSpace);
}
return null;
}
}
}