Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
nvanthao committed Oct 21, 2024
1 parent 636f520 commit 7309b37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/supportbundle/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func executeSupportBundleCollectRoutine(bundle *types.SupportBundle, progressCha
Namespace: "",
ProgressChan: progressChan,
Redact: true,
RunHostCollectorsInPod: true,
RunHostCollectorsInPod: true, // always run host collectors in pod from KOTS regardless of the spec value
}

logger.Infof("Executing Collection go routine for support bundle ID: %s", bundle.ID)
Expand Down
13 changes: 6 additions & 7 deletions pkg/supportbundle/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ func mergeSupportBundleSpecs(builtBundles map[string]*troubleshootv1beta2.Suppor
},
}

mergedBundle.Spec.RunHostCollectorsInPod = true

for _, builtBundle := range builtBundles {
mergedBundle.Spec.Collectors = append(mergedBundle.Spec.Collectors, builtBundle.Spec.Collectors...)
mergedBundle.Spec.Analyzers = append(mergedBundle.Spec.Analyzers, builtBundle.Spec.Analyzers...)
Expand Down Expand Up @@ -472,13 +470,14 @@ func addDiscoveredSpecs(
supportBundle.Spec.Collectors = append(supportBundle.Spec.Collectors, sbObject.Spec.Collectors...)
supportBundle.Spec.Analyzers = append(supportBundle.Spec.Analyzers, sbObject.Spec.Analyzers...)
supportBundle.Spec.HostCollectors = append(supportBundle.Spec.HostCollectors, sbObject.Spec.HostCollectors...)
supportBundle.Spec.HostAnalyzers = append(supportBundle.Spec.HostAnalyzers, sbObject.Spec.HostAnalyzers...)
}

supportBundle.Spec.RunHostCollectorsInPod = true

// remove duplicated collectors and analyzers if there are multiple support bundle upstream spec
supportBundle = deduplicatedCollectors(supportBundle)
supportBundle = deduplicatedAnalyzers(supportBundle)
// remove duplicated specs if there are multiple support bundle upstream spec
supportBundle.Spec.Collectors = kotsutil.Dedup(supportBundle.Spec.Collectors)
supportBundle.Spec.Analyzers = kotsutil.Dedup(supportBundle.Spec.Analyzers)
supportBundle.Spec.HostCollectors = kotsutil.Dedup(supportBundle.Spec.HostCollectors)
supportBundle.Spec.HostAnalyzers = kotsutil.Dedup(supportBundle.Spec.HostAnalyzers)

return supportBundle
}
Expand Down

0 comments on commit 7309b37

Please sign in to comment.