sylvactl watch: introduce ability to dump unit timeout information for units with a narrow timeout

Multiple commits in this MR (💡 best to review one commit at a time, only 2 commits are actually changing things significantly, the rest is small refactoring to make the evolution possible):

  • refactoring: checkUnitsTimeouts: extract a function returning a list of unit timeout information, and simplify error management
  • refactoring: TreeInformer.CurrentReconcileDuration to extract ReconcileStart and ReconcileEnd
  • 🌟 extend timeoutInfo type to include more metadata (unitTimeout, timeoutReference, start, end, etc)
  • refactoring: move computeTimeoutInfo to informer/timeouts.go
  • minor: rename report.Generate into report.GenerateTimelineReport
  • 🌟 add --save-data <my-report>.json and --narrow-timeout-margin options

This is used in sylva-projects/sylva-core!8224 (merged) to address sylva-projects/sylva-core#4208

Example report:

{
  "narrow_timeouts": {
    "Kustomization/my-test-unit": {
      "name": "Kustomization/my-test-unit",
      "reconcileDurationSeconds": 95,
      "reconcileStart": "2026-06-12T14:31:13Z",
      "reconcileEnd": "2026-06-12T14:32:48Z",
      "timeoutSeconds": 120
    },
    "Kustomization/foo": {
      "name": "Kustomization/foo",
      "reconcileDurationSeconds": 125,
      "reconcileStart": "2026-06-12T14:11:13Z",
      "reconcileEnd": "2026-06-12T14:2:48Z",
      "timeoutSeconds": 185
    }
  }
}
Edited by Thomas Morin

Merge request reports

Loading