Skip to content

Commit 01d57f2

Browse files
committed
dynamic resource allocation: clean up parameter references
Using APIVersion in the reference leads to ambiguities when the versions change. Using just APIGroup is better. The examples accidentally used "apiVersion". The naming convention (see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#naming-of-the-reference-field) is to have Ref as field suffix. In our case that also provides a path towards (perhaps) at some point inlining parameters because that field then can be called just "Parameters".
1 parent 140a6e9 commit 01d57f2

File tree

1 file changed

+8
-8
lines changed
  • keps/sig-node/3063-dynamic-resource-allocation

1 file changed

+8
-8
lines changed

keps/sig-node/3063-dynamic-resource-allocation/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ kind: ResourceClass
419419
metadata:
420420
name: acme-gpu
421421
driverName: gpu.example.com
422-
parameters:
423-
apiVersion: gpu.example.com/v1
422+
parametersRef:
423+
apiGroup: gpu.example.com
424424
kind: GPUInit
425425
name: acme-gpu-init
426426
```
@@ -450,8 +450,8 @@ spec:
450450
- name: "gpu" # this name gets referenced below under "claims"
451451
template:
452452
resourceClassName: "acme-gpu"
453-
parameters:
454-
apiVersion: gpu.example.com/v1
453+
parametersRef:
454+
apiGroup: gpu.example.com
455455
kind: GPURequirements
456456
name: device-consumer-gpu-parameters
457457
containers:
@@ -1124,13 +1124,13 @@ type ResourceClass struct {
11241124
// (acme.example.com).
11251125
DriverName string
11261126
1127-
// Parameters references an arbitrary separate object that may hold
1127+
// ParametersRef references an arbitrary separate object that may hold
11281128
// parameters that will be used by the
11291129
// driver when allocating a resource that uses this class. The driver
11301130
// will be able to distinguish between parameters stored here and and
11311131
// those stored in ResourceClaimSpec. These parameters here can only be
11321132
// set by cluster administrators.
1133-
Parameters ResourceClassParametersReference
1133+
ParametersRef ResourceClassParametersReference
11341134
11351135
// Only nodes matching the selector will be considered by the scheduler
11361136
// when trying to find a Node that fits a Pod when that Pod uses
@@ -1180,12 +1180,12 @@ type ResourceClaimSpec struct {
11801180
// reject claims where the class is missing.
11811181
ResourceClassName string
11821182
1183-
// Parameters references a separate object with arbitrary parameters
1183+
// ParametersRef references a separate object with arbitrary parameters
11841184
// that will be used by the
11851185
// driver when allocating a resource for the claim.
11861186
//
11871187
// The object must be in the same namespace as the ResourceClaim.
1188-
Parameters ResourceClaimParametersReference
1188+
ParametersRef ResourceClaimParametersReference
11891189
11901190
// Allocation can start immediately or when a Pod wants to use the
11911191
// resource. Waiting for a Pod is the default.

0 commit comments

Comments
 (0)