Code of Conduct
Packer Version
1.15.0
Packer Plugin Version
2.1.0
Plugin Builder
Plugin Post-Processor
vSphere Version
8.0.3.00000
Description
Summary
Since upgrading from v2.0.0 to v2.1.0 of vmware/packer-plugin-vsphere, running packer validate on any template that includes an export {} block now fails with:
Error: null value is not allowed: [{{} export} {{} directory_permission}]
This is a regression since the same template validated and built successfully with v2.0.0. The directory_permission field is tagged required:"false" in the source, so omitting it should be valid.
Packer Configuration
https://gist.github.com/tech-priv/03ac8db0941028d272cd83d25c752bfb
Debug Output
https://gist.github.com/tech-priv/07b0c6adfee7a2124c1ad3deaab46eaa
Panic Output
No response
Expected Behavior
packer validate should succeed. The directory_permission field is documented as optional (required:"false"), so omitting it from the export {} block should be valid and fall back to the documented default of 0750.
This worked correctly with v2.0.0.
Actual Behavior
packer validate fails immediately with:
Error: null value is not allowed: [{{} export} {{} directory_permission}]
The error occurs even though directory_permission is not a required field. Attempts to explicitly supply the value result in further type errors:
- Setting
directory_permission = "0755" → Inappropriate value for attribute "directory_permission": bool required.
- Setting
directory_permission = true → Error: number value is required
- Setting
directory_permission = 0755 → Inappropriate value for attribute "directory_permission": bool required.
- Setting
directory_permission = 493 (decimal equivalent of octal 0755) → Inappropriate value for attribute "directory_permission": bool required.
The field appears to cycle between requiring a bool and a number, suggesting the HCL2 spec for this field is incorrectly generated.
Steps to Reproduce
- Install
packer-plugin-vsphere v2.1.0:
packer {
required_version = ">= 1.8.6"
required_plugins {
vsphere = {
version = ">= v2.1.0"
source = "github.com/vmware/vsphere"
}
}
}
- Define a
vsphere-iso source block with a minimal export {} block (see Gist configuration)
- Run with:
packer init .
packer validate .
Environment Details
No response
Screenshots
No response
References
No response
Code of Conduct
Packer Version
1.15.0
Packer Plugin Version
2.1.0
Plugin Builder
Plugin Post-Processor
vSphere Version
8.0.3.00000
Description
Summary
Since upgrading from
v2.0.0tov2.1.0ofvmware/packer-plugin-vsphere, runningpacker validateon any template that includes anexport {}block now fails with:This is a regression since the same template validated and built successfully with
v2.0.0. Thedirectory_permissionfield is taggedrequired:"false"in the source, so omitting it should be valid.Packer Configuration
https://gist.github.com/tech-priv/03ac8db0941028d272cd83d25c752bfb
Debug Output
https://gist.github.com/tech-priv/07b0c6adfee7a2124c1ad3deaab46eaa
Panic Output
No response
Expected Behavior
packer validateshould succeed. Thedirectory_permissionfield is documented as optional (required:"false"), so omitting it from theexport {}block should be valid and fall back to the documented default of0750.This worked correctly with
v2.0.0.Actual Behavior
packer validatefails immediately with:The error occurs even though
directory_permissionis not a required field. Attempts to explicitly supply the value result in further type errors:directory_permission = "0755"→Inappropriate value for attribute "directory_permission": bool required.directory_permission = true→Error: number value is requireddirectory_permission = 0755→Inappropriate value for attribute "directory_permission": bool required.directory_permission = 493(decimal equivalent of octal0755) →Inappropriate value for attribute "directory_permission": bool required.The field appears to cycle between requiring a
booland anumber, suggesting the HCL2 spec for this field is incorrectly generated.Steps to Reproduce
packer-plugin-vspherev2.1.0:vsphere-isosource block with a minimalexport {}block (see Gist configuration)Environment Details
No response
Screenshots
No response
References
No response