Documentation
¶
Index ¶
- Constants
- func CheckEachElementIsValid(cfg *configuration.ResourceQOSCfg, fldPath *field.Path) error
- func CheckNetQosCfg(cfg *configuration.ResourceQOSCfg, sysCfg *configuration.SystemCfg, ...) error
- func CheckOnlyOneFormat(cfg *configuration.ResourceQOSCfg) error
- func CheckSubNetQos(fldPath *field.Path, qos *v1alpha1.NetworkQOSCfg) error
- func CheckTotalPercentageIsValid(cfg *configuration.ResourceQOSCfg) error
- func CheckTotalQuantityIsValid(cfg *configuration.ResourceQOSCfg, sysCfg *configuration.SystemCfg) error
- func CreateCheckersAll(oldConfig *corev1.ConfigMap, config *corev1.ConfigMap, needUnmarshal bool) checkers
- func CreateCheckersChanged(oldConfig *corev1.ConfigMap, config *corev1.ConfigMap) checkers
- func ValidatePercentageField(value int, fldPath *field.Path) field.ErrorList
- func ValidatePercentageOrQuantity(intOrPercent *intstr.IntOrString, fldPath *field.Path) field.ErrorList
- func ValidateQuantityField(quantityStr string, fldPath *field.Path) field.ErrorList
- type CPUBurstChecker
- type ColocationConfigChecker
- type CommonChecker
- type ConfigChecker
- type ExsitNodeConflictMessage
- type NetDirection
- type NodeConfigProfileChecker
- type ResourceQOSChecker
- type ResourceThresholdChecker
- type SLOControllerPlugin
- type SystemConfigChecker
Constants ¶
View Source
const ( ReasonOverlap = err.Reason("NodeStrategiesOverlap") ReasonExistNodeConfict = err.Reason("ExistNodeConfict") ReasonParseFail = err.Reason("ParseConfigFail") ReasonParamInvalid = err.Reason("ConfigParamInvalid") )
View Source
const InitSuccess = "Success"
View Source
const ( // InvalidPercentageValueMsg is an error message for value must in percentage range. InvalidPercentageValueMsg string = `must be percentage value just in 0-100'` )
View Source
const NotInit = "NotInit"
View Source
const (
PluginName = "SLOConfig"
)
Variables ¶
This section is empty.
Functions ¶
func CheckEachElementIsValid ¶ added in v1.5.0
func CheckEachElementIsValid(cfg *configuration.ResourceQOSCfg, fldPath *field.Path) error
func CheckNetQosCfg ¶ added in v1.5.0
func CheckNetQosCfg(cfg *configuration.ResourceQOSCfg, sysCfg *configuration.SystemCfg, fldPath *field.Path) error
func CheckOnlyOneFormat ¶ added in v1.5.0
func CheckOnlyOneFormat(cfg *configuration.ResourceQOSCfg) error
func CheckSubNetQos ¶ added in v1.5.0
func CheckSubNetQos(fldPath *field.Path, qos *v1alpha1.NetworkQOSCfg) error
func CheckTotalPercentageIsValid ¶ added in v1.5.0
func CheckTotalPercentageIsValid(cfg *configuration.ResourceQOSCfg) error
func CheckTotalQuantityIsValid ¶ added in v1.5.0
func CheckTotalQuantityIsValid(cfg *configuration.ResourceQOSCfg, sysCfg *configuration.SystemCfg) error
func CreateCheckersAll ¶
func CreateCheckersChanged ¶
func ValidatePercentageField ¶ added in v1.5.0
ValidatePercentageField validates that given value is a percentage format just in 0-100.
func ValidatePercentageOrQuantity ¶ added in v1.5.0
func ValidatePercentageOrQuantity(intOrPercent *intstr.IntOrString, fldPath *field.Path) field.ErrorList
ValidatePercentageOrQuantity tests if a given value is a valid percentage or quantity (defines in: https://github.com/kubernetes/apimachinery/blob/master/pkg/api/resource/quantity.go#L100-L111).
Types ¶
type CPUBurstChecker ¶
type CPUBurstChecker struct { CommonChecker // contains filtered or unexported fields }
func NewCPUBurstChecker ¶
func NewCPUBurstChecker(oldConfig, newConfig *corev1.ConfigMap, needUnmarshal bool) *CPUBurstChecker
func (*CPUBurstChecker) ConfigParamValid ¶
func (c *CPUBurstChecker) ConfigParamValid() error
type ColocationConfigChecker ¶
type ColocationConfigChecker struct { CommonChecker // contains filtered or unexported fields }
func NewColocationConfigChecker ¶
func NewColocationConfigChecker(oldConfig, newConfig *corev1.ConfigMap, needUnmarshal bool) *ColocationConfigChecker
func (*ColocationConfigChecker) ConfigParamValid ¶
func (c *ColocationConfigChecker) ConfigParamValid() error
type CommonChecker ¶
type CommonChecker struct { OldConfigMap *corev1.ConfigMap NewConfigMap *corev1.ConfigMap NodeConfigProfileChecker // contains filtered or unexported fields }
func (*CommonChecker) CheckByValidator ¶
func (c *CommonChecker) CheckByValidator(config interface{}) error
func (*CommonChecker) InitStatus ¶
func (c *CommonChecker) InitStatus() string
func (*CommonChecker) IsCfgNotEmptyAndChanged ¶
func (c *CommonChecker) IsCfgNotEmptyAndChanged() bool
type ConfigChecker ¶
type ConfigChecker interface { IsCfgNotEmptyAndChanged() bool InitStatus() string ConfigParamValid() error NodeConfigProfileChecker }
type NetDirection ¶ added in v1.5.0
type NetDirection int64
NetDirection represents the stored type of IngressOrEgress
const ( Ingress NetDirection = iota // The IngressOrEgress holds an ingress. Egress // The IngressOrEgress holds an egress. )
type NodeConfigProfileChecker ¶
type NodeConfigProfileChecker interface { HasMultiNodeConfigs() bool //nodeConfigs nums > 1 ProfileParamValid() error //name must not conflict NodeSelectorOverlap() error //check nodeselector if overlap ExistNodeConflict(node *corev1.Node) error //check a node if exist conflict }
func CreateNodeConfigProfileChecker ¶
func CreateNodeConfigProfileChecker(configName string, profiles func() []configuration.NodeCfgProfile) (NodeConfigProfileChecker, error)
type ResourceQOSChecker ¶
type ResourceQOSChecker struct { CommonChecker // contains filtered or unexported fields }
func NewResourceQOSChecker ¶
func NewResourceQOSChecker(oldConfig, newConfig *corev1.ConfigMap, needUnmarshal bool) *ResourceQOSChecker
func (*ResourceQOSChecker) ConfigParamValid ¶
func (c *ResourceQOSChecker) ConfigParamValid() error
type ResourceThresholdChecker ¶
type ResourceThresholdChecker struct { CommonChecker // contains filtered or unexported fields }
func NewResourceThresholdChecker ¶
func NewResourceThresholdChecker(oldConfig, newConfig *corev1.ConfigMap, needUnmarshal bool) *ResourceThresholdChecker
func (*ResourceThresholdChecker) ConfigParamValid ¶
func (c *ResourceThresholdChecker) ConfigParamValid() error
type SLOControllerPlugin ¶
type SLOControllerPlugin struct {
// contains filtered or unexported fields
}
func NewPlugin ¶
func NewPlugin(decoder *ctrladmission.Decoder, client ctrlclient.Client) *SLOControllerPlugin
func (*SLOControllerPlugin) Admit ¶
func (cl *SLOControllerPlugin) Admit(ctx context.Context, req ctrladmission.Request, config, oldConfig *corev1.ConfigMap) error
func (*SLOControllerPlugin) Name ¶
func (cl *SLOControllerPlugin) Name() string
func (*SLOControllerPlugin) Validate ¶
func (cl *SLOControllerPlugin) Validate(ctx context.Context, req ctrladmission.Request, config, oldConfig *corev1.ConfigMap) error
type SystemConfigChecker ¶
type SystemConfigChecker struct { CommonChecker // contains filtered or unexported fields }
func NewSystemConfigChecker ¶
func NewSystemConfigChecker(oldConfig, newConfig *corev1.ConfigMap, needUnmarshal bool) *SystemConfigChecker
func (*SystemConfigChecker) ConfigParamValid ¶
func (c *SystemConfigChecker) ConfigParamValid() error
Click to show internal directories.
Click to hide internal directories.