Skip to content

fix(helm): let helm_upgrade callers set the --timeout - #112

Open
lbarrosby wants to merge 1 commit into
kagent-dev:mainfrom
lbarrosby:helm-upgrade-timeout
Open

lbarrosby wants to merge 1 commit into
kagent-dev:mainfrom
lbarrosby:helm-upgrade-timeout

Conversation

@lbarrosby

Copy link
Copy Markdown
Contributor

runHelmCommand adds --timeout 30s to every helm upgrade the helm_upgrade tool runs, and the tool has no way to change it. Helm's own default is 5m0s. The timeout covers each Kubernetes operation, such as hook Jobs and, with --wait, the wait for resources to become ready. So helm_upgrade with wait: true fails for any release whose pods need more than 30 seconds (an image pull, a slow readiness probe, a migration hook). Helm then marks the revision failed and the tool reports Helm upgrade command failed, though the rollout would have finished. The existing "upgrade with all options" test records that combination: --wait --timeout 30s.

Change: helm_upgrade gets an optional timeout input, a Go duration (5m, 90s). It is validated with time.ParseDuration and must be positive, and it is passed as --timeout. Without it the tool still sends 30s, so current callers and the existing test are unchanged. The other helm commands do not get a --timeout, as before.

Tests (TestHandleHelmUpgradeReleaseTimeout): wait: true, timeout: "5m" runs helm upgrade myapp stable/myapp --wait --timeout 5m0s, and soon, 0s and -1m are rejected before helm runs. go test -tags=test ./pkg/... ./internal/... ./cmd/... and golangci-lint run --build-tags=test pass. The change merges cleanly with #109 and #110.

AI disclosure: written with the help of Claude Code, reviewed and tested by me.

helm_upgrade always ran helm with --timeout 30s. With wait set, helm
gives up after 30s on resources that are still becoming ready (an
image pull is often longer), marks the release failed and the tool
returns an error. Add a timeout input; 30s stays the default.

Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
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.

1 participant