Documentation ¶
Index ¶
- Variables
- func CalculateCPU(cc internaladminv1.ProjectComputeClassInstance, memDefault *int64, ...) (resource.Quantity, error)
- func GetAsProjectComputeClassInstance(ctx context.Context, c client.Client, namespace string, computeClass string) (*internaladminv1.ProjectComputeClassInstance, error)
- func GetClassForWorkload(ctx context.Context, c client.Client, ...) (*internaladminv1.ProjectComputeClassInstance, error)
- func GetComputeClassNameForWorkload(workload string, container internalv1.Container, ...) string
- func GetDefaultComputeClass(ctx context.Context, c client.Client, namespace string) (string, error)
- func ParseComputeClassMemory(memory internaladminv1.ComputeClassMemory) (memoryQuantities, error)
- func Validate(cc apiv1.ComputeClass, memory resource.Quantity, memDefault *int64) error
- func ValidateProjectComputeClass(cc internaladminv1.ProjectComputeClassInstance, memory resource.Quantity, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidMemoryForClass = errors.New("memory is invalid") ErrInvalidClass = errors.New("compute class is invalid") )
Functions ¶
func CalculateCPU ¶
func CalculateCPU(cc internaladminv1.ProjectComputeClassInstance, memDefault *int64, memory resource.Quantity) (resource.Quantity, error)
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 ParseComputeClassMemory ¶
func ParseComputeClassMemory(memory internaladminv1.ComputeClassMemory) (memoryQuantities, error)
func ValidateProjectComputeClass ¶
func ValidateProjectComputeClass(cc internaladminv1.ProjectComputeClassInstance, memory resource.Quantity, memDefault *int64) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.