reduced nesting

pull/15868/head
Steven Powell 2023-07-13 13:08:52 -07:00
parent 2792c9b9c9
commit c7ac4a1290
1 changed files with 9 additions and 9 deletions

View File

@ -637,7 +637,9 @@ func VerifyNotPaused(profile string, enable bool) error {
if err != nil { if err != nil {
return errors.Wrap(err, "check paused") return errors.Wrap(err, "check paused")
} }
if runtimePaused { if !runtimePaused {
return nil
}
action := "disable" action := "disable"
if enable { if enable {
action = "enable" action = "enable"
@ -645,6 +647,4 @@ func VerifyNotPaused(profile string, enable bool) error {
msg := fmt.Sprintf("Can't %s addon on a paused cluster, please unpause the cluster first.", action) msg := fmt.Sprintf("Can't %s addon on a paused cluster, please unpause the cluster first.", action)
out.Styled(style.Shrug, msg) out.Styled(style.Shrug, msg)
return errors.New(msg) return errors.New(msg)
}
return nil
} }