From 3ba044c9b6cc040539282685fb0188c25bfb2f23 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 5 Oct 2024 08:35:55 -0700 Subject: [PATCH] vcsim: support clearing ManagedBy field Closes #3572 --- simulator/virtual_machine.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simulator/virtual_machine.go b/simulator/virtual_machine.go index b40a99b00..a58354cb6 100644 --- a/simulator/virtual_machine.go +++ b/simulator/virtual_machine.go @@ -277,7 +277,11 @@ func (vm *VirtualMachine) apply(spec *types.VirtualMachineConfigSpec) { } if spec.ManagedBy != nil { + if spec.ManagedBy.ExtensionKey == "" { + spec.ManagedBy = nil + } vm.Config.ManagedBy = spec.ManagedBy + vm.Summary.Config.ManagedBy = spec.ManagedBy } if spec.BootOptions != nil {