diff --git a/DRAUPNIR_VERSION b/DRAUPNIR_VERSION index 26d99a28..ce7f2b42 100644 --- a/DRAUPNIR_VERSION +++ b/DRAUPNIR_VERSION @@ -1 +1 @@ -5.2.1 +5.2.2 diff --git a/pkg/server/api/routes/instances.go b/pkg/server/api/routes/instances.go index b11792ca..d27bf59d 100644 --- a/pkg/server/api/routes/instances.go +++ b/pkg/server/api/routes/instances.go @@ -257,14 +257,14 @@ func (i Instances) Destroy(w http.ResponseWriter, r *http.Request) error { } logger.With("instance", id).Info("destroying instance") - err = i.InstanceStore.Destroy(instance) + err = i.Executor.DestroyInstance(r.Context(), instance.ID) if err != nil { - return errors.Wrap(err, "failed to destroy instance") + return errors.Wrap(err, "failed to destroy instance on disk") } - err = i.Executor.DestroyInstance(r.Context(), instance.ID) + err = i.InstanceStore.Destroy(instance) if err != nil { - return errors.Wrap(err, "failed to destroy instance") + return errors.Wrap(err, "failed to remove instance from table") } // Destroying the instance will cascade and destroy any linked whitelisted