Skip to content

Commit

Permalink
consider device path for filtering unique devices
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanBednar committed May 4, 2023
1 parent 2ef22f4 commit 5cc4824
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions diskmaker/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ func getDiscoverdDevices(blockDevices []internal.BlockDevice) []v1alpha1.Discove
// See: https://github.com/util-linux/util-linux/blob/3be31a106c52e093928afbea2cddbdbe44cfb357/Documentation/releases/v2.34-ReleaseNotes#L18
func uniqueDevices(sample []v1alpha1.DiscoveredDevice) []v1alpha1.DiscoveredDevice {
var unique []v1alpha1.DiscoveredDevice
type key struct{ value string }
type key struct{ value, value2 string }
m := make(map[key]int)
for _, v := range sample {
k := key{v.DeviceID}
k := key{v.DeviceID, v.Path}
if i, ok := m[k]; ok {
unique[i] = v
} else {
Expand Down

0 comments on commit 5cc4824

Please sign in to comment.