Skip to content

Commit

Permalink
continue to run on single collector error
Browse files Browse the repository at this point in the history
  • Loading branch information
nvanthao committed Oct 18, 2024
1 parent 309c0b6 commit 8a06800
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pkg/supportbundle/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ func collectHost(ctx context.Context, filteredCollectors []FilteredCollector, op
if err != nil {
span.SetStatus(codes.Error, err.Error())
opts.ProgressChan <- fmt.Sprintf("[%s] Error: %v", collector.Title(), err)
return errors.Wrap(err, "failed to run host collector")
}

// Send progress event: completed successfully
Expand Down Expand Up @@ -332,16 +331,14 @@ func filterHostCollectors(ctx context.Context, collectSpecs []*troubleshootv1bet

for _, desiredCollector := range collectSpecs {
collector, ok := collect.GetHostCollector(desiredCollector, bundlePath)
if collector == nil {
if !ok {
opts.ProgressChan <- "Host collector not found"
continue
}

_, span := otel.Tracer(constants.LIB_TRACER_NAME).Start(ctx, collector.Title())
span.SetAttributes(attribute.String("type", reflect.TypeOf(collector).String()))

if !ok {
return nil, collect.ErrHostCollectorNotFound
}

isExcluded, _ := collector.IsExcluded()
if isExcluded {
opts.ProgressChan <- fmt.Sprintf("[%s] Excluding host collector", collector.Title())
Expand Down

0 comments on commit 8a06800

Please sign in to comment.