1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00

fix(docker): add docker desktop extension flag in settings and add migration EE-5277 (#8948)

This commit is contained in:
Prabhat Khera 2023-05-17 14:31:46 +12:00 committed by GitHub
parent e156243e43
commit 83551201fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 55 additions and 3 deletions

View file

@ -1,6 +1,8 @@
package datastore
import (
"os"
portainer "github.com/portainer/portainer/api"
)
@ -20,6 +22,12 @@ func (store *Store) Init() error {
}
func (store *Store) checkOrCreateDefaultSettings() error {
isDDExtention := false
if _, ok := os.LookupEnv("DOCKER_EXTENSION"); ok {
isDDExtention = true
}
// TODO: these need to also be applied when importing
settings, err := store.SettingsService.Settings()
if store.IsErrObjectNotFound(err) {
@ -51,6 +59,8 @@ func (store *Store) checkOrCreateDefaultSettings() error {
UserSessionTimeout: portainer.DefaultUserSessionTimeout,
KubeconfigExpiry: portainer.DefaultKubeconfigExpiry,
KubectlShellImage: portainer.DefaultKubectlShellImage,
IsDockerDesktopExtention: isDDExtention,
}
return store.SettingsService.UpdateSettings(defaultSettings)