k8s_pb/api/resource/v1beta1/
mod.rs

1// This file is @generated by prost-build.
2/// AllocatedDeviceStatus contains the status of an allocated device, if the
3/// driver chooses to report it. This may include driver-specific information.
4///
5/// The combination of Driver, Pool, Device, and ShareID must match the corresponding key
6/// in Status.Allocation.Devices.
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct AllocatedDeviceStatus {
9    /// Driver specifies the name of the DRA driver whose kubelet
10    /// plugin should be invoked to process the allocation once the claim is
11    /// needed on a node.
12    ///
13    /// Must be a DNS subdomain and should end with a DNS domain owned by the
14    /// vendor of the driver. It should use only lower case characters.
15    ///
16    /// +required
17    #[prost(string, optional, tag = "1")]
18    pub driver: ::core::option::Option<::prost::alloc::string::String>,
19    /// This name together with the driver name and the device name field
20    /// identify which device was allocated (`<driver name>/<pool name>/<device name>`).
21    ///
22    /// Must not be longer than 253 characters and may contain one or more
23    /// DNS sub-domains separated by slashes.
24    ///
25    /// +required
26    #[prost(string, optional, tag = "2")]
27    pub pool: ::core::option::Option<::prost::alloc::string::String>,
28    /// Device references one device instance via its name in the driver's
29    /// resource pool. It must be a DNS label.
30    ///
31    /// +required
32    #[prost(string, optional, tag = "3")]
33    pub device: ::core::option::Option<::prost::alloc::string::String>,
34    /// ShareID uniquely identifies an individual allocation share of the device.
35    ///
36    /// +optional
37    /// +featureGate=DRAConsumableCapacity
38    /// +k8s:optional
39    /// +k8s:format=k8s-uuid
40    #[prost(string, optional, tag = "7")]
41    pub share_id: ::core::option::Option<::prost::alloc::string::String>,
42    /// Conditions contains the latest observation of the device's state.
43    /// If the device has been configured according to the class and claim
44    /// config references, the `Ready` condition should be True.
45    ///
46    /// Must not contain more than 8 entries.
47    ///
48    /// +optional
49    /// +listType=map
50    /// +listMapKey=type
51    #[prost(message, repeated, tag = "4")]
52    pub conditions:
53        ::prost::alloc::vec::Vec<super::super::super::apimachinery::pkg::apis::meta::v1::Condition>,
54    /// Data contains arbitrary driver-specific data.
55    ///
56    /// The length of the raw data must be smaller or equal to 10 Ki.
57    ///
58    /// +optional
59    #[prost(message, optional, tag = "5")]
60    pub data: ::core::option::Option<super::super::super::apimachinery::pkg::runtime::RawExtension>,
61    /// NetworkData contains network-related information specific to the device.
62    ///
63    /// +optional
64    /// +k8s:optional
65    #[prost(message, optional, tag = "6")]
66    pub network_data: ::core::option::Option<NetworkDeviceData>,
67}
68/// AllocationResult contains attributes of an allocated resource.
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct AllocationResult {
71    /// Devices is the result of allocating devices.
72    ///
73    /// +optional
74    #[prost(message, optional, tag = "1")]
75    pub devices: ::core::option::Option<DeviceAllocationResult>,
76    /// NodeSelector defines where the allocated resources are available. If
77    /// unset, they are available everywhere.
78    ///
79    /// +optional
80    #[prost(message, optional, tag = "3")]
81    pub node_selector: ::core::option::Option<super::super::core::v1::NodeSelector>,
82    /// AllocationTimestamp stores the time when the resources were allocated.
83    /// This field is not guaranteed to be set, in which case that time is unknown.
84    ///
85    /// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
86    /// feature gate.
87    ///
88    /// +optional
89    /// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
90    #[prost(message, optional, tag = "5")]
91    pub allocation_timestamp:
92        ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
93}
94/// BasicDevice defines one device instance.
95#[derive(Clone, PartialEq, ::prost::Message)]
96pub struct BasicDevice {
97    /// Attributes defines the set of attributes for this device.
98    /// The name of each attribute must be unique in that set.
99    ///
100    /// The maximum number of attributes and capacities combined is 32.
101    ///
102    /// +optional
103    #[prost(btree_map = "string, message", tag = "1")]
104    pub attributes: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, DeviceAttribute>,
105    /// Capacity defines the set of capacities for this device.
106    /// The name of each capacity must be unique in that set.
107    ///
108    /// The maximum number of attributes and capacities combined is 32.
109    ///
110    /// +optional
111    #[prost(btree_map = "string, message", tag = "2")]
112    pub capacity: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, DeviceCapacity>,
113    /// ConsumesCounters defines a list of references to sharedCounters
114    /// and the set of counters that the device will
115    /// consume from those counter sets.
116    ///
117    /// There can only be a single entry per counterSet.
118    ///
119    /// The maximum number of device counter consumptions per
120    /// device is 2.
121    ///
122    /// +optional
123    /// +k8s:optional
124    /// +listType=atomic
125    /// +k8s:listType=atomic
126    /// +k8s:unique=map
127    /// +k8s:listMapKey=counterSet
128    /// +featureGate=DRAPartitionableDevices
129    /// +k8s:maxItems=2
130    #[prost(message, repeated, tag = "3")]
131    pub consumes_counters: ::prost::alloc::vec::Vec<DeviceCounterConsumption>,
132    /// NodeName identifies the node where the device is available.
133    ///
134    /// Must only be set if Spec.PerDeviceNodeSelection is set to true.
135    /// At most one of NodeName, NodeSelector and AllNodes can be set.
136    ///
137    /// +optional
138    /// +oneOf=DeviceNodeSelection
139    /// +featureGate=DRAPartitionableDevices
140    #[prost(string, optional, tag = "4")]
141    pub node_name: ::core::option::Option<::prost::alloc::string::String>,
142    /// NodeSelector defines the nodes where the device is available.
143    ///
144    /// Must use exactly one term.
145    ///
146    /// Must only be set if Spec.PerDeviceNodeSelection is set to true.
147    /// At most one of NodeName, NodeSelector and AllNodes can be set.
148    ///
149    /// +optional
150    /// +oneOf=DeviceNodeSelection
151    #[prost(message, optional, tag = "5")]
152    pub node_selector: ::core::option::Option<super::super::core::v1::NodeSelector>,
153    /// AllNodes indicates that all nodes have access to the device.
154    ///
155    /// Must only be set if Spec.PerDeviceNodeSelection is set to true.
156    /// At most one of NodeName, NodeSelector and AllNodes can be set.
157    ///
158    /// +optional
159    /// +oneOf=DeviceNodeSelection
160    /// +featureGate=DRAPartitionableDevices
161    #[prost(bool, optional, tag = "6")]
162    pub all_nodes: ::core::option::Option<bool>,
163    /// If specified, these are the driver-defined taints.
164    ///
165    /// The maximum number of taints is 16. If taints are set for
166    /// any device in a ResourceSlice, then the maximum number of
167    /// allowed devices per ResourceSlice is 64 instead of 128.
168    ///
169    /// This is an alpha field and requires enabling the DRADeviceTaints
170    /// feature gate.
171    ///
172    /// +optional
173    /// +listType=atomic
174    /// +featureGate=DRADeviceTaints
175    #[prost(message, repeated, tag = "7")]
176    pub taints: ::prost::alloc::vec::Vec<DeviceTaint>,
177    /// BindsToNode indicates if the usage of an allocation involving this device
178    /// has to be limited to exactly the node that was chosen when allocating the claim.
179    /// If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector
180    /// to match the node where the allocation was made.
181    ///
182    /// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
183    /// feature gates.
184    ///
185    /// +optional
186    /// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
187    #[prost(bool, optional, tag = "8")]
188    pub binds_to_node: ::core::option::Option<bool>,
189    /// BindingConditions defines the conditions for proceeding with binding.
190    /// All of these conditions must be set in the per-device status
191    /// conditions with a value of True to proceed with binding the pod to the node
192    /// while scheduling the pod.
193    ///
194    /// The maximum number of binding conditions is 4.
195    ///
196    /// The conditions must be a valid condition type string.
197    ///
198    /// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
199    /// feature gates.
200    ///
201    /// +optional
202    /// +listType=atomic
203    /// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
204    /// +k8s:optional
205    /// +k8s:maxItems=4
206    #[prost(string, repeated, tag = "9")]
207    pub binding_conditions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
208    /// BindingFailureConditions defines the conditions for binding failure.
209    /// They may be set in the per-device status conditions.
210    /// If any is true, a binding failure occurred.
211    ///
212    /// The maximum number of binding failure conditions is 4.
213    ///
214    /// The conditions must be a valid condition type string.
215    ///
216    /// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
217    /// feature gates.
218    ///
219    /// +optional
220    /// +listType=atomic
221    /// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
222    /// +k8s:optional
223    /// +k8s:maxItems=4
224    #[prost(string, repeated, tag = "10")]
225    pub binding_failure_conditions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
226    /// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
227    ///
228    /// If AllowMultipleAllocations is set to true, the device can be allocated more than once,
229    /// and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.
230    ///
231    /// +optional
232    /// +featureGate=DRAConsumableCapacity
233    #[prost(bool, optional, tag = "11")]
234    pub allow_multiple_allocations: ::core::option::Option<bool>,
235}
236/// CELDeviceSelector contains a CEL expression for selecting a device.
237#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
238pub struct CelDeviceSelector {
239    /// Expression is a CEL expression which evaluates a single device. It
240    /// must evaluate to true when the device under consideration satisfies
241    /// the desired criteria, and false when it does not. Any other result
242    /// is an error and causes allocation of devices to abort.
243    ///
244    /// The expression's input is an object named "device", which carries
245    /// the following properties:
246    ///   - driver (string): the name of the driver which defines this device.
247    ///   - attributes (map\[string\]object): the device's attributes, grouped by prefix
248    ///     (e.g. device.attributes\["dra.example.com"\] evaluates to an object with all
249    ///     of the attributes which were prefixed by "dra.example.com".
250    ///   - capacity (map\[string\]object): the device's capacities, grouped by prefix.
251    ///   - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device
252    ///     (v1.34+ with the DRAConsumableCapacity feature enabled).
253    ///
254    /// Example: Consider a device with driver="dra.example.com", which exposes
255    /// two attributes named "model" and "ext.example.com/family" and which
256    /// exposes one capacity named "modules". This input to this expression
257    /// would have the following fields:
258    ///
259    ///      device.driver
260    ///      device.attributes\["dra.example.com"\].model
261    ///      device.attributes\["ext.example.com"\].family
262    ///      device.capacity\["dra.example.com"\].modules
263    ///
264    /// The device.driver field can be used to check for a specific driver,
265    /// either as a high-level precondition (i.e. you only want to consider
266    /// devices from this driver) or as part of a multi-clause expression
267    /// that is meant to consider devices from different drivers.
268    ///
269    /// The value type of each attribute is defined by the device
270    /// definition, and users who write these expressions must consult the
271    /// documentation for their specific drivers. The value type of each
272    /// capacity is Quantity.
273    ///
274    /// If an unknown prefix is used as a lookup in either device.attributes
275    /// or device.capacity, an empty map will be returned. Any reference to
276    /// an unknown field will cause an evaluation error and allocation to
277    /// abort.
278    ///
279    /// A robust expression should check for the existence of attributes
280    /// before referencing them.
281    ///
282    /// For ease of use, the cel.bind() function is enabled, and can be used
283    /// to simplify expressions that access multiple attributes with the
284    /// same domain. For example:
285    ///
286    ///      cel.bind(dra, device.attributes\["dra.example.com"\], dra.someBool && dra.anotherBool)
287    ///
288    /// The length of the expression must be smaller or equal to 10 Ki. The
289    /// cost of evaluating it is also limited based on the estimated number
290    /// of logical steps.
291    ///
292    /// +required
293    #[prost(string, optional, tag = "1")]
294    pub expression: ::core::option::Option<::prost::alloc::string::String>,
295}
296/// CapacityRequestPolicy defines how requests consume device capacity.
297///
298/// Must not set more than one ValidRequestValues.
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct CapacityRequestPolicy {
301    /// Default specifies how much of this capacity is consumed by a request
302    /// that does not contain an entry for it in DeviceRequest's Capacity.
303    ///
304    /// +optional
305    #[prost(message, optional, tag = "1")]
306    pub default: ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
307    /// ValidValues defines a set of acceptable quantity values in consuming requests.
308    ///
309    /// Must not contain more than 10 entries.
310    /// Must be sorted in ascending order.
311    ///
312    /// If this field is set,
313    /// Default must be defined and it must be included in ValidValues list.
314    ///
315    /// If the requested amount does not match any valid value but smaller than some valid values,
316    /// the scheduler calculates the smallest valid value that is greater than or equal to the request.
317    /// That is: min(ceil(requestedValue) ∈ validValues), where requestedValue ≤ max(validValues).
318    ///
319    /// If the requested amount exceeds all valid values, the request violates the policy,
320    /// and this device cannot be allocated.
321    ///
322    /// +optional
323    /// +listType=atomic
324    /// +oneOf=ValidRequestValues
325    #[prost(message, repeated, tag = "3")]
326    pub valid_values:
327        ::prost::alloc::vec::Vec<super::super::super::apimachinery::pkg::api::resource::Quantity>,
328    /// ValidRange defines an acceptable quantity value range in consuming requests.
329    ///
330    /// If this field is set,
331    /// Default must be defined and it must fall within the defined ValidRange.
332    ///
333    /// If the requested amount does not fall within the defined range, the request violates the policy,
334    /// and this device cannot be allocated.
335    ///
336    /// If the request doesn't contain this capacity entry, Default value is used.
337    ///
338    /// +optional
339    /// +oneOf=ValidRequestValues
340    #[prost(message, optional, tag = "4")]
341    pub valid_range: ::core::option::Option<CapacityRequestPolicyRange>,
342}
343/// CapacityRequestPolicyRange defines a valid range for consumable capacity values.
344///
345///    - If the requested amount is less than Min, it is rounded up to the Min value.
346///    - If Step is set and the requested amount is between Min and Max but not aligned with Step,
347///      it will be rounded up to the next value equal to Min + (n * Step).
348///    - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set).
349///    - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy,
350///      and the device cannot be allocated.
351#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
352pub struct CapacityRequestPolicyRange {
353    /// Min specifies the minimum capacity allowed for a consumption request.
354    ///
355    /// Min must be greater than or equal to zero,
356    /// and less than or equal to the capacity value.
357    /// requestPolicy.default must be more than or equal to the minimum.
358    ///
359    /// +required
360    #[prost(message, optional, tag = "1")]
361    pub min: ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
362    /// Max defines the upper limit for capacity that can be requested.
363    ///
364    /// Max must be less than or equal to the capacity value.
365    /// Min and requestPolicy.default must be less than or equal to the maximum.
366    ///
367    /// +optional
368    #[prost(message, optional, tag = "2")]
369    pub max: ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
370    /// Step defines the step size between valid capacity amounts within the range.
371    ///
372    /// Max (if set) and requestPolicy.default must be a multiple of Step.
373    /// Min + Step must be less than or equal to the capacity value.
374    ///
375    /// +optional
376    #[prost(message, optional, tag = "3")]
377    pub step: ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
378}
379/// CapacityRequirements defines the capacity requirements for a specific device request.
380#[derive(Clone, PartialEq, ::prost::Message)]
381pub struct CapacityRequirements {
382    /// Requests represent individual device resource requests for distinct resources,
383    /// all of which must be provided by the device.
384    ///
385    /// This value is used as an additional filtering condition against the available capacity on the device.
386    /// This is semantically equivalent to a CEL selector with
387    /// `device.capacity\[<domain>\].<name>.compareTo(quantity(<request quantity>)) >= 0`.
388    /// For example, device.capacity\['test-driver.cdi.k8s.io'\].counters.compareTo(quantity('2')) >= 0.
389    ///
390    /// When a requestPolicy is defined, the requested amount is adjusted upward
391    /// to the nearest valid value based on the policy.
392    /// If the requested amount cannot be adjusted to a valid value—because it exceeds what the requestPolicy allows—
393    /// the device is considered ineligible for allocation.
394    ///
395    /// For any capacity that is not explicitly requested:
396    /// - If no requestPolicy is set, the default consumed capacity is equal to the full device capacity
397    ///    (i.e., the whole device is claimed).
398    /// - If a requestPolicy is set, the default consumed capacity is determined according to that policy.
399    ///
400    /// If the device allows multiple allocation,
401    /// the aggregated amount across all requests must not exceed the capacity value.
402    /// The consumed capacity, which may be adjusted based on the requestPolicy if defined,
403    /// is recorded in the resource claim’s status.devices\[*\].consumedCapacity field.
404    ///
405    /// +optional
406    #[prost(btree_map = "string, message", tag = "1")]
407    pub requests: ::prost::alloc::collections::BTreeMap<
408        ::prost::alloc::string::String,
409        super::super::super::apimachinery::pkg::api::resource::Quantity,
410    >,
411}
412/// Counter describes a quantity associated with a device.
413#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
414pub struct Counter {
415    /// Value defines how much of a certain device counter is available.
416    ///
417    /// +required
418    #[prost(message, optional, tag = "1")]
419    pub value: ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
420}
421/// CounterSet defines a named set of counters
422/// that are available to be used by devices defined in the
423/// ResourcePool.
424///
425/// The counters are not allocatable by themselves, but
426/// can be referenced by devices. When a device is allocated,
427/// the portion of counters it uses will no longer be available for use
428/// by other devices.
429#[derive(Clone, PartialEq, ::prost::Message)]
430pub struct CounterSet {
431    /// Name defines the name of the counter set.
432    /// It must be a DNS label.
433    ///
434    /// +required
435    /// +k8s:required
436    /// +k8s:format=k8s-short-name
437    #[prost(string, optional, tag = "1")]
438    pub name: ::core::option::Option<::prost::alloc::string::String>,
439    /// Counters defines the set of counters for this CounterSet
440    /// The name of each counter must be unique in that set and must be a DNS label.
441    ///
442    /// The maximum number of counters is 32.
443    ///
444    /// +required
445    #[prost(btree_map = "string, message", tag = "2")]
446    pub counters: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, Counter>,
447}
448/// Device represents one individual hardware instance that can be selected based
449/// on its attributes. Besides the name, exactly one field must be set.
450#[derive(Clone, PartialEq, ::prost::Message)]
451pub struct Device {
452    /// Name is unique identifier among all devices managed by
453    /// the driver in the pool. It must be a DNS label.
454    ///
455    /// +required
456    #[prost(string, optional, tag = "1")]
457    pub name: ::core::option::Option<::prost::alloc::string::String>,
458    /// Basic defines one device instance.
459    ///
460    /// +optional
461    /// +oneOf=deviceType
462    #[prost(message, optional, tag = "2")]
463    pub basic: ::core::option::Option<BasicDevice>,
464}
465/// DeviceAllocationConfiguration gets embedded in an AllocationResult.
466#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
467pub struct DeviceAllocationConfiguration {
468    /// Source records whether the configuration comes from a class and thus
469    /// is not something that a normal user would have been able to set
470    /// or from a claim.
471    ///
472    /// +required
473    /// +k8s:required
474    #[prost(string, optional, tag = "1")]
475    pub source: ::core::option::Option<::prost::alloc::string::String>,
476    /// Requests lists the names of requests where the configuration applies.
477    /// If empty, its applies to all requests.
478    ///
479    /// References to subrequests must include the name of the main request
480    /// and may include the subrequest using the format <main request>\[/<subrequest>\]. If just
481    /// the main request is given, the configuration applies to all subrequests.
482    ///
483    /// +optional
484    /// +listType=atomic
485    /// +k8s:optional
486    /// +k8s:listType=atomic
487    /// +k8s:unique=set
488    /// +k8s:maxItems=32
489    #[prost(string, repeated, tag = "2")]
490    pub requests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
491    #[prost(message, optional, tag = "3")]
492    pub device_configuration: ::core::option::Option<DeviceConfiguration>,
493}
494/// DeviceAllocationResult is the result of allocating devices.
495#[derive(Clone, PartialEq, ::prost::Message)]
496pub struct DeviceAllocationResult {
497    /// Results lists all allocated devices.
498    ///
499    /// +optional
500    /// +listType=atomic
501    /// +k8s:optional
502    /// +k8s:maxItems=32
503    #[prost(message, repeated, tag = "1")]
504    pub results: ::prost::alloc::vec::Vec<DeviceRequestAllocationResult>,
505    /// This field is a combination of all the claim and class configuration parameters.
506    /// Drivers can distinguish between those based on a flag.
507    ///
508    /// This includes configuration parameters for drivers which have no allocated
509    /// devices in the result because it is up to the drivers which configuration
510    /// parameters they support. They can silently ignore unknown configuration
511    /// parameters.
512    ///
513    /// +optional
514    /// +listType=atomic
515    /// +k8s:optional
516    /// +k8s:maxItems=64
517    #[prost(message, repeated, tag = "2")]
518    pub config: ::prost::alloc::vec::Vec<DeviceAllocationConfiguration>,
519}
520/// DeviceAttribute must have exactly one field set.
521#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
522pub struct DeviceAttribute {
523    /// IntValue is a number.
524    ///
525    /// +optional
526    /// +k8s:optional
527    /// +k8s:unionMember
528    #[prost(int64, optional, tag = "2")]
529    pub int: ::core::option::Option<i64>,
530    /// BoolValue is a true/false value.
531    ///
532    /// +optional
533    /// +k8s:optional
534    /// +k8s:unionMember
535    #[prost(bool, optional, tag = "3")]
536    pub bool: ::core::option::Option<bool>,
537    /// StringValue is a string. Must not be longer than 64 characters.
538    ///
539    /// +optional
540    /// +k8s:optional
541    /// +k8s:unionMember
542    #[prost(string, optional, tag = "4")]
543    pub string: ::core::option::Option<::prost::alloc::string::String>,
544    /// VersionValue is a semantic version according to semver.org spec 2.0.0.
545    /// Must not be longer than 64 characters.
546    ///
547    /// +optional
548    /// +k8s:optional
549    /// +k8s:unionMember
550    #[prost(string, optional, tag = "5")]
551    pub version: ::core::option::Option<::prost::alloc::string::String>,
552}
553/// DeviceCapacity describes a quantity associated with a device.
554#[derive(Clone, PartialEq, ::prost::Message)]
555pub struct DeviceCapacity {
556    /// Value defines how much of a certain capacity that device has.
557    ///
558    /// This field reflects the fixed total capacity and does not change.
559    /// The consumed amount is tracked separately by scheduler
560    /// and does not affect this value.
561    ///
562    /// +required
563    #[prost(message, optional, tag = "1")]
564    pub value: ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
565    /// RequestPolicy defines how this DeviceCapacity must be consumed
566    /// when the device is allowed to be shared by multiple allocations.
567    ///
568    /// The Device must have allowMultipleAllocations set to true in order to set a requestPolicy.
569    ///
570    /// If unset, capacity requests are unconstrained:
571    /// requests can consume any amount of capacity, as long as the total consumed
572    /// across all allocations does not exceed the device's defined capacity.
573    /// If request is also unset, default is the full capacity value.
574    ///
575    /// +optional
576    /// +featureGate=DRAConsumableCapacity
577    #[prost(message, optional, tag = "2")]
578    pub request_policy: ::core::option::Option<CapacityRequestPolicy>,
579}
580/// DeviceClaim defines how to request devices with a ResourceClaim.
581#[derive(Clone, PartialEq, ::prost::Message)]
582pub struct DeviceClaim {
583    /// Requests represent individual requests for distinct devices which
584    /// must all be satisfied. If empty, nothing needs to be allocated.
585    ///
586    /// +optional
587    /// +listType=atomic
588    /// +k8s:optional
589    /// +k8s:listType=atomic
590    /// +k8s:unique=map
591    /// +k8s:listMapKey=name
592    /// +k8s:maxItems=32
593    #[prost(message, repeated, tag = "1")]
594    pub requests: ::prost::alloc::vec::Vec<DeviceRequest>,
595    /// These constraints must be satisfied by the set of devices that get
596    /// allocated for the claim.
597    ///
598    /// +optional
599    /// +listType=atomic
600    /// +k8s:optional
601    /// +k8s:maxItems=32
602    #[prost(message, repeated, tag = "2")]
603    pub constraints: ::prost::alloc::vec::Vec<DeviceConstraint>,
604    /// This field holds configuration for multiple potential drivers which
605    /// could satisfy requests in this claim. It is ignored while allocating
606    /// the claim.
607    ///
608    /// +optional
609    /// +listType=atomic
610    /// +k8s:optional
611    /// +k8s:maxItems=32
612    #[prost(message, repeated, tag = "3")]
613    pub config: ::prost::alloc::vec::Vec<DeviceClaimConfiguration>,
614}
615/// DeviceClaimConfiguration is used for configuration parameters in DeviceClaim.
616#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
617pub struct DeviceClaimConfiguration {
618    /// Requests lists the names of requests where the configuration applies.
619    /// If empty, it applies to all requests.
620    ///
621    /// References to subrequests must include the name of the main request
622    /// and may include the subrequest using the format <main request>\[/<subrequest>\]. If just
623    /// the main request is given, the configuration applies to all subrequests.
624    ///
625    /// +optional
626    /// +listType=atomic
627    /// +k8s:optional
628    /// +k8s:listType=atomic
629    /// +k8s:unique=set
630    /// +k8s:maxItems=32
631    #[prost(string, repeated, tag = "1")]
632    pub requests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
633    #[prost(message, optional, tag = "2")]
634    pub device_configuration: ::core::option::Option<DeviceConfiguration>,
635}
636/// DeviceClass is a vendor- or admin-provided resource that contains
637/// device configuration and selectors. It can be referenced in
638/// the device requests of a claim to apply these presets.
639/// Cluster scoped.
640///
641/// This is an alpha type and requires enabling the DynamicResourceAllocation
642/// feature gate.
643#[derive(Clone, PartialEq, ::prost::Message)]
644pub struct DeviceClass {
645    /// Standard object metadata
646    /// +optional
647    /// +k8s:subfield(name)=+k8s:optional
648    /// +k8s:subfield(name)=+k8s:format=k8s-long-name
649    #[prost(message, optional, tag = "1")]
650    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
651    /// Spec defines what can be allocated and how to configure it.
652    ///
653    /// This is mutable. Consumers have to be prepared for classes changing
654    /// at any time, either because they get updated or replaced. Claim
655    /// allocations are done once based on whatever was set in classes at
656    /// the time of allocation.
657    ///
658    /// Changing the spec automatically increments the metadata.generation number.
659    #[prost(message, optional, tag = "2")]
660    pub spec: ::core::option::Option<DeviceClassSpec>,
661}
662/// DeviceClassConfiguration is used in DeviceClass.
663#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
664pub struct DeviceClassConfiguration {
665    #[prost(message, optional, tag = "1")]
666    pub device_configuration: ::core::option::Option<DeviceConfiguration>,
667}
668/// DeviceClassList is a collection of classes.
669#[derive(Clone, PartialEq, ::prost::Message)]
670pub struct DeviceClassList {
671    /// Standard list metadata
672    /// +optional
673    #[prost(message, optional, tag = "1")]
674    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
675    /// Items is the list of resource classes.
676    #[prost(message, repeated, tag = "2")]
677    pub items: ::prost::alloc::vec::Vec<DeviceClass>,
678}
679/// DeviceClassSpec is used in a \[DeviceClass\] to define what can be allocated
680/// and how to configure it.
681#[derive(Clone, PartialEq, ::prost::Message)]
682pub struct DeviceClassSpec {
683    /// Each selector must be satisfied by a device which is claimed via this class.
684    ///
685    /// +optional
686    /// +listType=atomic
687    /// +k8s:optional
688    /// +k8s:maxItems=32
689    #[prost(message, repeated, tag = "1")]
690    pub selectors: ::prost::alloc::vec::Vec<DeviceSelector>,
691    /// Config defines configuration parameters that apply to each device that is claimed via this class.
692    /// Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor
693    /// configuration applies to exactly one driver.
694    ///
695    /// They are passed to the driver, but are not considered while allocating the claim.
696    ///
697    /// +optional
698    /// +listType=atomic
699    /// +k8s:optional
700    /// +k8s:maxItems=32
701    #[prost(message, repeated, tag = "2")]
702    pub config: ::prost::alloc::vec::Vec<DeviceClassConfiguration>,
703    /// ExtendedResourceName is the extended resource name for the devices of this class.
704    /// The devices of this class can be used to satisfy a pod's extended resource requests.
705    /// It has the same format as the name of a pod's extended resource.
706    /// It should be unique among all the device classes in a cluster.
707    /// If two device classes have the same name, then the class created later
708    /// is picked to satisfy a pod's extended resource requests.
709    /// If two classes are created at the same time, then the name of the class
710    /// lexicographically sorted first is picked.
711    ///
712    /// This is an alpha field.
713    /// +optional
714    /// +featureGate=DRAExtendedResource
715    /// +k8s:optional
716    /// +k8s:format=k8s-extended-resource-name
717    #[prost(string, optional, tag = "4")]
718    pub extended_resource_name: ::core::option::Option<::prost::alloc::string::String>,
719}
720/// DeviceConfiguration must have exactly one field set. It gets embedded
721/// inline in some other structs which have other fields, so field names must
722/// not conflict with those.
723#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
724pub struct DeviceConfiguration {
725    /// Opaque provides driver-specific configuration parameters.
726    ///
727    /// +optional
728    /// +oneOf=ConfigurationType
729    /// +k8s:optional
730    #[prost(message, optional, tag = "1")]
731    pub opaque: ::core::option::Option<OpaqueDeviceConfiguration>,
732}
733/// DeviceConstraint must have exactly one field set besides Requests.
734#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
735pub struct DeviceConstraint {
736    /// Requests is a list of the one or more requests in this claim which
737    /// must co-satisfy this constraint. If a request is fulfilled by
738    /// multiple devices, then all of the devices must satisfy the
739    /// constraint. If this is not specified, this constraint applies to all
740    /// requests in this claim.
741    ///
742    /// References to subrequests must include the name of the main request
743    /// and may include the subrequest using the format <main request>\[/<subrequest>\]. If just
744    /// the main request is given, the constraint applies to all subrequests.
745    ///
746    /// +optional
747    /// +listType=atomic
748    /// +k8s:optional
749    /// +k8s:listType=atomic
750    /// +k8s:unique=set
751    /// +k8s:maxItems=32
752    #[prost(string, repeated, tag = "1")]
753    pub requests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
754    /// MatchAttribute requires that all devices in question have this
755    /// attribute and that its type and value are the same across those
756    /// devices.
757    ///
758    /// For example, if you specified "dra.example.com/numa" (a hypothetical example!),
759    /// then only devices in the same NUMA node will be chosen. A device which
760    /// does not have that attribute will not be chosen. All devices should
761    /// use a value of the same type for this attribute because that is part of
762    /// its specification, but if one device doesn't, then it also will not be
763    /// chosen.
764    ///
765    /// Must include the domain qualifier.
766    ///
767    /// +optional
768    /// +oneOf=ConstraintType
769    /// +k8s:optional
770    /// +k8s:format=k8s-resource-fully-qualified-name
771    #[prost(string, optional, tag = "2")]
772    pub match_attribute: ::core::option::Option<::prost::alloc::string::String>,
773    /// DistinctAttribute requires that all devices in question have this
774    /// attribute and that its type and value are unique across those devices.
775    ///
776    /// This acts as the inverse of MatchAttribute.
777    ///
778    /// This constraint is used to avoid allocating multiple requests to the same device
779    /// by ensuring attribute-level differentiation.
780    ///
781    /// This is useful for scenarios where resource requests must be fulfilled by separate physical devices.
782    /// For example, a container requests two network interfaces that must be allocated from two different physical NICs.
783    ///
784    /// +optional
785    /// +oneOf=ConstraintType
786    /// +featureGate=DRAConsumableCapacity
787    #[prost(string, optional, tag = "3")]
788    pub distinct_attribute: ::core::option::Option<::prost::alloc::string::String>,
789}
790/// DeviceCounterConsumption defines a set of counters that
791/// a device will consume from a CounterSet.
792#[derive(Clone, PartialEq, ::prost::Message)]
793pub struct DeviceCounterConsumption {
794    /// CounterSet is the name of the set from which the
795    /// counters defined will be consumed.
796    ///
797    /// +required
798    /// +k8s:required
799    /// +k8s:format=k8s-short-name
800    #[prost(string, optional, tag = "1")]
801    pub counter_set: ::core::option::Option<::prost::alloc::string::String>,
802    /// Counters defines the counters that will be consumed by the device.
803    ///
804    /// The maximum number of counters is 32.
805    ///
806    /// +required
807    #[prost(btree_map = "string, message", tag = "2")]
808    pub counters: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, Counter>,
809}
810/// DeviceRequest is a request for devices required for a claim.
811/// This is typically a request for a single resource like a device, but can
812/// also ask for several identical devices.
813#[derive(Clone, PartialEq, ::prost::Message)]
814pub struct DeviceRequest {
815    /// Name can be used to reference this request in a pod.spec.containers\[\].resources.claims
816    /// entry and in a constraint of the claim.
817    ///
818    /// Must be a DNS label and unique among all DeviceRequests in a
819    /// ResourceClaim.
820    ///
821    /// +required
822    #[prost(string, optional, tag = "1")]
823    pub name: ::core::option::Option<::prost::alloc::string::String>,
824    /// DeviceClassName references a specific DeviceClass, which can define
825    /// additional configuration and selectors to be inherited by this
826    /// request.
827    ///
828    /// A class is required if no subrequests are specified in the
829    /// firstAvailable list and no class can be set if subrequests
830    /// are specified in the firstAvailable list.
831    /// Which classes are available depends on the cluster.
832    ///
833    /// Administrators may use this to restrict which devices may get
834    /// requested by only installing classes with selectors for permitted
835    /// devices. If users are free to request anything without restrictions,
836    /// then administrators can create an empty DeviceClass for users
837    /// to reference.
838    ///
839    /// +optional
840    /// +oneOf=deviceRequestType
841    #[prost(string, optional, tag = "2")]
842    pub device_class_name: ::core::option::Option<::prost::alloc::string::String>,
843    /// Selectors define criteria which must be satisfied by a specific
844    /// device in order for that device to be considered for this
845    /// request. All selectors must be satisfied for a device to be
846    /// considered.
847    ///
848    /// This field can only be set when deviceClassName is set and no subrequests
849    /// are specified in the firstAvailable list.
850    ///
851    /// +optional
852    /// +listType=atomic
853    /// +k8s:optional
854    /// +k8s:maxItems=32
855    #[prost(message, repeated, tag = "3")]
856    pub selectors: ::prost::alloc::vec::Vec<DeviceSelector>,
857    /// AllocationMode and its related fields define how devices are allocated
858    /// to satisfy this request. Supported values are:
859    ///
860    /// - ExactCount: This request is for a specific number of devices.
861    ///    This is the default. The exact number is provided in the
862    ///    count field.
863    ///
864    /// - All: This request is for all of the matching devices in a pool.
865    ///    At least one device must exist on the node for the allocation to succeed.
866    ///    Allocation will fail if some devices are already allocated,
867    ///    unless adminAccess is requested.
868    ///
869    /// If AllocationMode is not specified, the default mode is ExactCount. If
870    /// the mode is ExactCount and count is not specified, the default count is
871    /// one. Any other requests must specify this field.
872    ///
873    /// This field can only be set when deviceClassName is set and no subrequests
874    /// are specified in the firstAvailable list.
875    ///
876    /// More modes may get added in the future. Clients must refuse to handle
877    /// requests with unknown modes.
878    ///
879    /// +optional
880    /// +k8s:optional
881    #[prost(string, optional, tag = "4")]
882    pub allocation_mode: ::core::option::Option<::prost::alloc::string::String>,
883    /// Count is used only when the count mode is "ExactCount". Must be greater than zero.
884    /// If AllocationMode is ExactCount and this field is not specified, the default is one.
885    ///
886    /// This field can only be set when deviceClassName is set and no subrequests
887    /// are specified in the firstAvailable list.
888    ///
889    /// +optional
890    /// +oneOf=AllocationMode
891    #[prost(int64, optional, tag = "5")]
892    pub count: ::core::option::Option<i64>,
893    /// AdminAccess indicates that this is a claim for administrative access
894    /// to the device(s). Claims with AdminAccess are expected to be used for
895    /// monitoring or other management services for a device.  They ignore
896    /// all ordinary claims to the device with respect to access modes and
897    /// any resource allocations.
898    ///
899    /// This field can only be set when deviceClassName is set and no subrequests
900    /// are specified in the firstAvailable list.
901    ///
902    /// This is an alpha field and requires enabling the DRAAdminAccess
903    /// feature gate. Admin access is disabled if this field is unset or
904    /// set to false, otherwise it is enabled.
905    ///
906    /// +optional
907    /// +featureGate=DRAAdminAccess
908    #[prost(bool, optional, tag = "6")]
909    pub admin_access: ::core::option::Option<bool>,
910    /// FirstAvailable contains subrequests, of which exactly one will be
911    /// satisfied by the scheduler to satisfy this request. It tries to
912    /// satisfy them in the order in which they are listed here. So if
913    /// there are two entries in the list, the scheduler will only check
914    /// the second one if it determines that the first one cannot be used.
915    ///
916    /// This field may only be set in the entries of DeviceClaim.Requests.
917    ///
918    /// DRA does not yet implement scoring, so the scheduler will
919    /// select the first set of devices that satisfies all the
920    /// requests in the claim. And if the requirements can
921    /// be satisfied on more than one node, other scheduling features
922    /// will determine which node is chosen. This means that the set of
923    /// devices allocated to a claim might not be the optimal set
924    /// available to the cluster. Scoring will be implemented later.
925    ///
926    /// +optional
927    /// +oneOf=deviceRequestType
928    /// +listType=atomic
929    /// +featureGate=DRAPrioritizedList
930    /// +k8s:optional
931    /// +k8s:listType=atomic
932    /// +k8s:unique=map
933    /// +k8s:listMapKey=name
934    /// +k8s:maxItems=8
935    #[prost(message, repeated, tag = "7")]
936    pub first_available: ::prost::alloc::vec::Vec<DeviceSubRequest>,
937    /// If specified, the request's tolerations.
938    ///
939    /// Tolerations for NoSchedule are required to allocate a
940    /// device which has a taint with that effect. The same applies
941    /// to NoExecute.
942    ///
943    /// In addition, should any of the allocated devices get tainted
944    /// with NoExecute after allocation and that effect is not tolerated,
945    /// then all pods consuming the ResourceClaim get deleted to evict
946    /// them. The scheduler will not let new pods reserve the claim while
947    /// it has these tainted devices. Once all pods are evicted, the
948    /// claim will get deallocated.
949    ///
950    /// The maximum number of tolerations is 16.
951    ///
952    /// This field can only be set when deviceClassName is set and no subrequests
953    /// are specified in the firstAvailable list.
954    ///
955    /// This is an alpha field and requires enabling the DRADeviceTaints
956    /// feature gate.
957    ///
958    /// +optional
959    /// +listType=atomic
960    /// +featureGate=DRADeviceTaints
961    #[prost(message, repeated, tag = "8")]
962    pub tolerations: ::prost::alloc::vec::Vec<DeviceToleration>,
963    /// Capacity define resource requirements against each capacity.
964    ///
965    /// If this field is unset and the device supports multiple allocations,
966    /// the default value will be applied to each capacity according to requestPolicy.
967    /// For the capacity that has no requestPolicy, default is the full capacity value.
968    ///
969    /// Applies to each device allocation.
970    /// If Count > 1,
971    /// the request fails if there aren't enough devices that meet the requirements.
972    /// If AllocationMode is set to All,
973    /// the request fails if there are devices that otherwise match the request,
974    /// and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.
975    ///
976    /// +optional
977    /// +featureGate=DRAConsumableCapacity
978    #[prost(message, optional, tag = "9")]
979    pub capacity: ::core::option::Option<CapacityRequirements>,
980}
981/// DeviceRequestAllocationResult contains the allocation result for one request.
982#[derive(Clone, PartialEq, ::prost::Message)]
983pub struct DeviceRequestAllocationResult {
984    /// Request is the name of the request in the claim which caused this
985    /// device to be allocated. If it references a subrequest in the
986    /// firstAvailable list on a DeviceRequest, this field must
987    /// include both the name of the main request and the subrequest
988    /// using the format <main request>/<subrequest>.
989    ///
990    /// Multiple devices may have been allocated per request.
991    ///
992    /// +required
993    #[prost(string, optional, tag = "1")]
994    pub request: ::core::option::Option<::prost::alloc::string::String>,
995    /// Driver specifies the name of the DRA driver whose kubelet
996    /// plugin should be invoked to process the allocation once the claim is
997    /// needed on a node.
998    ///
999    /// Must be a DNS subdomain and should end with a DNS domain owned by the
1000    /// vendor of the driver. It should use only lower case characters.
1001    ///
1002    /// +required
1003    /// +k8s:format=k8s-long-name-caseless
1004    /// +k8s:required
1005    #[prost(string, optional, tag = "2")]
1006    pub driver: ::core::option::Option<::prost::alloc::string::String>,
1007    /// This name together with the driver name and the device name field
1008    /// identify which device was allocated (`<driver name>/<pool name>/<device name>`).
1009    ///
1010    /// Must not be longer than 253 characters and may contain one or more
1011    /// DNS sub-domains separated by slashes.
1012    ///
1013    /// +required
1014    /// +k8s:required
1015    /// +k8s:format=k8s-resource-pool-name
1016    #[prost(string, optional, tag = "3")]
1017    pub pool: ::core::option::Option<::prost::alloc::string::String>,
1018    /// Device references one device instance via its name in the driver's
1019    /// resource pool. It must be a DNS label.
1020    ///
1021    /// +required
1022    #[prost(string, optional, tag = "4")]
1023    pub device: ::core::option::Option<::prost::alloc::string::String>,
1024    /// AdminAccess indicates that this device was allocated for
1025    /// administrative access. See the corresponding request field
1026    /// for a definition of mode.
1027    ///
1028    /// This is an alpha field and requires enabling the DRAAdminAccess
1029    /// feature gate. Admin access is disabled if this field is unset or
1030    /// set to false, otherwise it is enabled.
1031    ///
1032    /// +optional
1033    /// +featureGate=DRAAdminAccess
1034    #[prost(bool, optional, tag = "5")]
1035    pub admin_access: ::core::option::Option<bool>,
1036    /// A copy of all tolerations specified in the request at the time
1037    /// when the device got allocated.
1038    ///
1039    /// The maximum number of tolerations is 16.
1040    ///
1041    /// This is an alpha field and requires enabling the DRADeviceTaints
1042    /// feature gate.
1043    ///
1044    /// +optional
1045    /// +listType=atomic
1046    /// +featureGate=DRADeviceTaints
1047    /// +k8s:optional
1048    /// +k8s:maxItems=16
1049    #[prost(message, repeated, tag = "6")]
1050    pub tolerations: ::prost::alloc::vec::Vec<DeviceToleration>,
1051    /// BindingConditions contains a copy of the BindingConditions
1052    /// from the corresponding ResourceSlice at the time of allocation.
1053    ///
1054    /// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
1055    /// feature gates.
1056    ///
1057    /// +optional
1058    /// +listType=atomic
1059    /// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
1060    /// +k8s:optional
1061    /// +k8s:maxItems=4
1062    #[prost(string, repeated, tag = "7")]
1063    pub binding_conditions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1064    /// BindingFailureConditions contains a copy of the BindingFailureConditions
1065    /// from the corresponding ResourceSlice at the time of allocation.
1066    ///
1067    /// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
1068    /// feature gates.
1069    ///
1070    /// +optional
1071    /// +listType=atomic
1072    /// +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus
1073    /// +k8s:optional
1074    /// +k8s:maxItems=4
1075    #[prost(string, repeated, tag = "8")]
1076    pub binding_failure_conditions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1077    /// ShareID uniquely identifies an individual allocation share of the device,
1078    /// used when the device supports multiple simultaneous allocations.
1079    /// It serves as an additional map key to differentiate concurrent shares
1080    /// of the same device.
1081    ///
1082    /// +optional
1083    /// +featureGate=DRAConsumableCapacity
1084    /// +k8s:optional
1085    /// +k8s:format=k8s-uuid
1086    #[prost(string, optional, tag = "9")]
1087    pub share_id: ::core::option::Option<::prost::alloc::string::String>,
1088    /// ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request.
1089    /// The consumed amount may differ from the requested amount: it is rounded up to the nearest valid
1090    /// value based on the device’s requestPolicy if applicable (i.e., may not be less than the requested amount).
1091    ///
1092    /// The total consumed capacity for each device must not exceed the DeviceCapacity's Value.
1093    ///
1094    /// This field is populated only for devices that allow multiple allocations.
1095    /// All capacity entries are included, even if the consumed amount is zero.
1096    ///
1097    /// +optional
1098    /// +featureGate=DRAConsumableCapacity
1099    #[prost(btree_map = "string, message", tag = "10")]
1100    pub consumed_capacity: ::prost::alloc::collections::BTreeMap<
1101        ::prost::alloc::string::String,
1102        super::super::super::apimachinery::pkg::api::resource::Quantity,
1103    >,
1104}
1105/// DeviceSelector must have exactly one field set.
1106#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1107pub struct DeviceSelector {
1108    /// CEL contains a CEL expression for selecting a device.
1109    ///
1110    /// +optional
1111    /// +oneOf=SelectorType
1112    #[prost(message, optional, tag = "1")]
1113    pub cel: ::core::option::Option<CelDeviceSelector>,
1114}
1115/// DeviceSubRequest describes a request for device provided in the
1116/// claim.spec.devices.requests\[\].firstAvailable array. Each
1117/// is typically a request for a single resource like a device, but can
1118/// also ask for several identical devices.
1119///
1120/// DeviceSubRequest is similar to Request, but doesn't expose the AdminAccess
1121/// or FirstAvailable fields, as those can only be set on the top-level request.
1122/// AdminAccess is not supported for requests with a prioritized list, and
1123/// recursive FirstAvailable fields are not supported.
1124#[derive(Clone, PartialEq, ::prost::Message)]
1125pub struct DeviceSubRequest {
1126    /// Name can be used to reference this subrequest in the list of constraints
1127    /// or the list of configurations for the claim. References must use the
1128    /// format <main request>/<subrequest>.
1129    ///
1130    /// Must be a DNS label.
1131    ///
1132    /// +required
1133    #[prost(string, optional, tag = "1")]
1134    pub name: ::core::option::Option<::prost::alloc::string::String>,
1135    /// DeviceClassName references a specific DeviceClass, which can define
1136    /// additional configuration and selectors to be inherited by this
1137    /// subrequest.
1138    ///
1139    /// A class is required. Which classes are available depends on the cluster.
1140    ///
1141    /// Administrators may use this to restrict which devices may get
1142    /// requested by only installing classes with selectors for permitted
1143    /// devices. If users are free to request anything without restrictions,
1144    /// then administrators can create an empty DeviceClass for users
1145    /// to reference.
1146    ///
1147    /// +required
1148    /// +k8s:required
1149    /// +k8s:format=k8s-long-name
1150    #[prost(string, optional, tag = "2")]
1151    pub device_class_name: ::core::option::Option<::prost::alloc::string::String>,
1152    /// Selectors define criteria which must be satisfied by a specific
1153    /// device in order for that device to be considered for this
1154    /// subrequest. All selectors must be satisfied for a device to be
1155    /// considered.
1156    ///
1157    /// +optional
1158    /// +listType=atomic
1159    /// +k8s:maxItems=32
1160    #[prost(message, repeated, tag = "3")]
1161    pub selectors: ::prost::alloc::vec::Vec<DeviceSelector>,
1162    /// AllocationMode and its related fields define how devices are allocated
1163    /// to satisfy this subrequest. Supported values are:
1164    ///
1165    /// - ExactCount: This request is for a specific number of devices.
1166    ///    This is the default. The exact number is provided in the
1167    ///    count field.
1168    ///
1169    /// - All: This subrequest is for all of the matching devices in a pool.
1170    ///    Allocation will fail if some devices are already allocated,
1171    ///    unless adminAccess is requested.
1172    ///
1173    /// If AllocationMode is not specified, the default mode is ExactCount. If
1174    /// the mode is ExactCount and count is not specified, the default count is
1175    /// one. Any other subrequests must specify this field.
1176    ///
1177    /// More modes may get added in the future. Clients must refuse to handle
1178    /// requests with unknown modes.
1179    ///
1180    /// +optional
1181    #[prost(string, optional, tag = "4")]
1182    pub allocation_mode: ::core::option::Option<::prost::alloc::string::String>,
1183    /// Count is used only when the count mode is "ExactCount". Must be greater than zero.
1184    /// If AllocationMode is ExactCount and this field is not specified, the default is one.
1185    ///
1186    /// +optional
1187    /// +oneOf=AllocationMode
1188    #[prost(int64, optional, tag = "5")]
1189    pub count: ::core::option::Option<i64>,
1190    /// If specified, the request's tolerations.
1191    ///
1192    /// Tolerations for NoSchedule are required to allocate a
1193    /// device which has a taint with that effect. The same applies
1194    /// to NoExecute.
1195    ///
1196    /// In addition, should any of the allocated devices get tainted
1197    /// with NoExecute after allocation and that effect is not tolerated,
1198    /// then all pods consuming the ResourceClaim get deleted to evict
1199    /// them. The scheduler will not let new pods reserve the claim while
1200    /// it has these tainted devices. Once all pods are evicted, the
1201    /// claim will get deallocated.
1202    ///
1203    /// The maximum number of tolerations is 16.
1204    ///
1205    /// This is an alpha field and requires enabling the DRADeviceTaints
1206    /// feature gate.
1207    ///
1208    /// +optional
1209    /// +listType=atomic
1210    /// +featureGate=DRADeviceTaints
1211    #[prost(message, repeated, tag = "7")]
1212    pub tolerations: ::prost::alloc::vec::Vec<DeviceToleration>,
1213    /// Capacity define resource requirements against each capacity.
1214    ///
1215    /// If this field is unset and the device supports multiple allocations,
1216    /// the default value will be applied to each capacity according to requestPolicy.
1217    /// For the capacity that has no requestPolicy, default is the full capacity value.
1218    ///
1219    /// Applies to each device allocation.
1220    /// If Count > 1,
1221    /// the request fails if there aren't enough devices that meet the requirements.
1222    /// If AllocationMode is set to All,
1223    /// the request fails if there are devices that otherwise match the request,
1224    /// and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.
1225    ///
1226    /// +optional
1227    /// +featureGate=DRAConsumableCapacity
1228    #[prost(message, optional, tag = "8")]
1229    pub capacity: ::core::option::Option<CapacityRequirements>,
1230}
1231/// The device this taint is attached to has the "effect" on
1232/// any claim which does not tolerate the taint and, through the claim,
1233/// to pods using the claim.
1234///
1235/// +protobuf.options.(gogoproto.goproto_stringer)=false
1236#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1237pub struct DeviceTaint {
1238    /// The taint key to be applied to a device.
1239    /// Must be a label name.
1240    ///
1241    /// +required
1242    #[prost(string, optional, tag = "1")]
1243    pub key: ::core::option::Option<::prost::alloc::string::String>,
1244    /// The taint value corresponding to the taint key.
1245    /// Must be a label value.
1246    ///
1247    /// +optional
1248    #[prost(string, optional, tag = "2")]
1249    pub value: ::core::option::Option<::prost::alloc::string::String>,
1250    /// The effect of the taint on claims that do not tolerate the taint
1251    /// and through such claims on the pods using them.
1252    ///
1253    /// Valid effects are None, NoSchedule and NoExecute. PreferNoSchedule as used for
1254    /// nodes is not valid here. More effects may get added in the future.
1255    /// Consumers must treat unknown effects like None.
1256    ///
1257    /// +required
1258    /// +k8s:required
1259    #[prost(string, optional, tag = "3")]
1260    pub effect: ::core::option::Option<::prost::alloc::string::String>,
1261    /// TimeAdded represents the time at which the taint was added.
1262    /// Added automatically during create or update if not set.
1263    ///
1264    /// +optional
1265    #[prost(message, optional, tag = "4")]
1266    pub time_added: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
1267}
1268/// The ResourceClaim this DeviceToleration is attached to tolerates any taint that matches
1269/// the triple <key,value,effect> using the matching operator <operator>.
1270#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1271pub struct DeviceToleration {
1272    /// Key is the taint key that the toleration applies to. Empty means match all taint keys.
1273    /// If the key is empty, operator must be Exists; this combination means to match all values and all keys.
1274    /// Must be a label name.
1275    ///
1276    /// +optional
1277    /// +k8s:optional
1278    /// +k8s:format=k8s-label-key
1279    #[prost(string, optional, tag = "1")]
1280    pub key: ::core::option::Option<::prost::alloc::string::String>,
1281    /// Operator represents a key's relationship to the value.
1282    /// Valid operators are Exists and Equal. Defaults to Equal.
1283    /// Exists is equivalent to wildcard for value, so that a ResourceClaim can
1284    /// tolerate all taints of a particular category.
1285    ///
1286    /// +optional
1287    /// +default="Equal"
1288    #[prost(string, optional, tag = "2")]
1289    pub operator: ::core::option::Option<::prost::alloc::string::String>,
1290    /// Value is the taint value the toleration matches to.
1291    /// If the operator is Exists, the value must be empty, otherwise just a regular string.
1292    /// Must be a label value.
1293    ///
1294    /// +optional
1295    #[prost(string, optional, tag = "3")]
1296    pub value: ::core::option::Option<::prost::alloc::string::String>,
1297    /// Effect indicates the taint effect to match. Empty means match all taint effects.
1298    /// When specified, allowed values are NoSchedule and NoExecute.
1299    ///
1300    /// +optional
1301    #[prost(string, optional, tag = "4")]
1302    pub effect: ::core::option::Option<::prost::alloc::string::String>,
1303    /// TolerationSeconds represents the period of time the toleration (which must be
1304    /// of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
1305    /// it is not set, which means tolerate the taint forever (do not evict). Zero and
1306    /// negative values will be treated as 0 (evict immediately) by the system.
1307    /// If larger than zero, the time when the pod needs to be evicted is calculated as <time when
1308    /// taint was adedd> + <toleration seconds>.
1309    ///
1310    /// +optional
1311    #[prost(int64, optional, tag = "5")]
1312    pub toleration_seconds: ::core::option::Option<i64>,
1313}
1314/// NetworkDeviceData provides network-related details for the allocated device.
1315/// This information may be filled by drivers or other components to configure
1316/// or identify the device within a network context.
1317#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1318pub struct NetworkDeviceData {
1319    /// InterfaceName specifies the name of the network interface associated with
1320    /// the allocated device. This might be the name of a physical or virtual
1321    /// network interface being configured in the pod.
1322    ///
1323    /// Must not be longer than 256 characters.
1324    ///
1325    /// +optional
1326    /// +k8s:optional
1327    /// +k8s:maxLength=256
1328    #[prost(string, optional, tag = "1")]
1329    pub interface_name: ::core::option::Option<::prost::alloc::string::String>,
1330    /// IPs lists the network addresses assigned to the device's network interface.
1331    /// This can include both IPv4 and IPv6 addresses.
1332    /// The IPs are in the CIDR notation, which includes both the address and the
1333    /// associated subnet mask.
1334    /// e.g.: "192.0.2.5/24" for IPv4 and "2001:db8::5/64" for IPv6.
1335    ///
1336    /// Must not contain more than 16 entries.
1337    ///
1338    /// +optional
1339    /// +listType=atomic
1340    /// +k8s:optional
1341    /// +k8s:listType=atomic
1342    /// +k8s:unique=set
1343    /// +k8s:maxItems=16
1344    #[prost(string, repeated, tag = "2")]
1345    pub ips: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1346    /// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
1347    ///
1348    /// Must not be longer than 128 characters.
1349    ///
1350    /// +optional
1351    /// +k8s:optional
1352    /// +k8s:maxLength=128
1353    #[prost(string, optional, tag = "3")]
1354    pub hardware_address: ::core::option::Option<::prost::alloc::string::String>,
1355}
1356/// OpaqueDeviceConfiguration contains configuration parameters for a driver
1357/// in a format defined by the driver vendor.
1358#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1359pub struct OpaqueDeviceConfiguration {
1360    /// Driver is used to determine which kubelet plugin needs
1361    /// to be passed these configuration parameters.
1362    ///
1363    /// An admission policy provided by the driver developer could use this
1364    /// to decide whether it needs to validate them.
1365    ///
1366    /// Must be a DNS subdomain and should end with a DNS domain owned by the
1367    /// vendor of the driver. It should use only lower case characters.
1368    ///
1369    /// +required
1370    /// +k8s:required
1371    /// +k8s:format=k8s-long-name-caseless
1372    #[prost(string, optional, tag = "1")]
1373    pub driver: ::core::option::Option<::prost::alloc::string::String>,
1374    /// Parameters can contain arbitrary data. It is the responsibility of
1375    /// the driver developer to handle validation and versioning. Typically this
1376    /// includes self-identification and a version ("kind" + "apiVersion" for
1377    /// Kubernetes types), with conversion between different versions.
1378    ///
1379    /// The length of the raw data must be smaller or equal to 10 Ki.
1380    ///
1381    /// +required
1382    #[prost(message, optional, tag = "2")]
1383    pub parameters: ::core::option::Option<super::super::super::apimachinery::pkg::runtime::RawExtension>,
1384}
1385/// ResourceClaim describes a request for access to resources in the cluster,
1386/// for use by workloads. For example, if a workload needs an accelerator device
1387/// with specific properties, this is how that request is expressed. The status
1388/// stanza tracks whether this claim has been satisfied and what specific
1389/// resources have been allocated.
1390///
1391/// This is an alpha type and requires enabling the DynamicResourceAllocation
1392/// feature gate.
1393#[derive(Clone, PartialEq, ::prost::Message)]
1394pub struct ResourceClaim {
1395    /// Standard object metadata
1396    /// +optional
1397    #[prost(message, optional, tag = "1")]
1398    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
1399    /// Spec describes what is being requested and how to configure it.
1400    /// The spec is immutable.
1401    /// +k8s:immutable
1402    #[prost(message, optional, tag = "2")]
1403    pub spec: ::core::option::Option<ResourceClaimSpec>,
1404    /// Status describes whether the claim is ready to use and what has been allocated.
1405    /// +optional
1406    #[prost(message, optional, tag = "3")]
1407    pub status: ::core::option::Option<ResourceClaimStatus>,
1408}
1409/// ResourceClaimConsumerReference contains enough information to let you
1410/// locate the consumer of a ResourceClaim. The user must be a resource in the same
1411/// namespace as the ResourceClaim.
1412#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1413pub struct ResourceClaimConsumerReference {
1414    /// APIGroup is the group for the resource being referenced. It is
1415    /// empty for the core API. This matches the group in the APIVersion
1416    /// that is used when creating the resources.
1417    /// +optional
1418    #[prost(string, optional, tag = "1")]
1419    pub api_group: ::core::option::Option<::prost::alloc::string::String>,
1420    /// Resource is the type of resource being referenced, for example "pods".
1421    /// +required
1422    #[prost(string, optional, tag = "3")]
1423    pub resource: ::core::option::Option<::prost::alloc::string::String>,
1424    /// Name is the name of resource being referenced.
1425    /// +required
1426    #[prost(string, optional, tag = "4")]
1427    pub name: ::core::option::Option<::prost::alloc::string::String>,
1428    /// UID identifies exactly one incarnation of the resource.
1429    /// +required
1430    #[prost(string, optional, tag = "5")]
1431    pub uid: ::core::option::Option<::prost::alloc::string::String>,
1432}
1433/// ResourceClaimList is a collection of claims.
1434#[derive(Clone, PartialEq, ::prost::Message)]
1435pub struct ResourceClaimList {
1436    /// Standard list metadata
1437    /// +optional
1438    #[prost(message, optional, tag = "1")]
1439    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
1440    /// Items is the list of resource claims.
1441    #[prost(message, repeated, tag = "2")]
1442    pub items: ::prost::alloc::vec::Vec<ResourceClaim>,
1443}
1444/// ResourceClaimSpec defines what is being requested in a ResourceClaim and how to configure it.
1445#[derive(Clone, PartialEq, ::prost::Message)]
1446pub struct ResourceClaimSpec {
1447    /// Devices defines how to request devices.
1448    ///
1449    /// +optional
1450    #[prost(message, optional, tag = "1")]
1451    pub devices: ::core::option::Option<DeviceClaim>,
1452}
1453/// ResourceClaimStatus tracks whether the resource has been allocated and what
1454/// the result of that was.
1455#[derive(Clone, PartialEq, ::prost::Message)]
1456pub struct ResourceClaimStatus {
1457    /// Allocation is set once the claim has been allocated successfully.
1458    ///
1459    /// +optional
1460    /// +k8s:optional
1461    /// +k8s:update=NoModify
1462    #[prost(message, optional, tag = "1")]
1463    pub allocation: ::core::option::Option<AllocationResult>,
1464    /// ReservedFor indicates which entities are currently allowed to use
1465    /// the claim. A Pod which references a ResourceClaim which is not
1466    /// reserved for that Pod will not be started. A claim that is in
1467    /// use or might be in use because it has been reserved must not get
1468    /// deallocated.
1469    ///
1470    /// In a cluster with multiple scheduler instances, two pods might get
1471    /// scheduled concurrently by different schedulers. When they reference
1472    /// the same ResourceClaim which already has reached its maximum number
1473    /// of consumers, only one pod can be scheduled.
1474    ///
1475    /// Both schedulers try to add their pod to the claim.status.reservedFor
1476    /// field, but only the update that reaches the API server first gets
1477    /// stored. The other one fails with an error and the scheduler
1478    /// which issued it knows that it must put the pod back into the queue,
1479    /// waiting for the ResourceClaim to become usable again.
1480    ///
1481    /// There can be at most 256 such reservations. This may get increased in
1482    /// the future, but not reduced.
1483    ///
1484    /// +optional
1485    /// +listType=map
1486    /// +listMapKey=uid
1487    /// +patchStrategy=merge
1488    /// +patchMergeKey=uid
1489    /// +k8s:optional
1490    /// +k8s:listType=map
1491    /// +k8s:listMapKey=uid
1492    /// +k8s:maxItems=256
1493    #[prost(message, repeated, tag = "2")]
1494    pub reserved_for: ::prost::alloc::vec::Vec<ResourceClaimConsumerReference>,
1495    /// Devices contains the status of each device allocated for this
1496    /// claim, as reported by the driver. This can include driver-specific
1497    /// information. Entries are owned by their respective drivers.
1498    ///
1499    /// +optional
1500    /// +k8s:optional
1501    /// +listType=map
1502    /// +listMapKey=driver
1503    /// +listMapKey=device
1504    /// +listMapKey=pool
1505    /// +listMapKey=shareID
1506    /// +featureGate=DRAResourceClaimDeviceStatus
1507    /// +k8s:listType=map
1508    /// +k8s:listMapKey=driver
1509    /// +k8s:listMapKey=device
1510    /// +k8s:listMapKey=pool
1511    /// +k8s:listMapKey=shareID
1512    #[prost(message, repeated, tag = "4")]
1513    pub devices: ::prost::alloc::vec::Vec<AllocatedDeviceStatus>,
1514}
1515/// ResourceClaimTemplate is used to produce ResourceClaim objects.
1516///
1517/// This is an alpha type and requires enabling the DynamicResourceAllocation
1518/// feature gate.
1519#[derive(Clone, PartialEq, ::prost::Message)]
1520pub struct ResourceClaimTemplate {
1521    /// Standard object metadata
1522    /// +optional
1523    #[prost(message, optional, tag = "1")]
1524    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
1525    /// Describes the ResourceClaim that is to be generated.
1526    ///
1527    /// This field is immutable. A ResourceClaim will get created by the
1528    /// control plane for a Pod when needed and then not get updated
1529    /// anymore.
1530    #[prost(message, optional, tag = "2")]
1531    pub spec: ::core::option::Option<ResourceClaimTemplateSpec>,
1532}
1533/// ResourceClaimTemplateList is a collection of claim templates.
1534#[derive(Clone, PartialEq, ::prost::Message)]
1535pub struct ResourceClaimTemplateList {
1536    /// Standard list metadata
1537    /// +optional
1538    #[prost(message, optional, tag = "1")]
1539    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
1540    /// Items is the list of resource claim templates.
1541    #[prost(message, repeated, tag = "2")]
1542    pub items: ::prost::alloc::vec::Vec<ResourceClaimTemplate>,
1543}
1544/// ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.
1545#[derive(Clone, PartialEq, ::prost::Message)]
1546pub struct ResourceClaimTemplateSpec {
1547    /// ObjectMeta may contain labels and annotations that will be copied into the ResourceClaim
1548    /// when creating it. No other fields are allowed and will be rejected during
1549    /// validation.
1550    /// +optional
1551    #[prost(message, optional, tag = "1")]
1552    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
1553    /// Spec for the ResourceClaim. The entire content is copied unchanged
1554    /// into the ResourceClaim that gets created from this template. The
1555    /// same fields as in a ResourceClaim are also valid here.
1556    #[prost(message, optional, tag = "2")]
1557    pub spec: ::core::option::Option<ResourceClaimSpec>,
1558}
1559/// ResourcePool describes the pool that ResourceSlices belong to.
1560#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1561pub struct ResourcePool {
1562    /// Name is used to identify the pool. For node-local devices, this
1563    /// is often the node name, but this is not required.
1564    ///
1565    /// It must not be longer than 253 characters and must consist of one or more DNS sub-domains
1566    /// separated by slashes. This field is immutable.
1567    ///
1568    /// +required
1569    #[prost(string, optional, tag = "1")]
1570    pub name: ::core::option::Option<::prost::alloc::string::String>,
1571    /// Generation tracks the change in a pool over time. Whenever a driver
1572    /// changes something about one or more of the resources in a pool, it
1573    /// must change the generation in all ResourceSlices which are part of
1574    /// that pool. Consumers of ResourceSlices should only consider
1575    /// resources from the pool with the highest generation number. The
1576    /// generation may be reset by drivers, which should be fine for
1577    /// consumers, assuming that all ResourceSlices in a pool are updated to
1578    /// match or deleted.
1579    ///
1580    /// Combined with ResourceSliceCount, this mechanism enables consumers to
1581    /// detect pools which are comprised of multiple ResourceSlices and are
1582    /// in an incomplete state.
1583    ///
1584    /// +required
1585    #[prost(int64, optional, tag = "2")]
1586    pub generation: ::core::option::Option<i64>,
1587    /// ResourceSliceCount is the total number of ResourceSlices in the pool at this
1588    /// generation number. Must be greater than zero.
1589    ///
1590    /// Consumers can use this to check whether they have seen all ResourceSlices
1591    /// belonging to the same pool.
1592    ///
1593    /// +required
1594    #[prost(int64, optional, tag = "3")]
1595    pub resource_slice_count: ::core::option::Option<i64>,
1596}
1597/// ResourceSlice represents one or more resources in a pool of similar resources,
1598/// managed by a common driver. A pool may span more than one ResourceSlice, and exactly how many
1599/// ResourceSlices comprise a pool is determined by the driver.
1600///
1601/// At the moment, the only supported resources are devices with attributes and capacities.
1602/// Each device in a given pool, regardless of how many ResourceSlices, must have a unique name.
1603/// The ResourceSlice in which a device gets published may change over time. The unique identifier
1604/// for a device is the tuple <driver name>, <pool name>, <device name>.
1605///
1606/// Whenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number
1607/// and updates all ResourceSlices with that new number and new resource definitions. A consumer
1608/// must only use ResourceSlices with the highest generation number and ignore all others.
1609///
1610/// When allocating all resources in a pool matching certain criteria or when
1611/// looking for the best solution among several different alternatives, a
1612/// consumer should check the number of ResourceSlices in a pool (included in
1613/// each ResourceSlice) to determine whether its view of a pool is complete and
1614/// if not, should wait until the driver has completed updating the pool.
1615///
1616/// For resources that are not local to a node, the node name is not set. Instead,
1617/// the driver may use a node selector to specify where the devices are available.
1618///
1619/// This is an alpha type and requires enabling the DynamicResourceAllocation
1620/// feature gate.
1621#[derive(Clone, PartialEq, ::prost::Message)]
1622pub struct ResourceSlice {
1623    /// Standard object metadata
1624    /// +optional
1625    #[prost(message, optional, tag = "1")]
1626    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
1627    /// Contains the information published by the driver.
1628    ///
1629    /// Changing the spec automatically increments the metadata.generation number.
1630    #[prost(message, optional, tag = "2")]
1631    pub spec: ::core::option::Option<ResourceSliceSpec>,
1632}
1633/// ResourceSliceList is a collection of ResourceSlices.
1634#[derive(Clone, PartialEq, ::prost::Message)]
1635pub struct ResourceSliceList {
1636    /// Standard list metadata
1637    /// +optional
1638    #[prost(message, optional, tag = "1")]
1639    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
1640    /// Items is the list of resource ResourceSlices.
1641    #[prost(message, repeated, tag = "2")]
1642    pub items: ::prost::alloc::vec::Vec<ResourceSlice>,
1643}
1644/// ResourceSliceSpec contains the information published by the driver in one ResourceSlice.
1645#[derive(Clone, PartialEq, ::prost::Message)]
1646pub struct ResourceSliceSpec {
1647    /// Driver identifies the DRA driver providing the capacity information.
1648    /// A field selector can be used to list only ResourceSlice
1649    /// objects with a certain driver name.
1650    ///
1651    /// Must be a DNS subdomain and should end with a DNS domain owned by the
1652    /// vendor of the driver. It should use only lower case characters.
1653    /// This field is immutable.
1654    ///
1655    /// +required
1656    #[prost(string, optional, tag = "1")]
1657    pub driver: ::core::option::Option<::prost::alloc::string::String>,
1658    /// Pool describes the pool that this ResourceSlice belongs to.
1659    ///
1660    /// +required
1661    #[prost(message, optional, tag = "2")]
1662    pub pool: ::core::option::Option<ResourcePool>,
1663    /// NodeName identifies the node which provides the resources in this pool.
1664    /// A field selector can be used to list only ResourceSlice
1665    /// objects belonging to a certain node.
1666    ///
1667    /// This field can be used to limit access from nodes to ResourceSlices with
1668    /// the same node name. It also indicates to autoscalers that adding
1669    /// new nodes of the same type as some old node might also make new
1670    /// resources available.
1671    ///
1672    /// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
1673    /// This field is immutable.
1674    ///
1675    /// +optional
1676    /// +oneOf=NodeSelection
1677    #[prost(string, optional, tag = "3")]
1678    pub node_name: ::core::option::Option<::prost::alloc::string::String>,
1679    /// NodeSelector defines which nodes have access to the resources in the pool,
1680    /// when that pool is not limited to a single node.
1681    ///
1682    /// Must use exactly one term.
1683    ///
1684    /// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
1685    ///
1686    /// +optional
1687    /// +oneOf=NodeSelection
1688    #[prost(message, optional, tag = "4")]
1689    pub node_selector: ::core::option::Option<super::super::core::v1::NodeSelector>,
1690    /// AllNodes indicates that all nodes have access to the resources in the pool.
1691    ///
1692    /// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
1693    ///
1694    /// +optional
1695    /// +oneOf=NodeSelection
1696    #[prost(bool, optional, tag = "5")]
1697    pub all_nodes: ::core::option::Option<bool>,
1698    /// Devices lists some or all of the devices in this pool.
1699    ///
1700    /// Must not have more than 128 entries. If any device uses taints or consumes counters the limit is 64.
1701    ///
1702    /// Only one of Devices and SharedCounters can be set in a ResourceSlice.
1703    ///
1704    /// +optional
1705    /// +listType=atomic
1706    /// +k8s:optional
1707    /// +zeroOrOneOf=ResourceSliceType
1708    #[prost(message, repeated, tag = "6")]
1709    pub devices: ::prost::alloc::vec::Vec<Device>,
1710    /// PerDeviceNodeSelection defines whether the access from nodes to
1711    /// resources in the pool is set on the ResourceSlice level or on each
1712    /// device. If it is set to true, every device defined the ResourceSlice
1713    /// must specify this individually.
1714    ///
1715    /// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
1716    ///
1717    /// +optional
1718    /// +oneOf=NodeSelection
1719    /// +featureGate=DRAPartitionableDevices
1720    #[prost(bool, optional, tag = "7")]
1721    pub per_device_node_selection: ::core::option::Option<bool>,
1722    /// SharedCounters defines a list of counter sets, each of which
1723    /// has a name and a list of counters available.
1724    ///
1725    /// The names of the counter sets must be unique in the ResourcePool.
1726    ///
1727    /// Only one of Devices and SharedCounters can be set in a ResourceSlice.
1728    ///
1729    /// The maximum number of counter sets is 8.
1730    ///
1731    /// +optional
1732    /// +k8s:optional
1733    /// +listType=atomic
1734    /// +k8s:listType=atomic
1735    /// +k8s:unique=map
1736    /// +k8s:listMapKey=name
1737    /// +featureGate=DRAPartitionableDevices
1738    /// +zeroOrOneOf=ResourceSliceType
1739    /// +k8s:maxItems=8
1740    #[prost(message, repeated, tag = "8")]
1741    pub shared_counters: ::prost::alloc::vec::Vec<CounterSet>,
1742}
1743
1744impl crate::Resource for DeviceClass {
1745    const API_VERSION: &'static str = "resource.k8s.io/v1beta1";
1746    const GROUP: &'static str = "resource.k8s.io";
1747    const VERSION: &'static str = "v1beta1";
1748    const KIND: &'static str = "DeviceClass";
1749    const URL_PATH_SEGMENT: &'static str = "deviceclasses";
1750    type Scope = crate::ClusterResourceScope;
1751}
1752impl crate::Metadata for DeviceClass {
1753    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
1754    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
1755        self.metadata.as_ref()
1756    }
1757    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
1758        self.metadata.as_mut()
1759    }
1760}
1761impl crate::HasSpec for DeviceClass {
1762    type Spec = crate::api::resource::v1beta1::DeviceClassSpec;
1763    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
1764        self.spec.as_ref()
1765    }
1766    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
1767        self.spec.as_mut()
1768    }
1769}
1770
1771impl crate::Resource for ResourceClaim {
1772    const API_VERSION: &'static str = "resource.k8s.io/v1beta1";
1773    const GROUP: &'static str = "resource.k8s.io";
1774    const VERSION: &'static str = "v1beta1";
1775    const KIND: &'static str = "ResourceClaim";
1776    const URL_PATH_SEGMENT: &'static str = "resourceclaims";
1777    type Scope = crate::NamespaceResourceScope;
1778}
1779impl crate::Metadata for ResourceClaim {
1780    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
1781    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
1782        self.metadata.as_ref()
1783    }
1784    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
1785        self.metadata.as_mut()
1786    }
1787}
1788impl crate::HasSpec for ResourceClaim {
1789    type Spec = crate::api::resource::v1beta1::ResourceClaimSpec;
1790    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
1791        self.spec.as_ref()
1792    }
1793    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
1794        self.spec.as_mut()
1795    }
1796}
1797impl crate::HasStatus for ResourceClaim {
1798    type Status = crate::api::resource::v1beta1::ResourceClaimStatus;
1799    fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
1800        self.status.as_ref()
1801    }
1802    fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
1803        self.status.as_mut()
1804    }
1805}
1806
1807impl crate::Resource for ResourceClaimTemplate {
1808    const API_VERSION: &'static str = "resource.k8s.io/v1beta1";
1809    const GROUP: &'static str = "resource.k8s.io";
1810    const VERSION: &'static str = "v1beta1";
1811    const KIND: &'static str = "ResourceClaimTemplate";
1812    const URL_PATH_SEGMENT: &'static str = "resourceclaimtemplates";
1813    type Scope = crate::NamespaceResourceScope;
1814}
1815impl crate::Metadata for ResourceClaimTemplate {
1816    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
1817    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
1818        self.metadata.as_ref()
1819    }
1820    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
1821        self.metadata.as_mut()
1822    }
1823}
1824impl crate::HasSpec for ResourceClaimTemplate {
1825    type Spec = crate::api::resource::v1beta1::ResourceClaimTemplateSpec;
1826    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
1827        self.spec.as_ref()
1828    }
1829    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
1830        self.spec.as_mut()
1831    }
1832}
1833
1834impl crate::Resource for ResourceSlice {
1835    const API_VERSION: &'static str = "resource.k8s.io/v1beta1";
1836    const GROUP: &'static str = "resource.k8s.io";
1837    const VERSION: &'static str = "v1beta1";
1838    const KIND: &'static str = "ResourceSlice";
1839    const URL_PATH_SEGMENT: &'static str = "resourceslices";
1840    type Scope = crate::ClusterResourceScope;
1841}
1842impl crate::Metadata for ResourceSlice {
1843    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
1844    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
1845        self.metadata.as_ref()
1846    }
1847    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
1848        self.metadata.as_mut()
1849    }
1850}
1851impl crate::HasSpec for ResourceSlice {
1852    type Spec = crate::api::resource::v1beta1::ResourceSliceSpec;
1853    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
1854        self.spec.as_ref()
1855    }
1856    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
1857        self.spec.as_mut()
1858    }
1859}