Commit 9c3331f
authored
[CONTINT] Retry event checkpoint read (#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: jon.rosario <jon.rosario@datadoghq.com>1 parent f4b370a commit 9c3331f
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 | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
376 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
377 | 378 | | |
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
384 | 406 | | |
385 | 407 | | |
386 | 408 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
509 | 513 | | |
510 | 514 | | |
511 | 515 | | |
| |||
0 commit comments