2023-05-17 02:31:46 +00:00
|
|
|
package migrator
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/rs/zerolog/log"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (m *Migrator) migrateDockerDesktopExtentionSetting() error {
|
|
|
|
log.Info().Msg("updating docker desktop extention flag in settings")
|
|
|
|
|
2023-05-17 22:21:07 +00:00
|
|
|
isDDExtension := false
|
2023-05-17 02:31:46 +00:00
|
|
|
if _, ok := os.LookupEnv("DOCKER_EXTENSION"); ok {
|
2023-05-17 22:21:07 +00:00
|
|
|
isDDExtension = true
|
2023-05-17 02:31:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
settings, err := m.settingsService.Settings()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2023-05-17 22:21:07 +00:00
|
|
|
settings.IsDockerDesktopExtension = isDDExtension
|
2023-05-17 02:31:46 +00:00
|
|
|
err = m.settingsService.UpdateSettings(settings)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|