Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ await DockerService.TryPullImageAsync(image, cancellationToken)))
}
catch (Exception e)
{
Logger.LogWarning($"Processing of image {image} failed with exception: {e.Message}");
using var record = new LinuxContainerDetectorImageDetectionFailed
{
ExceptionType = e.GetType().ToString(),
Expand Down Expand Up @@ -153,6 +154,7 @@ await DockerService.TryPullImageAsync(image, cancellationToken)))
}
catch (Exception e)
{
Logger.LogWarning($"Scanning of image {kvp.Key} failed with exception: {e.Message}");
using var record = new LinuxContainerDetectorImageDetectionFailed
{
ExceptionType = e.GetType().ToString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ public async Task<IEnumerable<LayerMappedLinuxComponents>> ScanLinuxAsync(string
$"Scan failed with exit info: {stdout}{Environment.NewLine}{stderr}");
}

var layerDictionary = dockerLayers.ToDictionary(
layer => layer.DiffId,
layer => new List<LinuxComponent>());

var layerDictionary = dockerLayers
.DistinctBy(layer => layer.DiffId)
.ToDictionary(
layer => layer.DiffId,
_ => new List<LinuxComponent>());

try
{
var syftOutput = JsonConvert.DeserializeObject<SyftOutput>(stdout);
Expand Down