dra resourceclaim controller: delete generated claims when pod is done
When a pod is done, but not getting removed yet for while, then a claim that got generated for that pod can be deleted already. This then also triggers deallocation.
This commit is contained in:
@@ -216,6 +216,18 @@ func TestSyncHandler(t *testing.T) {
|
||||
expectedClaims: []resourcev1alpha2.ResourceClaim{*testClaimReserved},
|
||||
expectedMetrics: expectedMetrics{0, 0},
|
||||
},
|
||||
{
|
||||
name: "delete-claim-when-done",
|
||||
pods: func() []*v1.Pod {
|
||||
pods := []*v1.Pod{testPodWithResource.DeepCopy()}
|
||||
pods[0].Status.Phase = v1.PodSucceeded
|
||||
return pods
|
||||
}(),
|
||||
key: claimKey(testClaimReserved),
|
||||
claims: []*resourcev1alpha2.ResourceClaim{testClaimReserved},
|
||||
expectedClaims: nil,
|
||||
expectedMetrics: expectedMetrics{0, 0},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
|
Reference in New Issue
Block a user