1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

feat(edge/templates): introduce edge app templates [EE-6209] (#10480)

This commit is contained in:
Chaim Lev-Ari 2023-11-14 14:54:44 +02:00 committed by GitHub
parent 95d96e1164
commit e1e90c9c1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 1142 additions and 365 deletions

View 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)
}