workaround for mapstructure-to-hcl2 and booleans

This commit is contained in:
Tommy McNeely 2020-01-07 16:52:13 -07:00
parent e101676e29
commit e469140678
3 changed files with 2 additions and 3 deletions

View File

@ -37,7 +37,7 @@ type Config struct {
SnapshotEnable bool `mapstructure:"snapshot_enable"` SnapshotEnable bool `mapstructure:"snapshot_enable"`
SnapshotName string `mapstructure:"snapshot_name"` SnapshotName string `mapstructure:"snapshot_name"`
SnapshotDescription string `mapstructure:"snapshot_description"` SnapshotDescription string `mapstructure:"snapshot_description"`
ReregisterVM bool `mapstructure:"reregister_vm" default:true` ReregisterVM bool `mapstructure:"reregister_vm" default:"true"`
ctx interpolate.Context ctx interpolate.Context
} }

View File

@ -25,7 +25,7 @@ type FlatConfig struct {
SnapshotEnable *bool `mapstructure:"snapshot_enable" cty:"snapshot_enable"` SnapshotEnable *bool `mapstructure:"snapshot_enable" cty:"snapshot_enable"`
SnapshotName *string `mapstructure:"snapshot_name" cty:"snapshot_name"` SnapshotName *string `mapstructure:"snapshot_name" cty:"snapshot_name"`
SnapshotDescription *string `mapstructure:"snapshot_description" cty:"snapshot_description"` SnapshotDescription *string `mapstructure:"snapshot_description" cty:"snapshot_description"`
ReregisterVM *bool `mapstructure:"reregister_vm" cty:"reregister_vm"` ReregisterVM *bool `mapstructure:"reregister_vm" default:"true" cty:"reregister_vm"`
} }
// FlatMapstructure returns a new FlatConfig. // FlatMapstructure returns a new FlatConfig.

View File

@ -44,7 +44,6 @@ func (s *stepMarkAsTemplate) Run(ctx context.Context, state multistep.StateBag)
folder := state.Get("folder").(*object.Folder) folder := state.Get("folder").(*object.Folder)
dcPath := state.Get("dcPath").(string) dcPath := state.Get("dcPath").(string)
vm, err := findRuntimeVM(cli, dcPath, s.VMName, s.RemoteFolder) vm, err := findRuntimeVM(cli, dcPath, s.VMName, s.RemoteFolder)
if err != nil { if err != nil {
state.Put("error", err) state.Put("error", err)