resources

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyMaximums

func ApplyMaximums(maximum corev1.ResourceList, desired ...corev1.ResourceRequirements) (result corev1.ResourceRequirements, modified bool)

ApplyMaximums checks the desired resource requirements against a maximum set of limits. Any desired requests or limits that exceed the maximum limits are reduced to the maximum. Any requests that exceed the maximum limits are also reduced to the maximum. Any missing limits are filled in with the maximum values. Multiple desired resource requirements can be provided, and they will be merged together (with the later ones taking precedence). The function will return the merged resource requirements and a boolean indicating if any modifications were made.

func ExceedsMaximums

func ExceedsMaximums(maximum corev1.ResourceList, desired ...corev1.ResourceRequirements) bool

ExceedsMaximums checks if any of the desired resource requirements exceed the specified maximum limits. It works identically to ApplyMaximums, but only returns a boolean indicating if any modifications were made.

func WithMaximums

WithMaximums applies a maximum set of resource limits to the desired resource requirements. It works identically to ApplyMaximums, but only returns the merged resource requirements without the modification flag.

Types

This section is empty.

Jump to

Keyboard shortcuts

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