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"
|
2022-09-16 16:18:44 +00:00
|
|
|
|
|
|
|
"github.com/rs/zerolog/log"
|
2022-04-14 04:25:13 +00:00
|
|
|
)
|
2021-09-28 22:39:45 +00:00
|
|
|
|
|
|
|
func (m *Migrator) migrateDBVersionToDB33() error {
|
2022-09-16 16:18:44 +00:00
|
|
|
log.Info().Msg("updating settings")
|
2021-09-28 22:39:45 +00:00
|
|
|
|
2022-09-16 16:18:44 +00:00
|
|
|
return m.migrateSettingsToDB33()
|
2021-09-28 22:39:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Migrator) migrateSettingsToDB33() error {
|
2022-09-28 17:56:32 +00:00
|
|
|
log.Info().Msg("setting default kubctl shell")
|
2021-09-28 22:39:45 +00:00
|
|
|
settings, err := m.settingsService.Settings()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2022-09-16 16:18:44 +00:00
|
|
|
log.Info().Msg("setting default kubectl shell image")
|
2021-09-28 22:39:45 +00:00
|
|
|
settings.KubectlShellImage = portainer.DefaultKubectlShellImage
|
2022-09-16 16:18:44 +00:00
|
|
|
|
2021-09-28 22:39:45 +00:00
|
|
|
return m.settingsService.UpdateSettings(settings)
|
|
|
|
}
|