class

package
v0.5.2-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 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 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

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 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
}

Jump to

Keyboard shortcuts

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