-
Notifications
You must be signed in to change notification settings - Fork 709
Closed
Description
Found context.TODO() in production troubleshooting code at internal/troubleshoot/collect/config_dump.go:69
Current:
pods, err := listPods(context.TODO(), client, cd.Namespace, labels.SelectorFromSet(...))Issue:
- No cancellation/timeout support for Kubernetes API calls
- Operations can hang indefinitely if API server is slow
- Can't propagate context from caller
Fix:
Accept context parameter in Collect() method signature:
func (cd ConfigDump) Collect(ctx context.Context, _ chan<- interface{}) (tbcollect.CollectorResult, error) {
pods, err := listPods(ctx, client, cd.Namespace, ...)
}Similar pattern found in internal/troubleshoot/collect/prometheus_metrics.go
Location: internal/troubleshoot/collect/config_dump.go:69
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels