|
|
@ -20,6 +20,7 @@ import (
|
|
|
|
"github.com/portainer/portainer/api/database/models"
|
|
|
|
"github.com/portainer/portainer/api/database/models"
|
|
|
|
"github.com/portainer/portainer/api/dataservices"
|
|
|
|
"github.com/portainer/portainer/api/dataservices"
|
|
|
|
"github.com/portainer/portainer/api/datastore"
|
|
|
|
"github.com/portainer/portainer/api/datastore"
|
|
|
|
|
|
|
|
"github.com/portainer/portainer/api/datastore/migrator"
|
|
|
|
"github.com/portainer/portainer/api/demo"
|
|
|
|
"github.com/portainer/portainer/api/demo"
|
|
|
|
"github.com/portainer/portainer/api/docker"
|
|
|
|
"github.com/portainer/portainer/api/docker"
|
|
|
|
dockerclient "github.com/portainer/portainer/api/docker/client"
|
|
|
|
dockerclient "github.com/portainer/portainer/api/docker/client"
|
|
|
@ -119,11 +120,15 @@ func initDataStore(flags *portainer.CLIFlags, secretKey []byte, fileService port
|
|
|
|
log.Fatal().Err(err).Msg("failed generating instance id")
|
|
|
|
log.Fatal().Err(err).Msg("failed generating instance id")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
migratorInstance := migrator.NewMigrator(&migrator.MigratorParameters{})
|
|
|
|
|
|
|
|
migratorCount := migratorInstance.GetMigratorCountOfCurrentAPIVersion()
|
|
|
|
|
|
|
|
|
|
|
|
// from MigrateData
|
|
|
|
// from MigrateData
|
|
|
|
v := models.Version{
|
|
|
|
v := models.Version{
|
|
|
|
SchemaVersion: portainer.APIVersion,
|
|
|
|
SchemaVersion: portainer.APIVersion,
|
|
|
|
Edition: int(portainer.PortainerCE),
|
|
|
|
Edition: int(portainer.PortainerCE),
|
|
|
|
InstanceID: instanceId.String(),
|
|
|
|
InstanceID: instanceId.String(),
|
|
|
|
|
|
|
|
MigratorCount: migratorCount,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
store.VersionService.UpdateVersion(&v)
|
|
|
|
store.VersionService.UpdateVersion(&v)
|
|
|
|
|
|
|
|
|
|
|
|