Skip to content
Open
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 @@ -59,7 +59,7 @@ public static IServiceCollection AddSbomConfiguration(this IServiceCollection se
return services;
}

public static IServiceCollection AddSbomTool(this IServiceCollection services, LogEventLevel logLevel = LogEventLevel.Information)
public static IServiceCollection AddSbomToolWithoutComponentDetection(this IServiceCollection services, LogEventLevel logLevel = LogEventLevel.Information)
{
services
.AddSingleton<IConfiguration, Configuration>()
Expand Down Expand Up @@ -180,13 +180,19 @@ public static IServiceCollection AddSbomTool(this IServiceCollection services, L

return manifestData;
})
.AddComponentDetection()
.ConfigureLoggingProviders()
.AddHttpClient<LicenseInformationService>();

return services;
}

public static IServiceCollection AddSbomTool(this IServiceCollection services, LogEventLevel logLevel = LogEventLevel.Information)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that registering AddComponentDetection twice breaks things feels like a CD bug, and therefore should be fixed on the CD side. We should not have to account for this issue as the consumer.

{
services.AddSbomToolWithoutComponentDetection(logLevel)
.AddComponentDetection();
return services;
}

public static IServiceCollection ConfigureLoggingProviders(this IServiceCollection services)
{
var providers = new LoggerProviderCollection();
Expand Down