From 19920acfb3a7d55ba5c7c81cf2364cca91ad6327 Mon Sep 17 00:00:00 2001 From: Garrybest Date: Fri, 19 Nov 2021 09:59:01 +0800 Subject: [PATCH] fix issue of scheduler-estimator exit Signed-off-by: Garrybest --- cmd/scheduler-estimator/app/scheduler-estimator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/scheduler-estimator/app/scheduler-estimator.go b/cmd/scheduler-estimator/app/scheduler-estimator.go index 052d3b9d5..8e63db17d 100644 --- a/cmd/scheduler-estimator/app/scheduler-estimator.go +++ b/cmd/scheduler-estimator/app/scheduler-estimator.go @@ -27,8 +27,8 @@ func NewSchedulerEstimatorCommand(ctx context.Context) *cobra.Command { Long: `The karmada scheduler estimator runs an accurate scheduler estimator of a cluster`, RunE: func(cmd *cobra.Command, args []string) error { // validate options - if err := opts.Validate(); err != nil { - return err.ToAggregate() + if errs := opts.Validate(); len(errs) != 0 { + return errs.ToAggregate() } if err := run(ctx, opts); err != nil { return err