helmfile/pkg/kubedog
Graeme Gillies 94e14f3b4e
fix: Fix broken `trackLogs` functionality in Kubedog tracker (#2630)
* fix: Fix broken `trackLogs` functionality in Kubedog tracker

When using helmfile with the following setup

```
releases:
  - name: my-app
    chart: ./mychart
    trackMode: kubedog
    trackLogs: true
    trackFailOnError: true
```

We don't actually see any logs from the container being printed.

This is because when building the options for the Kubedog tracker, we never
specify `SaveLogsOnlyForNumberOfReplicas` which means this defaults to 0.

Looking at the logic in `pkg/tracker/deployment/tracker.go` we see

```
ignoreLogs := job.ignoreLogs || job.savingLogsReplicas >= job.SaveLogsOnlyForNumberOfReplicas
```

With job.SaveLogsOnlyForNumberOfReplicas always defaulting to 0, this will always ignore logs

This change sets it to a reasonable default of tracking logs from up to 10 pods.

Signed-off-by: Graeme Gillies <ggillies@gitlab.com>

* fix formatting

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Graeme Gillies <ggillies@gitlab.com>

* feat: Refactor out building tracker opts into it's own function, add tests

Signed-off-by: Graeme Gillies <ggillies@gitlab.com>

---------

Signed-off-by: Graeme Gillies <ggillies@gitlab.com>
Co-authored-by: Graeme Gillies <ggillies@gitlab.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-11 17:17:28 +08:00
..
display.go fix: restore kubedog status progress output during tracking (#2602) 2026-05-20 20:53:03 +08:00
display_test.go fix: restore kubedog status progress output during tracking (#2602) 2026-05-20 20:53:03 +08:00
options.go feat: add helm-legacy track mode for Helm v4 compatibility (#2466) 2026-03-08 11:51:14 +08:00
tracker.go fix: Fix broken `trackLogs` functionality in Kubedog tracker (#2630) 2026-06-11 17:17:28 +08:00
tracker_test.go fix: Fix broken `trackLogs` functionality in Kubedog tracker (#2630) 2026-06-11 17:17:28 +08:00