diff --git a/cmd/troubleshoot/cli/run.go b/cmd/troubleshoot/cli/run.go index af6f9dbe1..137e6b5e1 100644 --- a/cmd/troubleshoot/cli/run.go +++ b/cmd/troubleshoot/cli/run.go @@ -449,7 +449,6 @@ func runCollectors(v *viper.Viper, collectors []*troubleshootv1beta2.Collect, ad Collect: desiredCollector, ClientConfig: config, Namespace: v.GetString("namespace"), - PathPrefix: filepath.Base(bundlePath), } cleanedCollectors = append(cleanedCollectors, &collector) } @@ -500,8 +499,7 @@ func runCollectors(v *viper.Viper, collectors []*troubleshootv1beta2.Collect, ad } if result != nil { - // results already contain the bundle dir name in their paths - err = saveCollectorOutput(result, filepath.Dir(bundlePath), collector) + err = saveCollectorOutput(result, bundlePath, collector) if err != nil { progressChan <- fmt.Errorf("failed to parse collector spec %q: %v", collector.GetDisplayName(), err) continue diff --git a/pkg/collect/collector.go b/pkg/collect/collector.go index 4b1cb7295..f4df76b31 100644 --- a/pkg/collect/collector.go +++ b/pkg/collect/collector.go @@ -2,7 +2,6 @@ package collect import ( "context" - "path/filepath" "strconv" "github.com/pkg/errors" @@ -20,7 +19,6 @@ type Collector struct { RBACErrors []error ClientConfig *rest.Config Namespace string - PathPrefix string } type Collectors []*Collector @@ -209,15 +207,6 @@ func (c *Collector) RunCollectorSync(globalRedactors []*troubleshootv1beta2.Reda return } - if c.PathPrefix != "" { - // prefix file paths - prefixed := map[string][]byte{} - for k, v := range result { - prefixed[filepath.Join(c.PathPrefix, k)] = v - } - result = prefixed - } - if c.Redact { result, err = redactMap(result, globalRedactors) }