Skip to content

Commit

Permalink
411709: Update regex so partial matching works
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmypixel committed Jan 10, 2025
1 parent 3b00024 commit 6419272
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ public async Task<List<DeploymentV2>> FindWhatsRunningWhere(string[]? environmen

if (!string.IsNullOrWhiteSpace(service))
{
var partialServiceFilter = Builders<DeploymentV2>.Filter.Regex(d => d.Service, new BsonRegularExpression($"^{service}", "i"));
var partialServiceFilter =
Builders<DeploymentV2>.Filter.Regex(d => d.Service, new BsonRegularExpression(service, "i"));
filter &= partialServiceFilter;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public async Task<List<ServiceInfo>> FindAllServices(ArtifactRunMode? runMode, s
if (!string.IsNullOrWhiteSpace(service))
{
var partialServiceFilter =
builder.Regex(d => d.ServiceName, new BsonRegularExpression($"^{service}", "i"));
builder.Regex(d => d.ServiceName, new BsonRegularExpression(service, "i"));
filter &= partialServiceFilter;
}

Expand Down

0 comments on commit 6419272

Please sign in to comment.