Skip to content

Commit

Permalink
Add xvd support to Template device parition rendering (#786)
Browse files Browse the repository at this point in the history
Add `xvd` support support for applying partitions numbers in Tinkerbell Template rendering using the `formatPartition` function. 

`xvd` are a virtual device on Xen virtual machines.
  • Loading branch information
mergify[bot] authored Sep 5, 2023
2 parents 47ec6ff + 703a6e0 commit aab3c67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/workflow/template_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ func formatPartition(dev string, partition int) string {
switch {
case strings.HasPrefix(dev, "/dev/nvme"):
return fmt.Sprintf("%vp%v", dev, partition)
case strings.HasPrefix(dev, "/dev/sd"), strings.HasPrefix(dev, "/dev/vd"), strings.HasPrefix(dev, "/dev/hd"):
case strings.HasPrefix(dev, "/dev/sd"),
strings.HasPrefix(dev, "/dev/vd"),
strings.HasPrefix(dev, "/dev/xvd"),
strings.HasPrefix(dev, "/dev/hd"):
return fmt.Sprintf("%v%v", dev, partition)
}
return dev
Expand Down

0 comments on commit aab3c67

Please sign in to comment.