Skip to content

Commit

Permalink
bug: honor arch while downloading disk
Browse files Browse the repository at this point in the history
  • Loading branch information
balajiv113 committed Jul 14, 2022
1 parent 8183f5d commit e75742c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/vzrun/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ func EnsureDisk(ctx context.Context, cfg VM) error {
if _, err := os.Stat(baseDisk); errors.Is(err, os.ErrNotExist) {
var ensuredRequiredImages bool
errs := make([]error, len(cfg.MacVZYaml.Images))
resolveArch := yaml.ResolveArch()
for i, f := range cfg.MacVZYaml.Images {
if f.Arch != resolveArch {
errs[i] = fmt.Errorf("image architecture %s didn't match system architecture: %s", f.Arch, resolveArch)
continue
}
err := downloadImage(kernel, f.Kernel)
if err != nil {
errs[i] = fmt.Errorf("failed to download required images: %w", err)
Expand All @@ -49,6 +54,7 @@ func EnsureDisk(ctx context.Context, cfg VM) error {
err = iso9660util.Extract(BaseDiskZip, "focal-server-cloudimg-"+fileName+".img", baseDisk)
if err != nil {
errs[i] = fmt.Errorf("failed to extract base image: %w", err)
continue
}

ensuredRequiredImages = true
Expand Down

0 comments on commit e75742c

Please sign in to comment.