From 34c4bac2ecfa24865ac0540be11062206e204152 Mon Sep 17 00:00:00 2001 From: sophia Date: Tue, 15 Feb 2022 14:57:52 -0600 Subject: [PATCH] Don't merge Vagrantfile configs when merging targets to upsert to db --- internal/server/singleprocess/state/target.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/server/singleprocess/state/target.go b/internal/server/singleprocess/state/target.go index d23958d90..04c3b653e 100644 --- a/internal/server/singleprocess/state/target.go +++ b/internal/server/singleprocess/state/target.go @@ -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)