@@ -15,18 +15,13 @@ import (
15
15
"sigs.k8s.io/controller-runtime/pkg/client"
16
16
)
17
17
18
- const (
19
- alertname = "CannotRetrieveUpdatesSRE"
20
- remediationName = "CannotRetrieveUpdatesSRE"
21
- )
22
-
23
18
type Investigation struct {}
24
19
25
20
// Run executes the investigation for the CannotRetrieveUpdatesSRE alert
26
21
func (c * Investigation ) Run (r * investigation.Resources ) (investigation.InvestigationResult , error ) {
27
22
result := investigation.InvestigationResult {}
28
23
notes := notewriter .New ("CannotRetrieveUpdatesSRE" , logging .RawLogger )
29
- k8scli , err := k8sclient .New (r .Cluster .ID (), r .OcmClient , remediationName )
24
+ k8scli , err := k8sclient .New (r .Cluster .ID (), r .OcmClient , r . Name )
30
25
if err != nil {
31
26
return result , fmt .Errorf ("unable to initialize k8s cli: %w" , err )
32
27
}
@@ -101,15 +96,15 @@ func checkCondition(condition configv1.ClusterOperatorStatusCondition) (string,
101
96
}
102
97
103
98
func (i * Investigation ) Name () string {
104
- return alertname
99
+ return "cannotretrieveupdatessre"
105
100
}
106
101
107
102
func (i * Investigation ) Description () string {
108
- return fmt .Sprintf ("Investigates '%s' alerts by running network verifier and checking ClusterVersion" , alertname )
103
+ return fmt .Sprintf ("Investigates '%s' alerts by running network verifier and checking ClusterVersion" , i . Name () )
109
104
}
110
105
111
106
func (i * Investigation ) ShouldInvestigateAlert (alert string ) bool {
112
- return strings .Contains (alert , alertname )
107
+ return strings .Contains (alert , "CannotRetrieveUpdatesSRE" )
113
108
}
114
109
115
110
func (i * Investigation ) IsExperimental () bool {
0 commit comments