From 2948279fb90bcb0d22e9f160f1f96b424ce74b7d Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Fri, 7 Mar 2025 14:29:47 +0000 Subject: [PATCH] cleanup if statement Signed-off-by: Austin Abro --- pkg/action/install.go | 6 ++---- pkg/action/upgrade.go | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pkg/action/install.go b/pkg/action/install.go index c96e1a0ff..be76a634f 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -289,10 +289,8 @@ func (i *Install) RunWithContext(ctx context.Context, chrt *chart.Chart, vals ma // Make sure if Atomic is set, that wait is set as well. This makes it so // the user doesn't have to specify both - if i.Wait == kube.HookOnlyStrategy { - if i.Atomic { - i.Wait = kube.StatusWatcherStrategy - } + if i.Wait == kube.HookOnlyStrategy && i.Atomic { + i.Wait = kube.StatusWatcherStrategy } if err := i.cfg.KubeClient.SetWaiter(i.Wait); err != nil { return nil, fmt.Errorf("failed to set kube client waiter: %w", err) diff --git a/pkg/action/upgrade.go b/pkg/action/upgrade.go index 851ac512a..ba5dfb5d1 100644 --- a/pkg/action/upgrade.go +++ b/pkg/action/upgrade.go @@ -155,10 +155,8 @@ func (u *Upgrade) RunWithContext(ctx context.Context, name string, chart *chart. // Make sure if Atomic is set, that wait is set as well. This makes it so // the user doesn't have to specify both - if u.Wait == kube.HookOnlyStrategy { - if u.Atomic { - u.Wait = kube.StatusWatcherStrategy - } + if u.Wait == kube.HookOnlyStrategy && u.Atomic { + u.Wait = kube.StatusWatcherStrategy } if err := u.cfg.KubeClient.SetWaiter(u.Wait); err != nil { return nil, fmt.Errorf("failed to set kube client waiter: %w", err)