mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-04-15 07:16:34 +00:00
* feat: Add regular expressions host anaylser This anaylser is the same as the in-cluster text anaylser. You pass in search expressions to find values in files collected in a bundle * additional test assertion to check analyser warn
25 lines
749 B
Go
25 lines
749 B
Go
package analyzer
|
|
|
|
import (
|
|
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
|
|
)
|
|
|
|
// AnalyzeHostTextAnalyze implements HostAnalyzer interface
|
|
type AnalyzeHostTextAnalyze struct {
|
|
hostAnalyzer *troubleshootv1beta2.TextAnalyze
|
|
}
|
|
|
|
func (a *AnalyzeHostTextAnalyze) Title() string {
|
|
return hostAnalyzerTitleOrDefault(a.hostAnalyzer.AnalyzeMeta, "Regular Expression")
|
|
}
|
|
|
|
func (a *AnalyzeHostTextAnalyze) IsExcluded() (bool, error) {
|
|
return isExcluded(a.hostAnalyzer.Exclude)
|
|
}
|
|
|
|
func (a *AnalyzeHostTextAnalyze) Analyze(
|
|
getCollectedFileContents func(string) ([]byte, error), findFiles getChildCollectedFileContents,
|
|
) ([]*AnalyzeResult, error) {
|
|
return analyzeTextAnalyze(a.hostAnalyzer, findFiles, a.Title())
|
|
}
|