You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ClaimSpec is the spec to auto-generate a DRA resource claim/resource claim template. Only one of ClaimSpec, ResourceClaimName or ResourceClaimTemplateName must be specified.
// DRADeviceAttributeMatcher defines the matcher expression for a DRA device attribute.
406
-
typeDRADeviceAttributeMatcherstruct {
407
-
// Key is the name of the device attribute to match.
408
-
// This is either a qualified name or a simple name.
409
-
// If it is a simple name, then it is assumed to be prefixed with the DRA driver name.
410
-
// Eg: "gpu.nvidia.com/productName" is equivalent to "productName" if the driver name is "gpu.nvidia.com". Otherwise they're treated as 2 different attributes.
411
-
// +kubebuilder:validation:MaxLength=64
412
-
Keystring`json:"key"`
413
-
// Op is the operator to use for matching the device attribute. Supported operators are:
414
-
// * Equal: The device attribute value must be equal to the value specified in the matcher.
415
-
// * NotEqual: The device attribute value must not be equal to the value specified in the matcher.
416
-
// * GreaterThan: The device attribute value must be greater than the value specified in the matcher.
417
-
// * GreaterThanOrEqual: The device attribute value must be greater than or equal to the value specified in the matcher.
418
-
// * LessThan: The device attribute value must be less than the value specified in the matcher.
419
-
// * LessThanOrEqual: The device attribute value must be less than or equal to the value specified in the matcher.
// DRAClaimSpec defines the spec for generating a DRA resource claim/resource claim template.
482
-
typeDRAClaimSpecstruct {
483
-
// GenerateName is an optional name prefix to use for generating the resource claim/resource claim template.
484
-
// +kubebuilder:validation:MinLength=1
485
-
// +kubebuilder:validation:MaxLength=16
486
-
GenerateNamestring`json:"generateName,omitempty"`
487
-
// +kubebuilder:validation:MinSize=1
488
-
Devices []DRADeviceSpec`json:"devices"`
489
-
// TODO: Warn that if set to false, then this NIMService cannot be scaled up.
490
-
IsTemplate*bool`json:"isTemplate,omitempty"`
491
-
}
492
-
493
-
func (d*DRAClaimSpec) IsTemplateSpec() bool {
494
-
returnd.IsTemplate!=nil&&*d.IsTemplate
495
-
}
496
-
497
-
func (d*DRAClaimSpec) GetNamePrefix() string {
498
-
namePrefix:=d.GenerateName
499
-
ifnamePrefix!="" {
500
-
returnnamePrefix
501
-
}
502
-
ifd.IsTemplateSpec() {
503
-
return"claimtemplate"
504
-
}
505
-
return"claim"
506
-
}
507
-
508
-
// DRAResourceStatus defines the status of the DRAResource.
509
-
// +kubebuilder:validation:XValidation:rule="has(self.resourceClaimStatus) != has(self.resourceClaimTemplateStatus)",message="exactly one of resourceClaimStatus and resourceClaimTemplateStatus must be set."
510
-
typeDRAResourceStatusstruct {
511
-
// Name is the pod claim name referenced in the pod spec as `spec.resourceClaims[].name` for this DRA resource.
512
-
Namestring`json:"name"`
513
-
// ResourceClaimStatus is the status of the resource claim in this DRA resource.
514
-
//
515
-
// Exactly one of resourceClaimStatus and resourceClaimTemplateStatus will be set.
0 commit comments