Skip to content

add trackLogsInterval option - #2825

Merged
yxxhero merged 2 commits into
helmfile:mainfrom
pznamensky:trackLogsInterval-option
Oct 10, 2026
Merged

yxxhero merged 2 commits into
helmfile:mainfrom
pznamensky:trackLogsInterval-option

Conversation

@pznamensky

Copy link
Copy Markdown
Contributor

Kubedog’s log output interval is currently configured by --track-logs-interval arg: #2807
However, there is no matching option on per-release level that could be saved in helmfile.yaml.

I'd suggest adding trackLogsInterval to match other options configuration approach.
Supports apply and sync with both trackLogs and trackFailedLogs. An explicitly supplied CLI flag overrides the release setting. The default remains 10s, with a 1s minimum validated before deployment.

Update existing temporary-file ID expectations because adding a release field changes their hashes.

Validation: existing race-enabled tests pass, along with make check, make check-modernize, and golangci-lint run.

AI disclosure

I used LLMs to write and test this change as I'm not familiar with golang.

@pznamensky
pznamensky force-pushed the trackLogsInterval-option branch from cd02e73 to 51e8c0a Compare October 8, 2026 17:35
The trackLogsInterval feature shipped without tests. Add coverage for:

- config getter: zero when --track-logs-interval is not supplied, explicit
  value (including an explicit default) when supplied, and the nil-Cmd
  fallback for non-cobra callers (pkg/config/apply_test.go, sync_test.go)
- buildReleaseTracker resolution: explicit CLI interval overrides the
  release setting, release setting used when the flag is absent, 10s
  default preserved when both are unset (pkg/state/helmx_test.go)
- release-level minimum validation in ExecuteTemplates: below/zero/
  negative rejected, 1s and above accepted (pkg/state/state_exec_tmpl_test.go)

Also add the missing blank line after syncImpl.Cmd in cmd/sync.go for
consistency with cmd/apply.go.

Signed-off-by: yxxhero <[email protected]>

@yxxhero yxxhero left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed this PR end-to-end and pushed a follow-up commit (e61f71c2) adding the missing test coverage plus a tiny style fix.

What I verified (all correct):

  1. Default preservation: kubedog.NewTrackOptions() defaults LogsInterval to 10s, so when neither the flag nor the release field is set, behavior is unchanged.
  2. CLI minimum validation: pre-existing ValidateConfig() checks (--track-logs-interval must be at least 1s) run from both apply and sync RunE.
  3. Release minimum validation: the new check in ExecuteTemplates runs after template resolution, so templated trackLogsInterval values are validated too — placement is consistent with the neighboring Chart == "" check.
  4. Explicit-flag detection: the Cmd + Flags().Changed("track-logs-interval") pattern follows the existing TestImpl.Cmd precedent in pkg/config/test.go (and improves on it with a nil guard). Explicitly passing the default value (--track-logs-interval 10s) still counts as supplied — correct.
  5. Hash updates in temp_test.go: mechanical and expected — HashObject spews the whole ReleaseSpec, so any new field shifts the IDs. I confirmed no other tests or testdata depend on these IDs.

One design note (kept as-is): sibling track options (trackLogs, trackTimeout, trackLogsUntilReady, trackFailedLogs) use release-wins precedence, while this option uses explicit-CLI-wins. Since the CLI-wins behavior is deliberate, documented in the flag help and both docs pages, and arguably the better UX for one-off overrides, I kept it — just flagging the asymmetry for awareness.

Added in e61f71c2:

  • pkg/config/apply_test.go, pkg/config/sync_test.go: getter semantics (zero when flag not supplied, explicit value — including explicit default — when supplied, nil-Cmd fallback)
  • pkg/state/helmx_test.go: TestBuildReleaseTracker_LogsInterval covering CLI-over-release, release-when-flag-absent, and the 10s default
  • pkg/state/state_exec_tmpl_test.go: validation cases for 1s/5s accepted; 500ms/0s/-1s rejected with the exact error message
  • cmd/sync.go: missing blank line after syncImpl.Cmd = cmd for consistency with cmd/apply.go

