feat: add full snapshot downloads and safe manual restore
This commit is contained in:
@@ -340,6 +340,10 @@ func (a *API) upgrade(w http.ResponseWriter, r *http.Request, i store.Instance)
|
||||
}
|
||||
op := store.ID()
|
||||
snapshot, failedHome := "upgrade-"+op+"-snapshot", "failed-home-"+op
|
||||
if a.recordSnapshot(i, snapshot, i.Version, i.ImageID) != nil || a.recordSnapshot(i, failedHome, image.Config.Labels["dsh-mgr.version"], image.ID) != nil {
|
||||
fail(w, 500, "snapshot metadata unavailable")
|
||||
return
|
||||
}
|
||||
newName := runtimeNetwork(i.ID) + "-upgrade-" + op
|
||||
_, err = a.s.DB.Exec(`CREATE TABLE IF NOT EXISTS upgrade_journal (id TEXT PRIMARY KEY, instance_id TEXT NOT NULL, old_container TEXT NOT NULL, new_container TEXT NOT NULL DEFAULT '', new_name TEXT NOT NULL, image_id TEXT NOT NULL, snapshot TEXT NOT NULL, failed_home TEXT NOT NULL, phase TEXT NOT NULL)`)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user