Documentation ¶
Overview ¶
Package validation provides UpgradeConfig CR validation tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ValidationBuilder ¶
type ValidationBuilder interface {
NewClient(configmanager.ConfigManager) (Validator, error)
}
ValidationBuilder is a interface that enables ValidationBuiler implementations
func NewBuilder ¶
func NewBuilder() ValidationBuilder
NewBuilder returns a validationBuilder object that implements the ValidationBuilder interface.
type ValidationConfig ¶
type ValidationConfig struct {
Validation validation `yaml:"validation"`
}
ValidationConfig holds fields that control version validation
func (*ValidationConfig) IsValid ¶
func (cfg *ValidationConfig) IsValid() error
IsValid returns a nil error when the UpgradeConfigManagerConfig is valid
type Validator ¶
type Validator interface {
IsValidUpgradeConfig(c client.Client, uC *upgradev1alpha1.UpgradeConfig, cV *configv1.ClusterVersion, logger logr.Logger) (ValidatorResult, error)
}
Validator knows how to validate UpgradeConfig CRs.
type ValidatorResult ¶
type ValidatorResult struct { // Indicates that the UpgradeConfig is semantically and syntactically valid IsValid bool // Indicates that the UpgradeConfig should be actioned to conduct an upgrade IsAvailableUpdate bool // A message associated with the validation result Message string }
ValidatorResult returns a type that enables validation of upgradeconfigs
type VersionComparison ¶
type VersionComparison int
VersionComparison is an in used to compare versions
const ( // VersionUnknown is of type VersionComparision and is used to idicate an unknown version VersionUnknown VersionComparison = iota - 2 // VersionDowngrade is of type VersionComparision and is used to idicate an version downgrade VersionDowngrade // VersionEqual is of type VersionComparision and is used to idicate version are equal VersionEqual // VersionUpgrade is of type VersionComparision and is used to idicate version is able to upgrade VersionUpgrade )
Click to show internal directories.
Click to hide internal directories.