From 23ce7c032b9bc84ace154468505377f0de9e91a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Jutteau?= Date: Tue, 20 Sep 2022 10:43:36 +0200 Subject: [PATCH] outscale_oapi: fix vm cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Jutteau --- internal/providers/outscale_oapi/outscale_oapi.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/providers/outscale_oapi/outscale_oapi.go b/internal/providers/outscale_oapi/outscale_oapi.go index abba22e..3c9f581 100644 --- a/internal/providers/outscale_oapi/outscale_oapi.go +++ b/internal/providers/outscale_oapi/outscale_oapi.go @@ -226,11 +226,11 @@ func (provider *OutscaleOAPI) readVms() []Object { } return vms } - for _, vm := range *read.Vms { + for i, vm := range *read.Vms { switch *vm.State { case "pending", "running", "stopping", "stopped", "shutting-down", "quarantine": vms = append(vms, *vm.VmId) - provider.cache.vms[*vm.VmId] = &vm + provider.cache.vms[*vm.VmId] = &(*read.Vms)[i] } } return vms