From 20f1f971ad71e2700839e27a7e74fbe2e020850c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 22 Jun 2023 12:36:46 -0400 Subject: [PATCH] lxc/rebuild: Don't stop all instances on force MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #11877 Signed-off-by: Stéphane Graber --- lxc/rebuild.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lxc/rebuild.go b/lxc/rebuild.go index 327a9c4e6db9..9e0f6ea96310 100644 --- a/lxc/rebuild.go +++ b/lxc/rebuild.go @@ -82,15 +82,13 @@ func (c *cmdRebuild) rebuild(conf *config.Config, args []string) error { // If the instance is running, stop it first. if c.flagForce && current.StatusCode == api.Running { - req := api.InstancesPut{ - State: &api.InstanceStatePut{ - Action: "stop", - Force: true, - }, + req := api.InstanceStatePut{ + Action: "stop", + Force: true, } // Update the instance. - op, err := d.UpdateInstances(req, "") + op, err := d.UpdateInstanceState(name, req, "") if err != nil { return err }