Ashish
1
Cluster information:
Kubernetes version: 1.29.1
Cloud being used: baremetal
I am writing a controller using informer and workerqueue.
Lets say on any update on a pod/ingress pushes a key to queue A. The worker associated with queue A processes it and pushes the key to queue B, and this goes on to queue C.
Now adding a key multiple times on same queue is deduplicated by the worker queue. workqueue package - k8s.io/client-go/util/workqueue - Go Packages
I want to pass a context through all the layers with a request ID for traceability and debugging. Creating a new context with request ID and a struct to hold the key and context will create a new object everytime and the deduplication will fail. Is there anyway to pass the context across the queues without affecting the deduplication.
PS: saving context in map for each key is doable but complex and may lead to race conditions on multiple updates