Skip to content

Commit e7daba9

Browse files
authored
Merge pull request #470 from replicatedhq/divolgin/analyzers
Replicaset collector and analyzer
2 parents f2374cf + ada35eb commit e7daba9

File tree

9 files changed

+10293
-5
lines changed

9 files changed

+10293
-5
lines changed

pkg/analyze/analyzer.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,20 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
222222
}
223223
return results, nil
224224
}
225+
if analyzer.ReplicaSetStatus != nil {
226+
isExcluded, err := isExcluded(analyzer.ReplicaSetStatus.Exclude)
227+
if err != nil {
228+
return nil, err
229+
}
230+
if isExcluded {
231+
return nil, nil
232+
}
233+
results, err := analyzeReplicaSetStatus(analyzer.ReplicaSetStatus, findFiles)
234+
if err != nil {
235+
return nil, err
236+
}
237+
return results, nil
238+
}
225239
if analyzer.ClusterPodStatuses != nil {
226240
isExcluded, err := isExcluded(analyzer.ClusterPodStatuses.Exclude)
227241
if err != nil {

pkg/analyze/data_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ var collectedNodes string
1212

1313
//go:embed files/jobs.json
1414
var collectedJobs string
15+
16+
//go:embed files/replicasets.json
17+
var collectedReplicaSets string

0 commit comments

Comments
 (0)