Commit 0cb597f
[Backport 7.81.x] [CONTINT] Retry event checkpoint read (#53871)
Backport 9c3331f from #53752.
___
### What does this PR do?
Adds retry-with-backoff when reading the `kubernetes_apiserver` event-collection checkpoint from its ConfigMap.
### Motivation
A transient error reading the checkpoint was being treated the same as "checkpoint doesn't exist," which resets the watermark to 0 and causing the initial watch to potentially redeliver all events. For example:
```
2026-07-16 14:38:39 UTC | CLUSTER | ERROR | (/home/datadog/go/src/github.com/DataDog/datadog-agent-checkpoint-baseline/pkg/util/kubernetes/apiserver/apiserver.go:509 in getOrCreateConfigMap) | Could not get the ConfigMap baseline-token: configmaps "baseline-token" not found, trying to create it.
2026-07-16 14:38:39 UTC | CLUSTER | INFO | (/home/datadog/go/src/github.com/DataDog/datadog-agent-checkpoint-baseline/pkg/util/kubernetes/apiserver/apiserver.go:519 in getOrCreateConfigMap) | Created the ConfigMap baseline-token
```
### Describe how you validated your changes
Reproduced the behavior on a kind cluster running the DCA via the Operator by denying the DCA GET requests to the checkpoint ConfigMap temporarily to hit the retry.
### Additional Notes
Co-authored-by: kacper.murzyn <kacper.murzyn@datadoghq.com>1 parent fd6156b commit 0cb597f
3 files changed
Lines changed: 29 additions & 2 deletions
File tree
- pkg
- collector/corechecks/cluster/kubernetesapiserver
- util/kubernetes/apiserver
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
377 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
385 | 407 | | |
386 | 408 | | |
387 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
485 | 486 | | |
486 | 487 | | |
487 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
488 | 492 | | |
489 | 493 | | |
490 | 494 | | |
| |||
0 commit comments