From f374e07fb0c2e3ddb2f86ae42248965302faf287 Mon Sep 17 00:00:00 2001 From: Ashley Cui Date: Fri, 12 Jan 2024 11:43:13 -0500 Subject: [PATCH] AppleHV: update LastUp time LastUp now correctly reports the lastUp time for podman machine on AppleHV, for both inspect and list. [NO NEW TESTS NEEDED] since this fixes an existing failing test. Signed-off-by: Ashley Cui --- pkg/machine/applehv/machine.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/machine/applehv/machine.go b/pkg/machine/applehv/machine.go index b617ab055b..fad985d959 100644 --- a/pkg/machine/applehv/machine.go +++ b/pkg/machine/applehv/machine.go @@ -759,8 +759,13 @@ func (m *MacMachine) Stop(name string, opts machine.StopOptions) error { logrus.Error(err) } }() + if err := m.Vfkit.Stop(false, true); err != nil { + return err + } - return m.Vfkit.Stop(false, true) + // keep track of last up + m.LastUp = time.Now() + return m.writeConfig() } // getVMConfigPath is a simple wrapper for getting the fully-qualified