Don't merge Vagrantfile configs when merging targets to upsert to db

This commit is contained in:
sophia 2022-02-15 14:57:52 -06:00 committed by Paul Hinze
parent e9426b7a89
commit 34c4bac2ec
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -194,10 +194,13 @@ func (s *State) targetPut(
return erro
}
if foundTarget != nil {
// Make sure the config doesn't get merged - we want the config to overwrite the old config
finalConfig := proto.Clone(value.Configuration)
// Merge found target with provided target
proto.Merge(value, foundTarget)
value.ResourceId = foundTarget.ResourceId
value.Uuid = foundTarget.Uuid
value.Configuration = finalConfig.(*vagrant_plugin_sdk.Vagrantfile_MachineConfig)
} else {
s.log.Trace("target has no resource id and could not find matching target, assuming new target",
"target", value)