Add idempotency when stopping a VM and some tests

When deleting a VM, we try to force stop it. If the VM is already stopped,
LXD will return an error. Unfortunately, we can't import the drivers package
from LXD without also pulling in a bunch of linux specific CGO dependencies
which we want to avoid.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2022-06-28 15:13:02 +00:00
parent b4e9af13d5
commit f52accc47f
13 changed files with 340 additions and 27 deletions

View file

@ -76,6 +76,10 @@ func (s *sqlDatabase) sqlToCommonOrganization(org Organization) params.Organizat
Pools: make([]params.Pool, len(org.Pools)),
}
for idx, pool := range org.Pools {
ret.Pools[idx] = s.sqlToCommonPool(pool)
}
return ret
}