Skip to content

Commit

Permalink
Add concatspec method
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Jones <danj@replicated.com>
  • Loading branch information
danj-replicated committed Aug 23, 2022
1 parent 3b3ae4e commit 1a637f3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/troubleshoot/cli/run.go
Expand Up @@ -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 {
Expand Down
19 changes: 19 additions & 0 deletions 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)
}
}

0 comments on commit 1a637f3

Please sign in to comment.