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 chooses the classes to be used for a given component with 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 gets all resource constraints
func ListClassesByClusterDefinition ¶
func ListClassesByClusterDefinition(client dynamic.Interface, cdName string) (map[string]map[string]*v1alpha1.ComponentClassInstance, error)
ListClassesByClusterDefinition gets all classes, including kubeblocks default classes and user custom classes
func ParseComponentClasses ¶
func ParseComponentClasses(classDefinition v1alpha1.ComponentClassDefinition) (map[string]*v1alpha1.ComponentClassInstance, error)
ParseComponentClasses parses ComponentClassDefinition to component classes
func ValidateComponentClass ¶
func ValidateComponentClass(comp *v1alpha1.ClusterComponentSpec, compClasses map[string]map[string]*v1alpha1.ComponentClassInstance) (*v1alpha1.ComponentClassInstance, error)
ValidateComponentClass checks if component classDefRef or resource is valid
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.