From 6dd4f0ac10bbf56e39726aafae9f9f64b7d26e44 Mon Sep 17 00:00:00 2001 From: Listson <1148576125@qq.com> Date: Fri, 15 Apr 2022 22:14:28 +0800 Subject: [PATCH] fix: remove unnecessary exception judgments --- pkg/controllers/statefulapp/core/pod_controller.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/controllers/statefulapp/core/pod_controller.go b/pkg/controllers/statefulapp/core/pod_controller.go index 5b70e88af..46da09781 100644 --- a/pkg/controllers/statefulapp/core/pod_controller.go +++ b/pkg/controllers/statefulapp/core/pod_controller.go @@ -110,14 +110,12 @@ func (ctrl *PodCtrl) CreatePod(subset cloudv1.Subset) error { } // update status - if err == nil { - err = UpdateStatus(ctrl.Resource, ctrl.StatefulApp) - if err != nil { - return err - } + err = UpdateStatus(ctrl.Resource, ctrl.StatefulApp) + if err != nil { + return err } - return err + return nil } func (ctrl *PodCtrl) GetPodsByLables(namespace string, listOption client.ListOption) []corev1.Pod {