Skip to content

Commit 25ccd3f

Browse files
Merge pull request #435 from typeid/fix_mhc
Fix: machinehealthcheckunterminatedshortcircuitsre k8s client setup
2 parents f842c77 + 9f4b84b commit 25ccd3f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pkg/investigations/machinehealthcheckunterminatedshortcircuitsre/machinehealthcheckunterminatedshortcircuitsre.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import (
2626

2727
const (
2828
alertname = "MachineHealthCheckUnterminatedShortCircuitSRE"
29-
// remediationName must match the name of this investigation's directory, so it can be looked up via the backplane-api
30-
remediationName = "machineHealthCheckUnterminatedShortCircuitSRE"
3129
)
3230

3331
type Investigation struct {
@@ -41,7 +39,7 @@ type Investigation struct {
4139

4240
func (i *Investigation) setup(r *investigation.Resources) error {
4341
// Setup investigation
44-
k, err := k8sclient.New(r.Cluster.ID(), r.OcmClient, remediationName)
42+
k, err := k8sclient.New(r.Cluster.ID(), r.OcmClient, r.Name)
4543
if err != nil {
4644
return fmt.Errorf("failed to initialize kubernetes client: %w", err)
4745
}
@@ -68,7 +66,7 @@ func (i *Investigation) Run(r *investigation.Resources) (investigation.Investiga
6866
return result, fmt.Errorf("failed to setup investigation: %w", err)
6967
}
7068
defer func(r *investigation.Resources) {
71-
err := k8sclient.Cleanup(r.Cluster.ID(), r.OcmClient, remediationName)
69+
err := k8sclient.Cleanup(r.Cluster.ID(), r.OcmClient, r.Name)
7270
if err != nil {
7371
logging.Errorf("failed to cleanup investigation: %w", err)
7472
}
@@ -313,7 +311,7 @@ func (i *Investigation) InvestigateNode(node corev1.Node) {
313311
}
314312

315313
func (i *Investigation) Name() string {
316-
return alertname
314+
return strings.ToLower(alertname)
317315
}
318316

319317
func (i *Investigation) Description() string {

0 commit comments

Comments
 (0)