Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LatestVersion ¶ added in v2.50.0
func LatestVersion() int
LatestVersion returns the version of the most recent registered migration.
func MarkAllApplied ¶ added in v2.50.0
MarkAllApplied records every registered migration as applied without running any of them. It is meant for fresh deployments, where there is no data to migrate and running the migrations would needlessly block write operations while depending on services that may not be up yet.
The state file is created atomically and an existing state file is never overwritten, so instances starting in parallel converge on the same state.
Types ¶
type ImportSpaceMembersMigration ¶
type ImportSpaceMembersMigration struct {
// contains filtered or unexported fields
}
func (*ImportSpaceMembersMigration) Initialize ¶
func (m *ImportSpaceMembersMigration) Initialize(cfg config)
func (*ImportSpaceMembersMigration) Migrate ¶
func (m *ImportSpaceMembersMigration) Migrate() error
func (*ImportSpaceMembersMigration) Name ¶
func (m *ImportSpaceMembersMigration) Name() string
func (*ImportSpaceMembersMigration) Version ¶
func (m *ImportSpaceMembersMigration) Version() int
type MigrationConfig ¶
type MigrationConfig struct {
ServiceAccountID string
ServiceAccountSecret string
ProviderRegistryAddr string
}
MigrationConfig holds all caller-supplied options for a migration run. It is intentionally a plain struct so that new fields can be added without changing function signatures throughout the call chain.
type Migrations ¶
type Migrations struct {
// contains filtered or unexported fields
}
func New ¶
func New(logger zerolog.Logger, gatewaySelector pool.Selectable[gatewayv1beta1.GatewayAPIClient], storage metadata.Storage, cfg MigrationConfig, manager share.Manager, loader share.LoadableManager, ) Migrations
func (*Migrations) RunMigration ¶ added in v2.52.0
func (m *Migrations) RunMigration(name string) error
RunMigration runs the named migration, whether or not it has been applied before. It exists so that an operator can repeat a migration: the import_space_members migration for instance imports space grants that were written outside of the share manager, and has to be repeatable.
The recorded version is raised if the migration is newer than it, and never lowered.
func (*Migrations) RunMigrations ¶
func (m *Migrations) RunMigrations()
RunMigrations runs every migration that has not been applied yet, as recorded in the share manager's state.