Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: version checks #262

Merged

Conversation

tenthirtyam
Copy link
Collaborator

@tenthirtyam tenthirtyam commented Nov 15, 2024

Summary

  • Updates the version checks, using hashicorp/go-version.
  • Updates log messages based on INFO or WARN context.
  • Moves constants to the driver.go for easier maintenance.

Tests

➜ make build

packer-plugin-vmware on  pr/262 via 🐹 v1.23.3 
➜ make test
?       github.com/hashicorp/packer-plugin-vmware       [no test files]
?       github.com/hashicorp/packer-plugin-vmware/version       [no test files]
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/common 7.042s
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/iso    2.665s
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/vmx    3.531s

packer-plugin-vmware on  pr/262 via 🐹 v1.23.3 took 10.2s 
➜ make generate
2024/12/02 10:47:55 Copying "docs" to ".docs/"
2024/12/02 10:47:55 Replacing @include '...' calls in .docs/
Compiling MDX docs in '.docs' to Markdown in '.web-docs'...

Postive Tests: Min of 13.5.0; running 13.6.1.

2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] Checking VMware Fusion version...
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] VMware Fusion: 13.6.1
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] Checking VMware Fusion paths...
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] - VMware Fusion.app found at: /Applications/VMware Fusion.app
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] - vmware-vmx found at: /Applications/VMware Fusion.app/Contents/Library/vmware-vmx
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] - vmrun found at: /Applications/VMware Fusion.app/Contents/Library/vmrun
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] - vmware-vdiskmanager found at: /Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 Using driver *common.FusionDriver, Success: true

Negative Test: Min of 13.7.0 set as const; running 13.6.1.

packer build --force -var-file=photon-4.0-R2.pkrvars.hcl .
vmware-iso.vagrant-vmw: output will be in this color.

Build 'vmware-iso.vagrant-vmw' errored after 74 milliseconds 855 microseconds: failed creating driver : driver initialization failed. fix at least one driver to continue:
* [ERROR] Requires VMware Fusion 13.7.0 or later, 13.6.1 installed

@tenthirtyam tenthirtyam added this to the v1.1.1 milestone Nov 15, 2024
@tenthirtyam tenthirtyam self-assigned this Nov 15, 2024
builder/vmware/common/driver.go Fixed Show fixed Hide fixed
builder/vmware/common/driver.go Fixed Show fixed Hide fixed
builder/vmware/common/driver.go Fixed Show fixed Hide fixed
@tenthirtyam tenthirtyam marked this pull request as ready for review November 18, 2024 14:50
@tenthirtyam tenthirtyam requested a review from a team as a code owner November 18, 2024 14:50
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @tenthirtyam !

@tenthirtyam tenthirtyam force-pushed the fix/player-version-checks branch 2 times, most recently from d5629c4 to fc089e5 Compare November 23, 2024 20:02
@tenthirtyam tenthirtyam force-pushed the fix/player-version-checks branch from fc089e5 to 5baf300 Compare November 23, 2024 20:04
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tenthirtyam,

Overall this looks good to me, thanks for the reroll with go-version! I left a few last comments regarding versions and error handling, I think there's some small improvements we can make there, but besides that, this looks good to me.

Pre-approving to not block later, I'll let you address my last comments and I'll do a final round of review before merging this.

builder/vmware/common/driver.go Outdated Show resolved Hide resolved
builder/vmware/common/driver_fusion.go Outdated Show resolved Hide resolved
@tenthirtyam tenthirtyam force-pushed the fix/player-version-checks branch 2 times, most recently from d54fe9e to 7bb2772 Compare November 27, 2024 00:53
@tenthirtyam tenthirtyam changed the title fix: player version checks fix: version checks Nov 27, 2024
@tenthirtyam tenthirtyam marked this pull request as draft November 27, 2024 00:54
@tenthirtyam tenthirtyam force-pushed the fix/player-version-checks branch 2 times, most recently from 6c68e15 to ce350b8 Compare December 2, 2024 15:43
@tenthirtyam tenthirtyam marked this pull request as ready for review December 2, 2024 15:48
@tenthirtyam tenthirtyam force-pushed the fix/player-version-checks branch from ce350b8 to 3e756a8 Compare December 4, 2024 02:03
- Updates the version checks.
- Updates log messages based on INFO or WARN context.
- Moves constants to the `driver.go` for easier maintenance.

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
@tenthirtyam tenthirtyam force-pushed the fix/player-version-checks branch from 3e756a8 to 457f39b Compare December 4, 2024 02:07
@tenthirtyam
Copy link
Collaborator Author

@lbajolet-hashicorp - ready to go!

Postive Tests: Min of 13.5.0; running 13.6.1.

2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] Checking VMware Fusion version...
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] VMware Fusion: 13.6.1
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] Checking VMware Fusion paths...
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] - VMware Fusion.app found at: /Applications/VMware Fusion.app
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] - vmware-vmx found at: /Applications/VMware Fusion.app/Contents/Library/vmware-vmx
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] - vmrun found at: /Applications/VMware Fusion.app/Contents/Library/vmrun
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 [INFO] - vmware-vdiskmanager found at: /Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager
2024/12/03 20:51:37 packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_arm64 plugin: 2024/12/03 20:51:37 Using driver *common.FusionDriver, Success: true

Negative Test: Min of 13.7.0 set as const for testing; running 13.6.1.

packer build --force -var-file=photon-4.0-R2.pkrvars.hcl .
vmware-iso.vagrant-vmw: output will be in this color.

Build 'vmware-iso.vagrant-vmw' errored after 74 milliseconds 855 microseconds: failed creating driver : driver initialization failed. fix at least one driver to continue:
* [ERROR] Requires VMware Fusion 13.7.0 or later, 13.6.1 installed

Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the rerolls @tenthirtyam

Merging now

@lbajolet-hashicorp lbajolet-hashicorp merged commit 1c153d8 into hashicorp:main Dec 5, 2024
14 checks passed
@tenthirtyam tenthirtyam deleted the fix/player-version-checks branch January 30, 2025 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants