fix: return early when err is nil

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-10-11 15:34:12 +08:00
parent 466fd56262
commit 78c40dc20b

View File

@@ -216,8 +216,8 @@ func (r *ReconcileNamespace) checkAndCreateRoles(namespace *corev1.Namespace) er
err = r.Create(context.TODO(), role)
if err != nil {
klog.Error(err)
return err
}
return err
} else {
klog.Error(err)
return err