mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
fix(dockerhub-migration): prevent duplicate migrated dockerhub entries EE-2042 (#6083)
* fix(migration) make dockerhub registry migration idempotent EE-2042 * add missing changes to make updateDockerhubToDB32 idempotent * add tests for bad migrations
This commit is contained in:
parent
761e102b2f
commit
b280eb6997
5 changed files with 154 additions and 2 deletions
|
@ -301,7 +301,7 @@ func (m *Migrator) Migrate() error {
|
|||
}
|
||||
}
|
||||
|
||||
// Portainer 2.9.1
|
||||
// Portainer 2.9.1, 2.9.2
|
||||
if m.currentDBVersion < 33 {
|
||||
err := m.migrateDBVersionToDB33()
|
||||
if err != nil {
|
||||
|
@ -316,6 +316,13 @@ func (m *Migrator) Migrate() error {
|
|||
}
|
||||
}
|
||||
|
||||
// Portainer 2.9.3 (yep out of order, but 2.10 is EE only)
|
||||
if m.currentDBVersion < 35 {
|
||||
if err := m.migrateDBVersionToDB35(); err != nil {
|
||||
return migrationError(err, "migrateDBVersionToDB35")
|
||||
}
|
||||
}
|
||||
|
||||
err = m.versionService.StoreDBVersion(portainer.DBVersion)
|
||||
if err != nil {
|
||||
return migrationError(err, "StoreDBVersion")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue