From 004db306ad31cb5468c1409b67ee6bc0e8d50030 Mon Sep 17 00:00:00 2001 From: Arik Hadas Date: Sun, 24 Dec 2023 19:23:31 +0200 Subject: [PATCH] address: ineffectual assignment to upToDate (ineffassign) Signed-off-by: Arik Hadas --- pkg/controller/plan/adapter/openstack/client.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/controller/plan/adapter/openstack/client.go b/pkg/controller/plan/adapter/openstack/client.go index b3dbd00df..b3e379cad 100644 --- a/pkg/controller/plan/adapter/openstack/client.go +++ b/pkg/controller/plan/adapter/openstack/client.go @@ -833,13 +833,12 @@ func (r *Client) ensureImageUpToDate(vm *libclient.VM, image *libclient.Image) ( inventoryImage := &model.Image{} err = r.Context.Source.Inventory.Find(inventoryImage, ref.Ref{ID: image.ID}) if err != nil { - if !errors.As(err, &model.NotFoundError{}) { - return + if errors.As(err, &model.NotFoundError{}) { + err = nil + r.Log.Info("the image does not exist in the inventory, waiting...", + "vm", vm.Name, "image", image.Name, "properties", image.Properties) } - r.Log.Info("the image does not exist in the inventory, waiting...", - "vm", vm.Name, "image", image.Name, "properties", image.Properties) - upToDate = false - err = nil + return } upToDate = true if _, ok := inventoryImage.Properties[forkliftPropertyOriginalVolumeID]; !ok {