@@ -248,19 +248,24 @@ type BasicDevice struct {
248
248
249
249
// If specified, the device's taints.
250
250
//
251
+ // The maximum number of taints is 8.
252
+ //
251
253
// This is an alpha field and requires enabling the DRADeviceTaints
252
254
// feature gate.
253
255
//
254
256
// +optional
255
257
// +listType=atomic
256
258
// +featureGate=DRADeviceTaints
257
- Taints []Taint
259
+ Taints []DeviceTaint
258
260
}
259
261
260
- // The device this Taint is attached to has the "effect" on
262
+ // DeviceTaintsMaxLength is the maximum number of taints per device.
263
+ const DeviceTaintsMaxLength = 8
264
+
265
+ // The device this DeviceTaint is attached to has the "effect" on
261
266
// any claim and, through the claim, to pods that do not tolerate
262
267
// the Taint.
263
- type Taint struct {
268
+ type DeviceTaint struct {
264
269
// The taint key to be applied to a device.
265
270
// Must be a label name.
266
271
//
@@ -279,7 +284,7 @@ type Taint struct {
279
284
// nodes is not valid here.
280
285
//
281
286
// +required
282
- Effect TaintEffect
287
+ Effect DeviceTaintEffect
283
288
284
289
// ^^^^
285
290
//
@@ -316,14 +321,23 @@ type DeviceRequest struct {
316
321
// it has these tainted devices. Once all pods are evicted, the
317
322
// claim will get deallocated.
318
323
//
324
+ // The maximum number of tolerations is 16.
325
+ //
326
+ // This is an alpha field and requires enabling the DRADeviceTaints
327
+ // feature gate.
328
+ //
319
329
// +optional
320
330
// +listType=atomic
321
- Tolerations []Toleration
331
+ // +featureGate=DRADeviceTaints
332
+ Tolerations []DeviceToleration
322
333
}
323
334
335
+ // DeviceTolerationsMaxLength is the maximum number of tolerations in a DeviceRequest.
336
+ const DeviceTolerationsMaxLength = 16
337
+
324
338
// The ResourceClaim this Toleration is attached to tolerate any taint that matches
325
339
// the triple <key,value,effect> using the matching operator <operator>.
326
- type Toleration struct {
340
+ type DeviceToleration struct {
327
341
// Key is the taint key that the toleration applies to. Empty means match all taint keys.
328
342
// If the key is empty, operator must be Exists; this combination means to match all values and all keys.
329
343
// Must be a label name.
@@ -350,7 +364,7 @@ type Toleration struct {
350
364
// When specified, allowed values are NoSchedule and NoExecute.
351
365
//
352
366
// +optional
353
- Effect TaintEffect
367
+ Effect DeviceTaintEffect
354
368
355
369
// TolerationSeconds represents the period of time the toleration (which must be
356
370
// of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
@@ -364,11 +378,11 @@ type Toleration struct {
364
378
// A toleration operator is the set of operators that can be used in a toleration.
365
379
//
366
380
// +enum
367
- type TolerationOperator string
381
+ type DeviceTolerationOperator string
368
382
369
383
const (
370
- TolerationOpExists TolerationOperator = " Exists"
371
- TolerationOpEqual TolerationOperator = " Equal"
384
+ DeviceTolerationOpExists DeviceTolerationOperator = " Exists"
385
+ DeviceTolerationOpEqual DeviceTolerationOperator = " Equal"
372
386
)
373
387
```
374
388
@@ -395,13 +409,15 @@ type DevicePatch struct {
395
409
// are used in multiple places, the same precedence rules as for attributes apply
396
410
// (see the priority field).
397
411
//
412
+ // The maximum number of tolerations is 16.
413
+ //
398
414
// This is an alpha field and requires enabling the DRADeviceTaints
399
415
// feature gate.
400
416
//
401
417
// +optional
402
418
// +listType=atomic
403
419
// +featureGate=DRADeviceTaints
404
- Taints []Taint
420
+ Taints []DeviceTaint
405
421
` ` `
406
422
407
423
### Test Plan
0 commit comments