Skip to content

Commit

Permalink
[createRedFishUrl] use Manufacturer.Slug instead
Browse files Browse the repository at this point in the history
  • Loading branch information
defo89 committed Jun 6, 2024
1 parent 5f7cb7f commit cd9e3b7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/controller/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"context"
"fmt"
"net"
"regexp"
"strconv"
"strings"

Expand Down Expand Up @@ -233,9 +232,8 @@ func createRedFishUrl(device *models.Device) (string, error) {
if err != nil {
return "", err
}
var idrac = regexp.MustCompile(`PowerEdge.*`)
switch model := device.DeviceType.Model; {
case idrac.MatchString(model):
switch device.DeviceType.Manufacturer.Slug {
case "dell":
return "idrac-redfish://" + ip.String() + "/redfish/v1/Systems/System.Embedded.1", nil
default:
return "redfish://" + ip.String() + "/redfish/v1/Systems/1", nil
Expand Down

0 comments on commit cd9e3b7

Please sign in to comment.