mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
fix(rollback): reimplement rollback feature [EE-6367] (#10721)
This commit is contained in:
parent
8f4d6e7e27
commit
eb23818f83
7 changed files with 295 additions and 364 deletions
|
@ -31,8 +31,14 @@ func (store *Store) Open() (newStore bool, err error) {
|
|||
}
|
||||
|
||||
if encryptionReq {
|
||||
backupFilename, err := store.Backup()
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to backup database prior to encrypting: %w", err)
|
||||
}
|
||||
|
||||
err = store.encryptDB()
|
||||
if err != nil {
|
||||
store.RestoreFromFile(backupFilename) // restore from backup if encryption fails
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue