Skip to content

Commit c7ac4a1

Browse files
committed
reduced nesting
1 parent 2792c9b commit c7ac4a1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pkg/addons/addons.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -637,14 +637,14 @@ func VerifyNotPaused(profile string, enable bool) error {
637637
if err != nil {
638638
return errors.Wrap(err, "check paused")
639639
}
640-
if runtimePaused {
641-
action := "disable"
642-
if enable {
643-
action = "enable"
644-
}
645-
msg := fmt.Sprintf("Can't %s addon on a paused cluster, please unpause the cluster first.", action)
646-
out.Styled(style.Shrug, msg)
647-
return errors.New(msg)
640+
if !runtimePaused {
641+
return nil
648642
}
649-
return nil
643+
action := "disable"
644+
if enable {
645+
action = "enable"
646+
}
647+
msg := fmt.Sprintf("Can't %s addon on a paused cluster, please unpause the cluster first.", action)
648+
out.Styled(style.Shrug, msg)
649+
return errors.New(msg)
650650
}

0 commit comments

Comments
 (0)