File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
pkg/apis/troubleshoot/v1beta2 Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,12 @@ func (s *SupportBundle) ConcatSpec(bundle *SupportBundle) {
2121
2222func (s * SupportBundleSpec ) MergeCollectors (spec * SupportBundleSpec ) {
2323 for _ ,c := range spec .Collectors {
24+ // we want to move away from checking for specific collectors in favor of allowing collectors to expose their own merge method
25+ // ideally we'd just want to be able to call something like c.Merge(spec) here and have the collector's own merge method work out what to do'
2426
2527 if c .ClusterInfo != nil {
2628 // we only actually want one of these so skip if there's already one
2729 y := 0
28- // we want to move away from checking for specific collectors in favor of allowing collectors to expose their own merge method
2930 for _ ,v := range s .Collectors {
3031 if v .ClusterInfo != nil {
3132 y = 1
@@ -37,6 +38,19 @@ func (s *SupportBundleSpec) MergeCollectors(spec *SupportBundleSpec) {
3738 continue
3839 }
3940
41+ if c .ClusterResources != nil {
42+ y := 0
43+ for _ ,v := range s .Collectors {
44+ if v .ClusterResources != nil {
45+ y = 1
46+ }
47+ }
48+ if y != 1 {
49+ s .Collectors = append (s .Collectors , c )
50+ }
51+ continue
52+ }
53+
4054 s .Collectors = append (s .Collectors , c )
4155
4256 }
You can’t perform that action at this time.
0 commit comments