migrator

package
v0.0.0-...-4560a53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: Zlib Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFunctionName

func GetFunctionName(i interface{}) string

func MigrateStackEntryPoint

func MigrateStackEntryPoint(stackService dataservices.StackService) error

MigrateStackEntryPoint exported for testing

Types

type MigrationFuncs

type MigrationFuncs []func() error

type Migrations

type Migrations struct {
	Version        *semver.Version
	MigrationFuncs MigrationFuncs
}

type Migrator

type Migrator struct {
	TunnelServerService *tunnelserver.Service
	// contains filtered or unexported fields
}

Migrator defines a service to migrate data after a Portainer version update.

func NewMigrator

func NewMigrator(parameters *MigratorParameters) *Migrator

NewMigrator creates a new Migrator.

func (*Migrator) Always

func (m *Migrator) Always() error

Always is always run at the end of migrations

func (*Migrator) CurrentDBEdition

func (m *Migrator) CurrentDBEdition() portainer.SoftwareEdition

func (*Migrator) CurrentDBVersion

func (m *Migrator) CurrentDBVersion() string

func (*Migrator) CurrentSemanticDBVersion

func (m *Migrator) CurrentSemanticDBVersion() *semver.Version

func (*Migrator) GetMigratorCountOfCurrentAPIVersion

func (m *Migrator) GetMigratorCountOfCurrentAPIVersion() int

func (*Migrator) LatestMigrations

func (m *Migrator) LatestMigrations() Migrations

func (*Migrator) Migrate

func (m *Migrator) Migrate() error

Migrate checks the database version and migrate the existing data to the most recent data model.

func (*Migrator) MigrateSettingsToDB30

func (m *Migrator) MigrateSettingsToDB30() error

so setting to false and "", is what would happen without this code I'm going to bet there's zero point to changing the value inthe DB Public for testing

func (*Migrator) NeedsMigration

func (m *Migrator) NeedsMigration() bool

type MigratorParameters

type MigratorParameters struct {
	CurrentDBVersion        *models.Version
	EndpointGroupService    *endpointgroup.Service
	EndpointService         *endpoint.Service
	EndpointRelationService *endpointrelation.Service
	ExtensionService        *extension.Service
	FDOProfilesService      *fdoprofile.Service
	RegistryService         *registry.Service
	ResourceControlService  *resourcecontrol.Service
	RoleService             *role.Service
	ScheduleService         *schedule.Service
	SettingsService         *settings.Service
	SnapshotService         *snapshot.Service
	StackService            *stack.Service
	TagService              *tag.Service
	TeamMembershipService   *teammembership.Service
	UserService             *user.Service
	VersionService          *version.Service
	FileService             portainer.FileService
	AuthorizationService    *authorization.Service
	DockerhubService        *dockerhub.Service
	EdgeStackService        *edgestack.Service
	EdgeJobService          *edgejob.Service
	TunnelServerService     *tunnelserver.Service
}

MigratorParameters represents the required parameters to create a new Migrator instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL