mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
feat(edge/templates): introduce edge app templates [EE-6209] (#10480)
This commit is contained in:
parent
95d96e1164
commit
e1e90c9c1d
58 changed files with 1142 additions and 365 deletions
|
@ -53,7 +53,7 @@ func (store *Store) checkOrCreateDefaultSettings() error {
|
|||
},
|
||||
SnapshotInterval: portainer.DefaultSnapshotInterval,
|
||||
EdgeAgentCheckinInterval: portainer.DefaultEdgeAgentCheckinIntervalInSeconds,
|
||||
TemplatesURL: portainer.DefaultTemplatesURL,
|
||||
TemplatesURL: "",
|
||||
HelmRepositoryURL: portainer.DefaultHelmRepositoryURL,
|
||||
UserSessionTimeout: portainer.DefaultUserSessionTimeout,
|
||||
KubeconfigExpiry: portainer.DefaultKubeconfigExpiry,
|
||||
|
|
|
@ -10,8 +10,8 @@ import (
|
|||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
func (m *Migrator) migrateDockerDesktopExtentionSetting() error {
|
||||
log.Info().Msg("updating docker desktop extention flag in settings")
|
||||
func (m *Migrator) migrateDockerDesktopExtensionSetting() error {
|
||||
log.Info().Msg("updating docker desktop extension flag in settings")
|
||||
|
||||
isDDExtension := false
|
||||
if _, ok := os.LookupEnv("DOCKER_EXTENSION"); ok {
|
||||
|
|
25
api/datastore/migrator/migrate_dbversion110.go
Normal file
25
api/datastore/migrator/migrate_dbversion110.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package migrator
|
||||
|
||||
import (
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
// updateAppTemplatesVersionForDB110 changes the templates URL to be empty if it was never changed
|
||||
// from the default value (version 2.0 URL)
|
||||
func (migrator *Migrator) updateAppTemplatesVersionForDB110() error {
|
||||
log.Info().Msg("updating app templates url to v3.0")
|
||||
|
||||
version2URL := "https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json"
|
||||
|
||||
settings, err := migrator.settingsService.Settings()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if settings.TemplatesURL == version2URL || settings.TemplatesURL == portainer.DefaultTemplatesURL {
|
||||
settings.TemplatesURL = ""
|
||||
}
|
||||
|
||||
return migrator.settingsService.UpdateSettings(settings)
|
||||
}
|
|
@ -14,8 +14,10 @@ func (m *Migrator) updateSettingsToDB25() error {
|
|||
return err
|
||||
}
|
||||
|
||||
// to keep the same migration functionality as before 2.20.0, we need to set the templates URL to v2
|
||||
version2URL := "https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json"
|
||||
if legacySettings.TemplatesURL == "" {
|
||||
legacySettings.TemplatesURL = portainer.DefaultTemplatesURL
|
||||
legacySettings.TemplatesURL = version2URL
|
||||
}
|
||||
|
||||
legacySettings.UserSessionTimeout = portainer.DefaultUserSessionTimeout
|
||||
|
|
|
@ -225,10 +225,14 @@ func (m *Migrator) initMigrations() {
|
|||
m.addMigrations("2.18", m.migrateDBVersionToDB90)
|
||||
m.addMigrations("2.19",
|
||||
m.convertSeedToPrivateKeyForDB100,
|
||||
m.migrateDockerDesktopExtentionSetting,
|
||||
m.migrateDockerDesktopExtensionSetting,
|
||||
m.updateEdgeStackStatusForDB100,
|
||||
)
|
||||
|
||||
m.addMigrations("2.20",
|
||||
m.updateAppTemplatesVersionForDB110,
|
||||
)
|
||||
|
||||
// Add new migrations below...
|
||||
// One function per migration, each versions migration funcs in the same file.
|
||||
}
|
||||
|
|
|
@ -645,7 +645,7 @@
|
|||
},
|
||||
"ShowKomposeBuildOption": false,
|
||||
"SnapshotInterval": "5m",
|
||||
"TemplatesURL": "https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json",
|
||||
"TemplatesURL": "",
|
||||
"TrustOnFirstConnect": false,
|
||||
"UserSessionTimeout": "8h",
|
||||
"fdoConfiguration": {
|
||||
|
@ -936,6 +936,6 @@
|
|||
}
|
||||
],
|
||||
"version": {
|
||||
"VERSION": "{\"SchemaVersion\":\"2.20.0\",\"MigratorCount\":0,\"Edition\":1,\"InstanceID\":\"463d5c47-0ea5-4aca-85b1-405ceefee254\"}"
|
||||
"VERSION": "{\"SchemaVersion\":\"2.20.0\",\"MigratorCount\":1,\"Edition\":1,\"InstanceID\":\"463d5c47-0ea5-4aca-85b1-405ceefee254\"}"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue