From dbe1c970b329b1562768dfff07c96f4dbe57bbb5 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Wed, 21 Dec 2016 14:08:19 -0700 Subject: [PATCH] ref(tiller): minor style refactor --- pkg/kube/namespace.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pkg/kube/namespace.go b/pkg/kube/namespace.go index 7d18d7913..115c1139c 100644 --- a/pkg/kube/namespace.go +++ b/pkg/kube/namespace.go @@ -37,14 +37,9 @@ func getNamespace(client internalclientset.Interface, namespace string) (*api.Na } func ensureNamespace(client internalclientset.Interface, namespace string) error { - if _, getError := getNamespace(client, namespace); getError != nil && errors.IsNotFound(getError) { - createError := createNamespace(client, namespace) - if createError != nil { - return createError - } - } else if getError != nil { - return getError + _, err := getNamespace(client, namespace) + if err != nil && errors.IsNotFound(err) { + return createNamespace(client, namespace) } - - return nil + return err }