cleanup if statement

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
pull/13604/head
Austin Abro 6 months ago
parent 600947b32e
commit 2948279fb9
No known key found for this signature in database
GPG Key ID: 92EB5159E403F9D6

@ -289,11 +289,9 @@ 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 // Make sure if Atomic is set, that wait is set as well. This makes it so
// the user doesn't have to specify both // the user doesn't have to specify both
if i.Wait == kube.HookOnlyStrategy { if i.Wait == kube.HookOnlyStrategy && i.Atomic {
if i.Atomic {
i.Wait = kube.StatusWatcherStrategy i.Wait = kube.StatusWatcherStrategy
} }
}
if err := i.cfg.KubeClient.SetWaiter(i.Wait); err != nil { if err := i.cfg.KubeClient.SetWaiter(i.Wait); err != nil {
return nil, fmt.Errorf("failed to set kube client waiter: %w", err) return nil, fmt.Errorf("failed to set kube client waiter: %w", err)
} }

@ -155,11 +155,9 @@ 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 // Make sure if Atomic is set, that wait is set as well. This makes it so
// the user doesn't have to specify both // the user doesn't have to specify both
if u.Wait == kube.HookOnlyStrategy { if u.Wait == kube.HookOnlyStrategy && u.Atomic {
if u.Atomic {
u.Wait = kube.StatusWatcherStrategy u.Wait = kube.StatusWatcherStrategy
} }
}
if err := u.cfg.KubeClient.SetWaiter(u.Wait); err != nil { if err := u.cfg.KubeClient.SetWaiter(u.Wait); err != nil {
return nil, fmt.Errorf("failed to set kube client waiter: %w", err) return nil, fmt.Errorf("failed to set kube client waiter: %w", err)
} }

Loading…
Cancel
Save