Skip to content

Commit 49a6c4f

Browse files
committed
Fix remediation name for CannotRetrieveUpdatesSRE to match directory name
This is due to a backplane limitation. To find the metadata.yaml, the remediation needs to have the same name as the directory it lives in.
1 parent bc42e29 commit 49a6c4f

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

pkg/investigations/cannotretrieveupdatessre/cannotretrieveupdatessre.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,13 @@ import (
1515
"sigs.k8s.io/controller-runtime/pkg/client"
1616
)
1717

18-
const (
19-
alertname = "CannotRetrieveUpdatesSRE"
20-
remediationName = "CannotRetrieveUpdatesSRE"
21-
)
22-
2318
type Investigation struct{}
2419

2520
// Run executes the investigation for the CannotRetrieveUpdatesSRE alert
2621
func (c *Investigation) Run(r *investigation.Resources) (investigation.InvestigationResult, error) {
2722
result := investigation.InvestigationResult{}
2823
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)
3025
if err != nil {
3126
return result, fmt.Errorf("unable to initialize k8s cli: %w", err)
3227
}
@@ -101,15 +96,15 @@ func checkCondition(condition configv1.ClusterOperatorStatusCondition) (string,
10196
}
10297

10398
func (i *Investigation) Name() string {
104-
return alertname
99+
return "cannotretrieveupdatessre"
105100
}
106101

107102
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())
109104
}
110105

111106
func (i *Investigation) ShouldInvestigateAlert(alert string) bool {
112-
return strings.Contains(alert, alertname)
107+
return strings.Contains(alert, "CannotRetrieveUpdatesSRE")
113108
}
114109

115110
func (i *Investigation) IsExperimental() bool {

0 commit comments

Comments
 (0)