Open
Description
What would you like to be added?
When an API uses +listType=map
with a certain set of +listMapKey
s, it should be possible to extend the API such that new, optional fields can be used as keys.
Currently this is rejected by SSA with:
failed to create typed patch object (testdra-all-resourceclaimdevicestatus-5d6xm/my-pod-my-resource; resource.k8s.io/v1beta1, Kind=ResourceClaim): .status.devices: element 0: associative list with keys has an element that omits key field "shareUID" (and doesn't have default value)
{
ErrStatus:
code: 500
message: 'failed to create typed patch object (testdra-all-resourceclaimdevicestatus-5d6xm/my-pod-my-resource;
resource.k8s.io/v1beta1, Kind=ResourceClaim): .status.devices: element 0: associative
list with keys has an element that omits key field "shareUID" (and doesn''t have
default value)'
metadata: {}
status: Failure,
}
Why is this needed?
kubernetes/enhancements#4817 (beta in 1.34) added:
kubernetes/staging/src/k8s.io/api/resource/v1beta2/types.go
Lines 1140 to 1150 in ec80dca
Now kubernetes/enhancements#5075 needs to extend the driver/pool/device triplet with an optional "share ID".
Alternatives:
- encode the additional share ID in the device string: ugly
- make the new field required, with empty string as default: also ugly (alpha-level field always gets stored and shown to users even when empty), doesn't work completely after an upgrade (deleting existing entry without the new key in managed fields not possible)