Documentation ¶
Index ¶
- func ChooseComponentClasses(classes map[string]*v1alpha1.ComponentClassInstance, ...) *v1alpha1.ComponentClassInstance
- func GetClasses(classDefinitionList v1alpha1.ComponentClassDefinitionList) (map[string]map[string]*v1alpha1.ComponentClassInstance, error)
- func GetCustomClassObjectName(cdName string, componentName string) string
- func GetMinCPUAndMemory(model appsv1alpha1.ResourceConstraint) (*resource.Quantity, *resource.Quantity)
- func GetResourceConstraints(dynamic dynamic.Interface) (map[string]*v1alpha1.ComponentResourceConstraint, error)
- func ListClassesByClusterDefinition(client dynamic.Interface, cdName string) (map[string]map[string]*v1alpha1.ComponentClassInstance, error)
- func ParseComponentClasses(classDefinition v1alpha1.ComponentClassDefinition) (map[string]*v1alpha1.ComponentClassInstance, error)
- func ValidateComponentClass(comp *v1alpha1.ClusterComponentSpec, ...) (*v1alpha1.ComponentClassInstance, error)
- type ByClassCPUAndMemory
- type ByConstraintList
- type ConstraintWithName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChooseComponentClasses ¶
func ChooseComponentClasses(classes map[string]*v1alpha1.ComponentClassInstance, resources corev1.ResourceList) *v1alpha1.ComponentClassInstance
ChooseComponentClasses Choose the classes to be used for a given component with some constraints
func GetClasses ¶
func GetClasses(classDefinitionList v1alpha1.ComponentClassDefinitionList) (map[string]map[string]*v1alpha1.ComponentClassInstance, error)
func GetCustomClassObjectName ¶
GetCustomClassObjectName Returns the name of the ComponentClassDefinition object containing the custom classes
func GetMinCPUAndMemory ¶
func GetMinCPUAndMemory(model appsv1alpha1.ResourceConstraint) (*resource.Quantity, *resource.Quantity)
func GetResourceConstraints ¶
func GetResourceConstraints(dynamic dynamic.Interface) (map[string]*v1alpha1.ComponentResourceConstraint, error)
GetResourceConstraints get all resource constraints
func ListClassesByClusterDefinition ¶
func ListClassesByClusterDefinition(client dynamic.Interface, cdName string) (map[string]map[string]*v1alpha1.ComponentClassInstance, error)
ListClassesByClusterDefinition get all classes, including kubeblocks default classes and user custom classes
func ParseComponentClasses ¶
func ParseComponentClasses(classDefinition v1alpha1.ComponentClassDefinition) (map[string]*v1alpha1.ComponentClassInstance, error)
ParseComponentClasses parse ComponentClassDefinition to component classes
func ValidateComponentClass ¶
func ValidateComponentClass(comp *v1alpha1.ClusterComponentSpec, compClasses map[string]map[string]*v1alpha1.ComponentClassInstance) (*v1alpha1.ComponentClassInstance, error)
ValidateComponentClass check if component classDefRef or resource is invalid
Types ¶
type ByClassCPUAndMemory ¶
type ByClassCPUAndMemory []*appsv1alpha1.ComponentClassInstance
func (ByClassCPUAndMemory) Len ¶
func (b ByClassCPUAndMemory) Len() int
func (ByClassCPUAndMemory) Less ¶
func (b ByClassCPUAndMemory) Less(i, j int) bool
func (ByClassCPUAndMemory) Swap ¶
func (b ByClassCPUAndMemory) Swap(i, j int)
type ByConstraintList ¶
type ByConstraintList []ConstraintWithName
func (ByConstraintList) Len ¶
func (m ByConstraintList) Len() int
func (ByConstraintList) Less ¶
func (m ByConstraintList) Less(i, j int) bool
func (ByConstraintList) Swap ¶
func (m ByConstraintList) Swap(i, j int)
type ConstraintWithName ¶
type ConstraintWithName struct { Name string Constraint appsv1alpha1.ResourceConstraint }
Click to show internal directories.
Click to hide internal directories.