computeclasses

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMemoryForClass = errors.New("memory is invalid")
	ErrInvalidClass          = errors.New("compute class is invalid")
)

Functions

func GetAsProjectComputeClassInstance

func GetAsProjectComputeClassInstance(ctx context.Context, c client.Client, namespace string, computeClass string) (*internaladminv1.ProjectComputeClassInstance, error)

GetAsProjectComputeClassInstance grabs the ComputeClass spec (agnostic of it being cluster or project scoped) for the provided ComputeClass name.

func GetClassForWorkload

func GetClassForWorkload(ctx context.Context, c client.Client, computeClasses internalv1.ComputeClassMap, container internalv1.Container, workload, namespace string) (*internaladminv1.ProjectComputeClassInstance, error)

GetClassForWorkload determines what ComputeClass should be used for the given appInstance, container and workload.

func GetComputeClassNameForWorkload

func GetComputeClassNameForWorkload(workload string, container internalv1.Container, computeClasses internalv1.ComputeClassMap) string

func GetDefaultComputeClass

func GetDefaultComputeClass(ctx context.Context, c client.Client, namespace string) (string, error)

func ParseComputeClassMemory

func ParseComputeClassMemory(memory internaladminv1.ComputeClassMemory) (memoryQuantities, error)

func Validate

func Validate(cc apiv1.ComputeClass, memory resource.Quantity, memDefault *int64) error

func ValidateProjectComputeClass

func ValidateProjectComputeClass(cc internaladminv1.ProjectComputeClassInstance, memory resource.Quantity, memDefault *int64) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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