hashicorp / packer-plugin-sdk

Packer Plugin SDK enables building Packer plugins (builders, provisioners, or post-processors) to manage any service providers or custom in-house solutions
Mozilla Public License 2.0
34 stars 46 forks source link

hcl2helper: preemptively panic on nil hcl spec #204

Closed lbajolet-hashicorp closed 1 year ago

lbajolet-hashicorp commented 1 year ago

When the code from a plugin differs from its generated FlatConfig, we may encounter a nil object spec for the values in the output of a component. This translates as a nil dereferencing panic within the hcl library, caused by a config and tags being out-of-sync.

To avoid users the hassle of delving in this code, and the hcl library's, we preemptively panic in the SDK code, with a message suggesting regenerating the code for the component's specs.