Skip to main content

AdjustOrDefaultResource

AdjustOrDefaultResource validates resources conform to platform limits and assigns defaults for Request and Limit values by using the Request when the Limit is unset, and vice versa.

def AdjustOrDefaultResource(
request: resource.Quantity,
limit: resource.Quantity,
platformDefault: resource.Quantity,
platformLimit: resource.Quantity
) - > ResourceRequirement

Validates resources conform to platform limits and assigns defaults for Request and Limit values by using the Request when the Limit is unset, and vice versa.

Parameters

NameTypeDescription
requestresource.QuantityThe requested resource quantity. If zero, it will be set based on the limit or platform default.
limitresource.QuantityThe resource limit quantity. If zero, it will be set to the request quantity.
platformDefaultresource.QuantityThe default resource quantity provided by the platform, used if both request and limit are zero.
platformLimitresource.QuantityThe maximum resource quantity allowed by the platform, used to ensure the adjusted resources are within bounds.

Returns

TypeDescription
ResourceRequirementThe adjusted resource requirements ensuring they conform to platform limits and defaults.