How to modify order of items in a WorkQueue before processing the items by worker thread of a k8s controller

1/6/2022

I am having a WorkQueue like below, in which A, B and C are kubernetes resource objects: C-A-B

I want to modify this order of the resource objects in that WorkQueue before passing those objects for processing by a worker thread, like A-B-C

I want to do like this because there is dependency among the resource object A, B, C such that after getting the objects one by one by Get() method of WorkQueue for their processing, they should get processed in a specific order only, as they are dependent on each other.(eg. A's processing is dependent on B's processing)

Please help me for finding a solution for this.

Thanks

-- Neha Kembalkar
go
kubernetes

0 Answers