DRA kubelet: API clarification

It's not okay to drop a claim from the response just because it encountered no
error. We want to be sure that a DRA driver really looked at the claim.
This commit is contained in:
Patrick Ohly
2025-06-27 09:30:28 +02:00
parent dcefe0ef41
commit 005cef332d
3 changed files with 6 additions and 3 deletions

View File

@@ -115,7 +115,8 @@ type DRAPlugin interface {
// and serialization.
//
// The conventions for returning one overall error and several per-ResourceClaim
// errors are the same as in PrepareResourceClaims.
// errors are the same as in PrepareResourceClaims. In particular, all claims
// must have an entry in the response, even if that entry is nil.
UnprepareResourceClaims(ctx context.Context, claims []NamespacedObject) (result map[types.UID]error, err error)
// ErrorHandler gets called for each error encountered while publishing

View File

@@ -326,7 +326,8 @@ func (m *NodeUnprepareResourcesRequest) GetClaims() []*Claim {
type NodeUnprepareResourcesResponse struct {
// The ResourceClaims for which preparation was reverted.
// The same rules as for NodePrepareResourcesResponse.claims
// apply.
// apply. In particular, all claims in the request must
// have an entry in the response, even if that entry is nil.
Claims map[string]*NodeUnprepareResourceResponse `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_sizecache int32 `json:"-"`

View File

@@ -95,7 +95,8 @@ message NodeUnprepareResourcesRequest {
message NodeUnprepareResourcesResponse {
// The ResourceClaims for which preparation was reverted.
// The same rules as for NodePrepareResourcesResponse.claims
// apply.
// apply. In particular, all claims in the request must
// have an entry in the response, even if that entry is nil.
map<string, NodeUnprepareResourceResponse> claims = 1;
}