mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
dra: enable adding ReservedFor entries through strategic-merge-patch
When moving the reservation of a claim for a pod into the PreBind phase in a future commit, multiple different update attempts will be executed concurrently. We want an attempt to succeed if and only if adding the entry passes validation. Without patch strategy and key, strategic-merge-patch replaces the entire ReservedFor instead of adding new entries. Server-side-apply cannot be used because each attempt may start with a stale ResourceClaim (thus cannot send the entire ReservedFor) and SSA doesn't support merging when using the same manager string. Using different managers (one for each entry) would work, but sounds like a bad hack.
This commit is contained in:
parent
0c645922ed
commit
324816a883
4
api/openapi-spec/swagger.json
generated
4
api/openapi-spec/swagger.json
generated
@ -14387,7 +14387,9 @@
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"uid"
|
||||
],
|
||||
"x-kubernetes-list-type": "map"
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
|
@ -478,7 +478,9 @@
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"uid"
|
||||
],
|
||||
"x-kubernetes-list-type": "map"
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
|
4
pkg/generated/openapi/zz_generated.openapi.go
generated
4
pkg/generated/openapi/zz_generated.openapi.go
generated
@ -42805,7 +42805,9 @@ func schema_k8sio_api_resource_v1alpha2_ResourceClaimStatus(ref common.Reference
|
||||
"x-kubernetes-list-map-keys": []interface{}{
|
||||
"uid",
|
||||
},
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-list-type": "map",
|
||||
"x-kubernetes-patch-merge-key": "uid",
|
||||
"x-kubernetes-patch-strategy": "merge",
|
||||
},
|
||||
},
|
||||
SchemaProps: spec.SchemaProps{
|
||||
|
@ -257,6 +257,8 @@ message ResourceClaimStatus {
|
||||
//
|
||||
// +listType=map
|
||||
// +listMapKey=uid
|
||||
// +patchStrategy=merge
|
||||
// +patchMergeKey=uid
|
||||
// +optional
|
||||
repeated ResourceClaimConsumerReference reservedFor = 3;
|
||||
|
||||
|
@ -114,8 +114,10 @@ type ResourceClaimStatus struct {
|
||||
//
|
||||
// +listType=map
|
||||
// +listMapKey=uid
|
||||
// +patchStrategy=merge
|
||||
// +patchMergeKey=uid
|
||||
// +optional
|
||||
ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,3,opt,name=reservedFor"`
|
||||
ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,3,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"`
|
||||
|
||||
// DeallocationRequested indicates that a ResourceClaim is to be
|
||||
// deallocated.
|
||||
|
Loading…
Reference in New Issue
Block a user