From 8a0680021ad8c5b6b9dcb5414884c2241c70de81 Mon Sep 17 00:00:00 2001 From: Gerard Nguyen Date: Fri, 18 Oct 2024 12:43:34 +1100 Subject: [PATCH] continue to run on single collector error --- pkg/supportbundle/collect.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/supportbundle/collect.go b/pkg/supportbundle/collect.go index 872d3fd0d..303b68bcc 100644 --- a/pkg/supportbundle/collect.go +++ b/pkg/supportbundle/collect.go @@ -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 @@ -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())