Skip to content

Commit 3cd6afe

Browse files
scottrigbygjenkins8
andcommitted
add short circuit return
Co-authored-by: George Jenkins <gvjenkins@gmail.com> Signed-off-by: Scott Rigby <scott@r6by.com>
1 parent 5367001 commit 3cd6afe

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pkg/action/hooks.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ func hookHasDeletePolicy(h *release.Hook, policy release.HookDeletePolicy) bool
181181

182182
// outputLogsByPolicy outputs a pods logs if the hook policy instructs it to
183183
func (cfg *Configuration) outputLogsByPolicy(h *release.Hook, releaseNamespace string, policy release.HookOutputLogPolicy) error {
184-
if hookHasOutputLogPolicy(h, policy) {
184+
if !hookHasOutputLogPolicy(h, policy) {
185+
return nil
186+
}
185187
namespace, err := cfg.deriveNamespace(h, releaseNamespace)
186188
if err != nil {
187189
return err

0 commit comments

Comments
 (0)