From 4b3a0fafa50d5644cba1d1b3e85d41fa851d5c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Wed, 9 Oct 2024 09:09:47 +0200 Subject: [PATCH] Regenerate the cloud-config.yaml on reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders F Björklund --- cmd/limactl/factory-reset.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/limactl/factory-reset.go b/cmd/limactl/factory-reset.go index 9e98f501639..c13a450fd2c 100644 --- a/cmd/limactl/factory-reset.go +++ b/cmd/limactl/factory-reset.go @@ -6,6 +6,7 @@ import ( "path/filepath" "strings" + "github.com/lima-vm/lima/pkg/cidata" "github.com/lima-vm/lima/pkg/instance" "github.com/lima-vm/lima/pkg/store" "github.com/lima-vm/lima/pkg/store/filenames" @@ -63,6 +64,11 @@ func factoryResetAction(_ *cobra.Command, args []string) error { } } } + // Regenerate the cloud-config.yaml, to reflect any changes to the global _config + if err := cidata.GenerateCloudConfig(inst.Dir, instName, inst.Config); err != nil { + logrus.Error(err) + } + logrus.Infof("Instance %q has been factory reset", instName) return nil }