📜 Description
pkg/networkpolicy/reconciler.go, Compare method, uses context.Background() for all Kubernetes API calls (lines 152, 157, 170, 183, 199). The reconcile context (ctx) carries a deadline, logger, and cancellation signal. Using context.Background() bypasses the reconcile timeout and loses structured logging, making it impossible to correlate log lines with a specific reconcile run.
👟 Reproduction steps
Read pkg/networkpolicy/reconciler.go — every client.List inside Compare uses context.Background().
👍 Expected behavior
All API calls inside Compare should use the ctx parameter passed into Reconcile.
👎 Actual Behavior
Calls use context.Background(), stripping deadline and request context.
🐚 Relevant log output
Version
No response
🖥️ What operating system are you seeing the problem on?
No response
✅ Proposed Solution
Pass ctx through Compare and replace every context.Background() call in it with ctx.
👀 Have you spent some time to check if this issue has been raised before?
Code of Conduct
📜 Description
pkg/networkpolicy/reconciler.go,Comparemethod, usescontext.Background()for all Kubernetes API calls (lines 152, 157, 170, 183, 199). The reconcile context (ctx) carries a deadline, logger, and cancellation signal. Usingcontext.Background()bypasses the reconcile timeout and loses structured logging, making it impossible to correlate log lines with a specific reconcile run.👟 Reproduction steps
Read
pkg/networkpolicy/reconciler.go— everyclient.ListinsideCompareusescontext.Background().👍 Expected behavior
All API calls inside
Compareshould use thectxparameter passed intoReconcile.👎 Actual Behavior
Calls use
context.Background(), stripping deadline and request context.🐚 Relevant log output
Version
No response
🖥️ What operating system are you seeing the problem on?
No response
✅ Proposed Solution
Pass
ctxthroughCompareand replace everycontext.Background()call in it withctx.👀 Have you spent some time to check if this issue has been raised before?
Code of Conduct