diff --git a/cmd/troubleshoot/cli/run.go b/cmd/troubleshoot/cli/run.go index 28f551c91..bc437c191 100644 --- a/cmd/troubleshoot/cli/run.go +++ b/cmd/troubleshoot/cli/run.go @@ -101,7 +101,7 @@ func runTroubleshoot(v *viper.Viper, arg []string) error { if i == 0 { mainBundle = supportBundle } else { - mainBundle.concatSpec(supportBundle) + mainBundle.ConcatSpec(supportBundle) } for i, additionalDoc := range multidocs { diff --git a/pkg/apis/troubleshoot/v1beta2/supportbundle_interfaces.go b/pkg/apis/troubleshoot/v1beta2/supportbundle_interfaces.go new file mode 100644 index 000000000..94aba4db8 --- /dev/null +++ b/pkg/apis/troubleshoot/v1beta2/supportbundle_interfaces.go @@ -0,0 +1,19 @@ +package v1beta2 + +func (s *SupportBundle) ConcatSpec(bundle *SupportBundle) { + for _, v := range bundle.Spec.Collectors { + s.Spec.Collectors = append(bundle.Spec.Collectors, v) + } + for _, v := range bundle.Spec.AfterCollection { + s.Spec.AfterCollection = append(bundle.Spec.AfterCollection, v) + } + for _, v := range bundle.Spec.HostCollectors { + s.Spec.HostCollectors = append(bundle.Spec.HostCollectors, v) + } + for _, v := range bundle.Spec.HostAnalyzers { + s.Spec.HostAnalyzers = append(bundle.Spec.HostAnalyzers, v) + } + for _, v := range bundle.Spec.Analyzers { + s.Spec.Analyzers = append(bundle.Spec.Analyzers, v) + } +}