While testing SDK features for v4. I was surprised with the error:

> "reporter failed to start: event funnel closed: context deadline  exceeded"

It happens when you forget to set a minimal timeout:
```go
upgradeClient := action.NewUpgrade(actionConfig)
upgradeClient.WaitStrategy = kube.StatusWatcherStrategy
// When Timeout is zero, the status wait uses a context with zero timeout which
// immediately expires causing "context deadline exceeded" errors.
upgradeClient.Timeout = 2 * time.Minute
```

Also maybe it might be worth documenting this more clearly. Initial [PR](https://github.com/helm/helm/pull/13604) say:
> I have not written any docs, I assume that can be done when we are closer to Helm 4, a lot of it is covered by linking to - https://github.com/kubernetes-sigs/cli-utils/blob/master/pkg/kstatus/README.md

Related:
  - https://github.com/helm/helm/pull/31411#issuecomment-3443925663
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
pull/31421/head
Benoit Tigeot 2 months ago
parent f352ced42b
commit 5cbd9b3035
No known key found for this signature in database
GPG Key ID: 8E6D4FC8AEBDA62C

@ -98,12 +98,23 @@ type Client struct {
var _ Interface = (*Client)(nil)
// WaitStrategy represents the algorithm used to wait for Kubernetes
// resources to reach their desired state.
type WaitStrategy string
const (
// StatusWatcherStrategy: event-driven waits using kstatus (watches + aggregated readers).
// Default for --wait. More accurate and responsive; waits CRs and full reconciliation.
// Requires: reachable API server, list+watch RBAC on deployed resources, and a non-zero timeout.
StatusWatcherStrategy WaitStrategy = "watcher"
LegacyStrategy WaitStrategy = "legacy"
HookOnlyStrategy WaitStrategy = "hookOnly"
// LegacyStrategy: Helm 3-style periodic polling until ready or timeout.
// Use when watches arent available/reliable, or for compatibility/simple CI.
// Requires only list RBAC for polled resources.
LegacyStrategy WaitStrategy = "legacy"
// HookOnlyStrategy: wait only for hook Pods/Jobs to complete; does not wait for general chart resources.
HookOnlyStrategy WaitStrategy = "hookOnly"
)
type FieldValidationDirective string

Loading…
Cancel
Save