hashicorp / packer-plugin-vsphere

Packer plugin for VMware vSphere Builder
https://www.packer.io/docs/builders/vsphere
Mozilla Public License 2.0
93 stars 91 forks source link

fix: ovftool error handling #413

Closed tenthirtyam closed 2 months ago

tenthirtyam commented 2 months ago

Summary

Testing

Build

packer-plugin-vsphere1 on ๎‚  fix/ovftool-error-handling- [?] via ๐Ÿน v1.22.2 
โžœ make generate
2024/04/25 09:52:13 Copying "docs" to ".docs/"
2024/04/25 09:52:13 Replacing @include '...' calls in .docs/
Compiling MDX docs in '.docs' to Markdown in '.web-docs'...

packer-plugin-vsphere1 on ๎‚  fix/ovftool-error-handling- [?] via ๐Ÿน v1.22.2 took 13.5s 
โžœ make build

packer-plugin-vsphere1 on ๎‚  fix/ovftool-error-handling- [?] via ๐Ÿน v1.22.2 took 5.0s 
โžœ make test
?       github.com/hashicorp/packer-plugin-vsphere      [no test files]
?       github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/testing       [no test files]
?       github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/examples/driver      [no test files]
?       github.com/hashicorp/packer-plugin-vsphere/version      [no test files]
ok      github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone        1.513s
ok      github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common       2.485s
ok      github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver       5.813s
ok      github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso  2.259s
ok      github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/supervisor   4.454s
ok      github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere       1.739s
ok      github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template      2.764s

Run

  1. If insecure is not provided or is set to false explicitly for the post-processor and the certificate is not trusted, it will fail with an error by capturing "Accept SSL fingerprint" in the stdout. Unfortunately, I'm unable to get it to pause and allow for user input with a fmt.Scanln(&response). (I've tried endlessly to get that to work. ยฏ\_(ใƒ„)_/ยฏ )

  2. If insecure is set to true, it will proceed and present a message.

=> vsphere-iso.linux-photon: Running post-processor:  (type vsphere)
    vsphere-iso.linux-photon (vsphere): Uploading /Users/ryan/Library/Mobile Documents/com~apple~CloudDocs/Code/Personal/<sensitive>-examples-for-vsphere12/artifacts/linux-photon-5.0-develop/linux-photon-5.0-develop.ovf to m01-vc01.rainpole.io
    vsphere-iso.linux-photon (vsphere): Validating username and password...
    vsphere-iso.linux-photon (vsphere): Skipping SSL thumbprint verification; insecure flag set to true...
    vsphere-iso.linux-photon (vsphere): Uploading virtual machine...
    vsphere-iso.linux-photon (vsphere): Opening OVF source: /Users/ryan/Library/Mobile Documents/com~apple~CloudDocs/Code/Personal/<sensitive>-examples-for-vsphere12/artifacts/linux-photon-5.0-develop/linux-photon-5.0-develop.ovf
    vsphere-iso.linux-photon (vsphere): The manifest validates

Reference

Closes #297