The rangeint suggestion is faster.
The maps.Copy and slices.Contains are just syntatic sugar.
Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
The kube client logging is based on the actionConfig logging. This
is setup to use slog.Default() before the logging flags are parsed
and logging is setup.
newRootCmdWithConfig changes the logging but it wasn't picked up
for actionConfig or the kube client. This change updates the logging
to include any changes.
Signed-off-by: Matt Farina <matt.farina@suse.com>
Adds chart name to dependency logs, namespace to resource waiting logs,
and confirmation message when all resources are ready.
Addresses #31520
Signed-off-by: shuv0id <110290476+shuv0id@users.noreply.github.com>
Helm 3.19.0 introduced a regression where vendor-specific suffixes
(e.g., -gke.1245000, -eks-4096722, +) are stripped from
.Capabilities.KubeVersion.GitVersion, breaking charts that detect
managed Kubernetes platforms.
The root cause was using k8sversion.ParseGeneric().String() which
intentionally discards vendor suffixes. The fix stores both the full
version (with vendor suffix) and a normalized version. String() returns
the normalized version for constraint checking (e.g., ">= 1.21.0"),
while Version/GitVersion preserve the full string for template access.
Fixes#31423
Related to #31063, #31078
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
While testing SDK features for v4. I was surprised with the error:
"reporter failed to start: event funnel closed: context deadline exceeded"
This occurs when no timeout is set:
```
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
```
With this patch it will work without specifying.
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
> "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>