Documentation ¶
Index ¶
- Variables
- func MigrateToAllowed(modelVersion, targetControllerVersion version.Number) (bool, version.Number, error)
- func UpgradeControllerAllowed(modelVersion, targetControllerVersion version.Number) (bool, version.Number, error)
- type Blocker
- type Model
- type ModelUpgradeBlockers
- type ModelUpgradeCheck
- type State
- type StatePool
- type Validator
- func ModelValidatorsForControllerModelUpgrade(targetVersion version.Number, cloudspec environscloudspec.CloudSpec) []Validator
- func ValidatorsForControllerModelUpgrade(targetVersion version.Number, cloudspec environscloudspec.CloudSpec) []Validator
- func ValidatorsForModelMigrationSource(cloudspec environscloudspec.CloudSpec) []Validator
- func ValidatorsForModelUpgrade(force bool, targetVersion version.Number, ...) []Validator
Constants ¶
This section is empty.
Variables ¶
var MinAgentVersions = map[int]version.Number{
3: version.MustParse("2.9.43"),
}
MinAgentVersions defines the minimum agent version allowed to make a call to a controller with the major version.
var MinClientVersions = map[int]version.Number{
3: version.MustParse("2.9.42"),
}
MinClientVersions defines the minimum user client version allowed to make a call to a controller with the major version, or the minimum controller version needed to accept a call from a client with the major version.
var MinMajorMigrateVersions = MinAgentVersions
MinMajorMigrateVersions defines the minimum version the model must be running before migrating to the target controller.
var NewServerFactory = lxd.NewServerFactory
For testing.
Functions ¶
func MigrateToAllowed ¶
func MigrateToAllowed(modelVersion, targetControllerVersion version.Number) (bool, version.Number, error)
MigrateToAllowed checks if the model can be migrated to the target controller.
func UpgradeControllerAllowed ¶
func UpgradeControllerAllowed(modelVersion, targetControllerVersion version.Number) (bool, version.Number, error)
UpgradeControllerAllowed returns true if a controller upgrade is allowed when it hosts a model with the specified version.
Types ¶
type Blocker ¶
type Blocker struct {
// contains filtered or unexported fields
}
Blocker describes a model upgrade blocker.
type Model ¶
type Model interface { Name() string Owner() names.UserTag AgentVersion() (version.Number, error) MigrationMode() state.MigrationMode }
Model defines a point of use interface for the model from state.
type ModelUpgradeBlockers ¶
type ModelUpgradeBlockers struct {
// contains filtered or unexported fields
}
ModelUpgradeBlockers holds a list of blockers for upgrading the provided model.
func NewModelUpgradeBlockers ¶
func NewModelUpgradeBlockers(modelName string, blockers ...Blocker) *ModelUpgradeBlockers
NewModelUpgradeBlockers creates a ModelUpgradeBlockers.
func (*ModelUpgradeBlockers) Join ¶
func (e *ModelUpgradeBlockers) Join(next *ModelUpgradeBlockers)
Join links the provided ModelUpgradeBlockers as the next node.
func (ModelUpgradeBlockers) String ¶
func (e ModelUpgradeBlockers) String() string
String returns the ModelUpgradeBlockers as a string.
type ModelUpgradeCheck ¶
type ModelUpgradeCheck struct {
// contains filtered or unexported fields
}
ModelUpgradeCheck sumarizes a list of blockers for upgrading the provided model.
func NewModelUpgradeCheck ¶
func NewModelUpgradeCheck( modelUUID string, pool StatePool, state State, model Model, validators ...Validator, ) *ModelUpgradeCheck
NewModelUpgradeCheck returns a ModelUpgradeCheck instance.
func (*ModelUpgradeCheck) Validate ¶
func (m *ModelUpgradeCheck) Validate() (*ModelUpgradeBlockers, error)
Validate runs the provided validators and returns blocks.
type State ¶
type State interface { AllCharmURLs() ([]*string, error) HasUpgradeSeriesLocks() (bool, error) MachineCountForBase(base ...state.Base) (map[string]int, error) MongoCurrentStatus() (*replicaset.Status, error) }
State represents a point of use interface for modelling a current model.
type Validator ¶
Validator returns a blocker.
func ModelValidatorsForControllerModelUpgrade ¶
func ModelValidatorsForControllerModelUpgrade( targetVersion version.Number, cloudspec environscloudspec.CloudSpec, ) []Validator
ModelValidatorsForControllerModelUpgrade returns a list of validators for non-controller models in a controller upgrade. Note: the target version can never be lower than the current version.
func ValidatorsForControllerModelUpgrade ¶
func ValidatorsForControllerModelUpgrade( targetVersion version.Number, cloudspec environscloudspec.CloudSpec, ) []Validator
ValidatorsForControllerModelUpgrade returns a list of validators for the controller model in a controller upgrade. Note: the target version can never be lower than the current version.
func ValidatorsForModelMigrationSource ¶
func ValidatorsForModelMigrationSource( cloudspec environscloudspec.CloudSpec, ) []Validator
ValidatorsForModelMigrationSource returns a list of validators to run source controller for model migration. Note: the target version can never be lower than the current version.
func ValidatorsForModelUpgrade ¶
func ValidatorsForModelUpgrade( force bool, targetVersion version.Number, cloudspec environscloudspec.CloudSpec, ) []Validator
ValidatorsForModelUpgrade returns a list of validators for model upgrade. Note: the target version can never be lower than the current version.