Skip to content

Commit a95ac5a

Browse files
committed
OCPBUGS-13764: Support /dev/disk/by-path root device hints
In baremetal IPI, we should support /dev/disk/by-path root device hints in the install-config to match the implementation in Metal³ metal3-io/baremetal-operator#1264.
1 parent 284e41d commit a95ac5a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/types/baremetal/rootdevice.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package baremetal
55

66
import (
77
"fmt"
8+
"strings"
89

910
"github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
1011
)
@@ -62,7 +63,11 @@ func (source *RootDeviceHints) MakeHintMap() map[string]string {
6263
}
6364

6465
if source.DeviceName != "" {
65-
hints["name"] = fmt.Sprintf("s== %s", source.DeviceName)
66+
if strings.HasPrefix(source.DeviceName, "/dev/disk/by-path/") {
67+
hints["by_path"] = fmt.Sprintf("s== %s", source.DeviceName)
68+
} else {
69+
hints["name"] = fmt.Sprintf("s== %s", source.DeviceName)
70+
}
6671
}
6772
if source.HCTL != "" {
6873
hints["hctl"] = fmt.Sprintf("s== %s", source.HCTL)

0 commit comments

Comments
 (0)