Documentation ¶
Index ¶
- Variables
- func UpgradeControllerAllowed(modelVersion, targetControllerVersion version.Number) (bool, version.Number, error)
- type Blocker
- type Model
- type ModelAgentService
- 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 NewServerFactory = lxd.NewServerFactory
For testing.
var SupportedJujuBases = corebase.WorkloadBases
For testing. TODO: unexport it if we don't need to patch it anymore.
Functions ¶
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 MigrationMode() state.MigrationMode }
Model defines a point of use interface for the model from state.
type ModelAgentService ¶
type ModelAgentService interface { // GetModelTargetAgentVersion returns the target agent version for the // entire model. The following errors can be returned: // - [github.com/juju/juju/domain/model/errors.NotFound] - When the model does // not exist. GetModelTargetAgentVersion(context.Context) (version.Number, error) }
ModelAgentService provides access to the Juju agent version for the model.
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( pool StatePool, state State, model Model, modelAgentService ModelAgentService, 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 { MachineCountForBase(base ...state.Base) (map[string]int, error) AllMachinesCount() (int, error) MongoCurrentStatus() (*replicaset.Status, error) }
State represents a point of use interface for modelling a current model.
type Validator ¶
type Validator func(pool StatePool, st State, model Model, modelAgentService ModelAgentService) (*Blocker, error)
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.