Skip to content

fix: pass --timeout flag through to helm for sync and apply#2495

Merged
yxxhero merged 5 commits intohelmfile:mainfrom
hristiy4n:fix-timeout-flag-not-being-propagated
Mar 21, 2026
Merged

fix: pass --timeout flag through to helm for sync and apply#2495
yxxhero merged 5 commits intohelmfile:mainfrom
hristiy4n:fix-timeout-flag-not-being-propagated

Conversation

@hristiy4n
Copy link
Copy Markdown
Contributor

Summary

  • Fix --timeout flag for helmfile sync which was defined but not passed to helm
  • Add --timeout flag for helmfile apply which was missing

Problem

The --timeout flag for helmfile sync was added in #2148 but never passed through to the actual helm commands. The flag was parsed and stored, but silently ignored because SyncOpts.Timeout was never populated when building the options.

For helmfile apply the --timeout flag didn't exist at all.

Signed-off-by: Hristiyan Ivanov <hristiyan.d.ivanov@gmail.com>
Signed-off-by: Hristiyan Ivanov <hristiyan.d.ivanov@gmail.com>
Signed-off-by: Hristiyan Ivanov <hristiyan.d.ivanov@gmail.com>
@hristiy4n hristiy4n force-pushed the fix-timeout-flag-not-being-propagated branch from 6efea00 to 6fa9408 Compare March 21, 2026 11:28
@yxxhero yxxhero requested a review from Copilot March 21, 2026 13:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes and extends CLI timeout handling so --timeout is actually propagated into the Helm upgrade/install calls for both helmfile sync and helmfile apply.

Changes:

  • Plumbs Timeout from the app config providers into state.SyncOpts for both the apply and sync execution paths.
  • Adds --timeout flag support to helmfile apply (matching existing helmfile sync flag behavior).
  • Adds a sync-focused regression test verifying --timeout becomes helm --timeout <Ns>.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/config/apply.go Adds Timeout to apply options and exposes it via ApplyImpl.Timeout().
pkg/app/config.go Extends ApplyConfigProvider and SyncConfigProvider with Timeout() int.
pkg/app/app.go Passes c.Timeout() into state.SyncOpts in both apply and sync flows.
cmd/apply.go Introduces --timeout flag for helmfile apply.
pkg/app/app_test.go Updates the apply test config stub to satisfy the new Timeout() interface method.
pkg/app/app_sync_test.go Adds regression coverage ensuring sync propagates timeout into Helm flags.

Signed-off-by: Hristiyan Ivanov <hristiyan.d.ivanov@gmail.com>
Signed-off-by: Hristiyan Ivanov <hristiyan.d.ivanov@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@yxxhero yxxhero merged commit 5c67cbc into helmfile:main Mar 21, 2026
20 checks passed
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.

3 participants