pub struct CapacityRequirements {
pub requests: Option<BTreeMap<String, Quantity>>,
}
Expand description
CapacityRequirements defines the capacity requirements for a specific device request.
Fields§
§requests: Option<BTreeMap<String, Quantity>>
Requests represent individual device resource requests for distinct resources, all of which must be provided by the device.
This value is used as an additional filtering condition against the available capacity on the device. This is semantically equivalent to a CEL selector with device.capacity\[\<domain\>\].\<name\>.compareTo(quantity(\<request quantity\>)) \>= 0
. For example, device.capacity[‘test-driver.cdi.k8s.io’].counters.compareTo(quantity(‘2’)) >= 0.
When a requestPolicy is defined, the requested amount is adjusted upward to the nearest valid value based on the policy. If the requested amount cannot be adjusted to a valid value—because it exceeds what the requestPolicy allows— the device is considered ineligible for allocation.
For any capacity that is not explicitly requested: - If no requestPolicy is set, the default consumed capacity is equal to the full device capacity (i.e., the whole device is claimed).
- If a requestPolicy is set, the default consumed capacity is determined according to that policy.
If the device allows multiple allocation, the aggregated amount across all requests must not exceed the capacity value. The consumed capacity, which may be adjusted based on the requestPolicy if defined, is recorded in the resource claim’s status.devices[*].consumedCapacity field.
Trait Implementations§
Source§impl Clone for CapacityRequirements
impl Clone for CapacityRequirements
Source§fn clone(&self) -> CapacityRequirements
fn clone(&self) -> CapacityRequirements
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CapacityRequirements
impl Debug for CapacityRequirements
Source§impl DeepMerge for CapacityRequirements
impl DeepMerge for CapacityRequirements
Source§fn merge_from(&mut self, other: Self)
fn merge_from(&mut self, other: Self)
other
into self
.