Commit aaf5bf0
committed
fix: use proper context instead of context.TODO()
Replace context.TODO() with the proper context parameter in three locations:
- pkg/resources/kafka/kafka.go: reconcileKafkaPodDelete() now uses ctx for List() and CruiseControlScalerFactory()
- internal/alertmanager/currentalert/process.go: downScale() now uses ctx for NewCruiseControlScaler()
This fix enables:
- Proper cancellation propagation when operations need to be stopped
- Better observability (tracing, logging) through context values
- Prevention of potential resource leaks from uncancelable operations
Resolves FIXME comments in both files.1 parent 18343d8 commit aaf5bf0
2 files changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
326 | | - | |
| 325 | + | |
327 | 326 | | |
328 | 327 | | |
329 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
| 508 | + | |
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
537 | | - | |
| 536 | + | |
538 | 537 | | |
539 | 538 | | |
540 | 539 | | |
| |||
0 commit comments