Skip to content

Commit

Permalink
fix vhd format support
Browse files Browse the repository at this point in the history
closes  #47

Signed-off-by: Adphi <[email protected]>
  • Loading branch information
Adphi committed May 8, 2024
1 parent b27add5 commit e2c9feb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ff02::3 ip6-allhosts
perm os.FileMode = 0644
)

var formats = []string{"qcow2", "qed", "raw", "vdi", "vhd", "vmdk"}
var formats = []string{"qcow2", "qed", "raw", "vdi", "vhd", "vhd", "vhdx", "vmdk"}

type Builder interface {
Build(ctx context.Context) (err error)
Expand Down Expand Up @@ -113,6 +113,9 @@ func NewBuilder(ctx context.Context, workdir, imgTag, disk string, size uint64,
if !valid {
return nil, fmt.Errorf("invalid format: %s valid formats are: %s", f, strings.Join(formats, " "))
}
if f == "vhd" {
f = "vpc"
}

if splitBoot && bootSize < 50 {
return nil, fmt.Errorf("boot partition size must be at least 50MiB")
Expand Down

0 comments on commit e2c9feb

Please sign in to comment.