class

package
v0.6.0-alpha.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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

func GetCustomClassObjectName(cdName string, componentName string) string

GetCustomClassObjectName returns the name of the ComponentClassDefinition object containing the custom classes

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL