Skip to content

Commit

Permalink
Fixed a regression when attaching a VM image to an existing version o…
Browse files Browse the repository at this point in the history
…f a product

Signed-off-by: Pete Wall <[email protected]>
  • Loading branch information
Pete Wall committed May 12, 2022
1 parent c4a4932 commit 07d59e4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ var AttachVMCmd = &cobra.Command{
cmd.SilenceUsage = true

product, version, err := Marketplace.GetProductWithVersion(VMProductSlug, VMProductVersion)
if errors.Is(err, &pkg.VersionDoesNotExistError{}) && VMCreateVersion {
version = product.NewVersion(VMProductVersion)
} else {
return err
if err != nil {
if errors.Is(err, &pkg.VersionDoesNotExistError{}) && VMCreateVersion {
version = product.NewVersion(VMProductVersion)
} else {
return err
}
}

hashString, err := pkg.Hash(vmFile, models.HashAlgoSHA1)
Expand Down

0 comments on commit 07d59e4

Please sign in to comment.