DRA: remove "sharable" from claim allocation result

Now all claims are shareable up to the limit imposed by the size of the
"reserverFor" array.

This is one of the agreed simplifications for 1.31.
This commit is contained in:
Patrick Ohly
2024-06-13 18:43:17 +02:00
parent de5742ae83
commit 8a629b9f15
30 changed files with 152 additions and 408 deletions

View File

@@ -336,7 +336,6 @@ func TestValidateClaimStatusUpdate(t *testing.T) {
}
return handles
}(),
Shareable: true,
},
}
@@ -584,25 +583,6 @@ func TestValidateClaimStatusUpdate(t *testing.T) {
return claim
},
},
"invalid-reserved-for-not-shared": {
wantFailures: field.ErrorList{field.Forbidden(field.NewPath("status", "reservedFor"), "may not be reserved more than once")},
oldClaim: func() *resource.ResourceClaim {
claim := validAllocatedClaim.DeepCopy()
claim.Status.Allocation.Shareable = false
return claim
}(),
update: func(claim *resource.ResourceClaim) *resource.ResourceClaim {
for i := 0; i < 2; i++ {
claim.Status.ReservedFor = append(claim.Status.ReservedFor,
resource.ResourceClaimConsumerReference{
Resource: "pods",
Name: fmt.Sprintf("foo-%d", i),
UID: types.UID(fmt.Sprintf("%d", i)),
})
}
return claim
},
},
"invalid-reserved-for-no-allocation": {
wantFailures: field.ErrorList{field.Forbidden(field.NewPath("status", "reservedFor"), "may not be specified when `allocated` is not set")},
oldClaim: validClaim,