Skip to content

Commit c010dff

Browse files
committed
DRA: review feedback
Config structs, typos...
1 parent 2da854b commit c010dff

File tree

1 file changed

+29
-11
lines changed
  • keps/sig-node/4381-dra-structured-parameters

1 file changed

+29
-11
lines changed

keps/sig-node/4381-dra-structured-parameters/README.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ type ResourceClaimSpec struct {
14011401
//
14021402
// +optional
14031403
// +listType=atomic
1404-
Config []ConfigurationParameters
1404+
Config []ClaimConfigurationParameters
14051405

14061406
// Future extension, ignored by older schedulers. This is fine because scoring
14071407
// allows users to define a preference, without making it a hard requirement.
@@ -1556,7 +1556,7 @@ type Constraint struct {
15561556
// +optional
15571557
RequestNames []string
15581558

1559-
// The devices must have this attribute and its value must be the same.
1559+
// If set, then the devices must have this attribute and its value must be the same.
15601560
//
15611561
// For example, if you specified "numa.dra.example.com" (a hypothetical example!),
15621562
// then only devices in the same NUMA node will be chosen.
@@ -1576,15 +1576,21 @@ type Constraint struct {
15761576
// matcher string
15771577
}
15781578

1579-
// Besides the request name slice, ConfigurationParameters must have one and only one field set.
1580-
type ConfigurationParameters struct {
1581-
// The constraint applies to devices in these requests.
1579+
type ClaimConfigurationParameters struct {
1580+
// The configuration applies to devices in these requests.
15821581
//
15831582
// If empty, the configuration applies to all devices in the claim.
15841583
//
15851584
// +optional
15861585
RequestNames []string
15871586

1587+
ConfigurationParameters // inline
1588+
}
1589+
1590+
// ConfigurationParameters must have one and only one field set. It gets embedded
1591+
// inline in some other structs which have other fields, so field names must
1592+
// not conflict with those.
1593+
type ConfigurationParameters struct {
15881594
Opaque *OpaqueConfigurationParameters
15891595
}
15901596

@@ -1680,12 +1686,19 @@ type DeviceClass struct {
16801686
// Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor
16811687
// configuration applies to exactly one driver.
16821688
//
1683-
// They are passed to the driver, but are not consider while allocating the claim.
1689+
// They are passed to the driver, but are not considered while allocating the claim.
16841690
//
16851691
// +optional
16861692
// +listType=atomic
1687-
Config []ConfigurationParameters
1693+
Config []ClassConfigurationParameters
16881694
}
1695+
1696+
// ClassConfigurationParameters is currently just a wrapper for the common
1697+
// ConfigurationParameters. This could change, therefore its a separate struct.
1698+
type ClassConfigurationParameters struct {
1699+
ConfigurationParameters // inline
1700+
}
1701+
16891702
```
16901703

16911704
##### Allocation result
@@ -1750,14 +1763,19 @@ type RequestAllocationResult struct {
17501763
DeviceName string
17511764
}
17521765

1753-
// AllocationConfigurationParameters is a superset of ConfigurationParameters which
1754-
// is used in AllocationResult to track where the parameters came from.
17551766
type AllocationConfigurationParameters struct {
17561767
// Admins is true if the source of the configuration was a class and thus
17571768
// not something that a normal user would have been able to set.
17581769
Admin bool
17591770

1760-
ConfigurationParameters
1771+
// The configuration applies to devices in these requests.
1772+
//
1773+
// If empty, the configuration applies to all devices in the claim.
1774+
//
1775+
// +optional
1776+
RequestNames []string
1777+
1778+
ConfigurationParameters // inline
17611779
}
17621780
```
17631781

@@ -1822,7 +1840,7 @@ type QuotaSpec struct {
18221840
// Controls whether devices may get allocated with admin access
18231841
// (concurrent with normal use, potentially privileged access permissions
18241842
// depending on the driver). If multiple quota objects exist and at least one
1825-
// has a true value, access will be allowed. The default to deny such access.
1843+
// has a true value, access will be allowed. The default is to deny such access.
18261844
//
18271845
// +optional
18281846
AllowAdminAccess bool `json:"allowManagementAccess,omitempty"`

0 commit comments

Comments
 (0)