2021-09-28 22:39:45 +00:00
|
|
|
package migrator
|
|
|
|
|
2022-04-14 04:25:13 +00:00
|
|
|
import (
|
|
|
|
portainer "github.com/portainer/portainer/api"
|
|
|
|
)
|
2021-09-28 22:39:45 +00:00
|
|
|
|
|
|
|
func (m *Migrator) migrateDBVersionToDB33() error {
|
2022-04-14 04:25:13 +00:00
|
|
|
migrateLog.Info("- updating settings")
|
2021-09-28 22:39:45 +00:00
|
|
|
if err := m.migrateSettingsToDB33(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Migrator) migrateSettingsToDB33() error {
|
|
|
|
settings, err := m.settingsService.Settings()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2022-04-14 04:25:13 +00:00
|
|
|
migrateLog.Info("- setting default kubectl shell image")
|
2021-09-28 22:39:45 +00:00
|
|
|
settings.KubectlShellImage = portainer.DefaultKubectlShellImage
|
|
|
|
return m.settingsService.UpdateSettings(settings)
|
|
|
|
}
|