Skip to content

Commit 948b741

Browse files
committed
Use the same workqueue key for Prepare/UnprepareResources on same claim
Signed-off-by: Kevin Klues <[email protected]>
1 parent 92adba3 commit 948b741

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/compute-domain-kubelet-plugin/driver.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ func (d *driver) PrepareResourceClaims(ctx context.Context, claims []*resourceap
162162

163163
for _, claim := range claims {
164164
wg.Add(1)
165-
workQueue.EnqueueRaw(claim, func(ctx context.Context, obj any) error {
165+
key := fmt.Sprintf("%v", claim.UID)
166+
workQueue.EnqueueRawWithKey(claim, key, func(ctx context.Context, obj any) error {
166167
done, res := d.nodePrepareResource(ctx, claim)
167168
if done {
168169
results[claim.UID] = res
@@ -192,7 +193,8 @@ func (d *driver) UnprepareResourceClaims(ctx context.Context, claimRefs []kubele
192193

193194
for _, claim := range claimRefs {
194195
wg.Add(1)
195-
workQueue.EnqueueRaw(claim, func(ctx context.Context, obj any) error {
196+
key := fmt.Sprintf("%v", claim.UID)
197+
workQueue.EnqueueRawWithKey(claim, key, func(ctx context.Context, obj any) error {
196198
done, err := d.nodeUnprepareResource(ctx, claim)
197199
if done {
198200
results[claim.UID] = err

0 commit comments

Comments
 (0)