mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
feat(db): upgrade auto-backup backup and rollback support EE-867 EE-1158 (#5341)
* backport migration EE code structure * filesystem copy function * set db status to updating before migration - reset on completion * support for auto-backup on version upgrade * - rollback cli flag support (with confirmation) - rollback implementation backport from EE * removed edition as it is not required in CE * migrated test datastore from bolttest to bolt package to make it usable for testing * backported failsafe migration * - backported tests from EE - refactored tests to use test datastore * test store implementing datastore interface * addressed PR issues/improvements * refactor test * added backup file removal error logging * resolved conflicts, updated code * fixed missing bolttest package - migrated to bolt * feat(migration): wrap migration errors to provide context for failure EE-1742 (#5711) * feat(migrator): wrap errors to provide more context to failures EE-1742 * add overall failure back in. diff log file * updated helm tests pointing to correct teststore Co-authored-by: Matt Hook <hookenz@gmail.com>
This commit is contained in:
parent
03d34076d8
commit
377326085d
20 changed files with 980 additions and 383 deletions
|
@ -4,18 +4,12 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/portainer/portainer/api/bolt"
|
||||
|
||||
bolterrors "github.com/portainer/portainer/api/bolt/errors"
|
||||
|
||||
"github.com/portainer/portainer/api/bolt/bolttest"
|
||||
|
||||
"github.com/gofrs/uuid"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
"github.com/portainer/portainer/api/bolt"
|
||||
bolterrors "github.com/portainer/portainer/api/bolt/errors"
|
||||
"github.com/portainer/portainer/api/filesystem"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func newGuidString(t *testing.T) string {
|
||||
|
@ -35,7 +29,7 @@ func TestService_StackByWebhookID(t *testing.T) {
|
|||
if testing.Short() {
|
||||
t.Skip("skipping test in short mode. Normally takes ~1s to run.")
|
||||
}
|
||||
store, teardown := bolttest.MustNewTestStore(true)
|
||||
store, teardown := bolt.MustNewTestStore(true)
|
||||
defer teardown()
|
||||
|
||||
b := stackBuilder{t: t, store: store}
|
||||
|
@ -93,7 +87,7 @@ func Test_RefreshableStacks(t *testing.T) {
|
|||
if testing.Short() {
|
||||
t.Skip("skipping test in short mode. Normally takes ~1s to run.")
|
||||
}
|
||||
store, teardown := bolttest.MustNewTestStore(true)
|
||||
store, teardown := bolt.MustNewTestStore(true)
|
||||
defer teardown()
|
||||
|
||||
staticStack := portainer.Stack{ID: 1}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue