Files
Gerard NguyenandGitHub edfa01c5c4 feat: [sc-106625] http analyzer for in-cluster (#1566)
* http analzyer for in-cluster
* make check-schemas
2024-06-19 12:14:37 +10:00

31 lines
791 B
Go

package analyzer
import (
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
)
type AnalyzeHTTPAnalyze struct {
analyzer *troubleshootv1beta2.HTTPAnalyze
}
func (a *AnalyzeHTTPAnalyze) Title() string {
checkName := a.analyzer.CheckName
if checkName == "" {
checkName = a.analyzer.CollectorName
}
return checkName
}
func (a *AnalyzeHTTPAnalyze) IsExcluded() (bool, error) {
return isExcluded(a.analyzer.Exclude)
}
func (a *AnalyzeHTTPAnalyze) Analyze(getFile getCollectedFileContents, findFiles getChildCollectedFileContents) ([]*AnalyzeResult, error) {
fileName := "result.json"
if a.analyzer.CollectorName != "" {
fileName = a.analyzer.CollectorName + ".json"
}
return analyzeHTTPResult(a.analyzer, fileName, getFile, a.Title())
}