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