|
7 | 7 |
|
8 | 8 | multierror "github.com/hashicorp/go-multierror" |
9 | 9 | analyze "github.com/replicatedhq/troubleshoot/pkg/analyze" |
| 10 | + corev1 "k8s.io/api/core/v1" |
10 | 11 | ) |
11 | 12 |
|
12 | 13 | type Meta struct { |
@@ -34,11 +35,12 @@ type Insight struct { |
34 | 35 | type Result struct { |
35 | 36 | Meta `json:",inline" yaml:",inline" hcl:",inline"` |
36 | 37 |
|
37 | | - Insight *Insight `json:"insight" yaml:"insight" hcl:"insight"` |
38 | | - Severity Severity `json:"severity" yaml:"severity" hcl:"severity"` |
39 | | - AnalyzerSpec string `json:"analyzerSpec" yaml:"analyzerSpec" hcl:"analyzerSpec"` |
40 | | - Variables map[string]interface{} `json:"variables,omitempty" yaml:"variables,omitempty" hcl:"variables,omitempty"` |
41 | | - Error string `json:"error,omitempty" yaml:"error,omitempty" hcl:"error,omitempty"` |
| 38 | + Insight *Insight `json:"insight" yaml:"insight" hcl:"insight"` |
| 39 | + Severity Severity `json:"severity" yaml:"severity" hcl:"severity"` |
| 40 | + AnalyzerSpec string `json:"analyzerSpec" yaml:"analyzerSpec" hcl:"analyzerSpec"` |
| 41 | + Variables map[string]interface{} `json:"variables,omitempty" yaml:"variables,omitempty" hcl:"variables,omitempty"` |
| 42 | + Error string `json:"error,omitempty" yaml:"error,omitempty" hcl:"error,omitempty"` |
| 43 | + InvolvedObject *corev1.ObjectReference `json:"involvedObject,omitempty" yaml:"involvedObject,omitempty" hcl:"involvedObject,omitempty"` |
42 | 44 | } |
43 | 45 |
|
44 | 46 | func (m *Insight) Render(data interface{}) (*Insight, error) { |
@@ -88,8 +90,9 @@ func FromAnalyzerResult(input []*analyze.AnalyzeResult) []*Result { |
88 | 90 | Primary: i.Title, |
89 | 91 | Detail: i.Message, |
90 | 92 | }, |
91 | | - AnalyzerSpec: "", |
92 | | - Variables: map[string]interface{}{}, |
| 93 | + AnalyzerSpec: "", |
| 94 | + Variables: map[string]interface{}{}, |
| 95 | + InvolvedObject: i.InvolvedObject, |
93 | 96 | } |
94 | 97 | if i.IsFail { |
95 | 98 | r.Severity = SeverityError |
|
0 commit comments