@yxxhero
yxxhero merged commit 12fb688 into helmfile:main Oct 10, 2026
17 checks passed
@pznamensky
pznamensky deleted the trackLogsInterval-option branch October 11, 2026 18:12
hbjydev pushed a commit to hbjydev/phoebe that referenced this pull request Oct 20, 2026
…) (#902)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [aqua:helmfile/helmfile](https://github.com/helmfile/helmfile) | tools | patch | `1.8.1` → `1.8.2` |

---

### Release Notes

<details>
<summary>helmfile/helmfile (aqua:helmfile/helmfile)</summary>

### [`v1.8.2`](https://github.com/helmfile/helmfile/releases/tag/v1.8.2)

[Compare Source](helmfile/helmfile@v1.8.1...v1.8.2)

#### What's Changed

- fix: support escaped commas in --state-values-set by [@&#8203;ban11111](https://github.com/ban11111) in [#&#8203;2813](helmfile/helmfile#2813)
- add trackLogsUntilReady flag by [@&#8203;pznamensky](https://github.com/pznamensky) in [#&#8203;2814](helmfile/helmfile#2814)
- feat: dir= selector for path-based release filtering and traversal skip by [@&#8203;dschmidt](https://github.com/dschmidt) in [#&#8203;2609](helmfile/helmfile#2609)
- build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.113.4 to 1.114.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2818](helmfile/helmfile#2818)
- build(deps): bump github.com/sashabaranov/go-openai from 1.42.1 to 1.43.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2819](helmfile/helmfile#2819)
- build(deps): bump go.opentelemetry.io/otel/sdk/metric from 1.46.0 to 1.47.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2815](helmfile/helmfile#2815)
- build(deps): bump gitpython from 3.1.59 to 3.1.62 in /docs by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2820](helmfile/helmfile#2820)
- build(deps): bump golang.org/x/sync from 0.23.0 to 0.24.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2827](helmfile/helmfile#2827)
- add trackLogsInterval option by [@&#8203;pznamensky](https://github.com/pznamensky) in [#&#8203;2825](helmfile/helmfile#2825)
- build(deps): bump github.com/hashicorp/go-getter/v2 from 2.2.4 to 2.2.5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2821](helmfile/helmfile#2821)
- build(deps): bump go.opentelemetry.io/proto/otlp from 1.11.0 to 1.11.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2822](helmfile/helmfile#2822)
- build(deps): bump go.opentelemetry.io/contrib/exporters/autoexport from 0.71.0 to 0.72.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2823](helmfile/helmfile#2823)
- build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.114.0 to 1.114.3 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2828](helmfile/helmfile#2828)
- build(deps): bump github.com/mattn/go-runewidth from 0.0.30 to 0.0.31 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2829](helmfile/helmfile#2829)
- build(deps): bump golang.org/x/term from 0.46.0 to 0.47.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2830](helmfile/helmfile#2830)
- build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.33.6 to 1.33.9 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2831](helmfile/helmfile#2831)
- build(deps): bump github.com/gookit/color from 1.6.1 to 1.6.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2833](helmfile/helmfile#2833)
- fix: skip recreatePods on Helm 4, which removed --recreate-pods by [@&#8203;Cayan](https://github.com/Cayan) in [#&#8203;2832](helmfile/helmfile#2832)
- chore: bump Helm to v3.22.1 and v4.3.1 by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2834](helmfile/helmfile#2834)
- fix: propagate --oci-plain-http to chartify for all chart-preparing commands by [@&#8203;yxxhero](https://github.com/yxxhero) in [#&#8203;2826](helmfile/helmfile#2826)

**Full Changelog**: <helmfile/helmfile@v1.8.1...v1.8.2>

</details>

---

### Configuration

📅 **Schedule**: (in timezone Europe/London)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNjcuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjE2Ny41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.hayden.moe/hayden/phoebe/pulls/902
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants