From 4925aca04c56aa0f4925613ebc6668af90204571 Mon Sep 17 00:00:00 2001 From: y00841556 Date: Tue, 7 Nov 2023 17:24:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- k8s-mpam-controller/pkg/agent/mpam.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/k8s-mpam-controller/pkg/agent/mpam.go b/k8s-mpam-controller/pkg/agent/mpam.go index 0727857..048757e 100644 --- a/k8s-mpam-controller/pkg/agent/mpam.go +++ b/k8s-mpam-controller/pkg/agent/mpam.go @@ -105,7 +105,7 @@ func cleanResctrlGroup(groups []string) { } for _, fi := range fis { if !fi.IsDir() { - klog.Warning("fi is not a dir") + klog.Warning(fi.Name() + " is not a dir") continue } found := false @@ -214,7 +214,13 @@ func applyConfig(data *configData) { groups := val.(interface{}).(map[string]interface{}) for grp, mpamconf := range groups { if len(grp) > maxGroupnameLen { - klog.Warning("max len of group name is %v", maxGroupnameLen) + klog.Warning("max len of group name is ", maxGroupnameLen) + continue + } + + if mpamconf == nil { + klog.Warning("mpamconf is nil") + mpamGroups = append(mpamGroups, grp) continue } @@ -222,7 +228,7 @@ func applyConfig(data *configData) { for _, v := range rc { rcdata := v.(interface{}).(string) if !checkConfig(rcdata) { - klog.Warning("config %v is not right, please chck config", rcdata) + klog.Errorf("config %v is not right, please chck config", rcdata) continue } updateResctrlGroup(filepath.Join(resctrlRoot, grp), rcdata) @@ -236,9 +242,8 @@ func applyConfig(data *configData) { } if len(mpamGroups) > num_closids { - klog.Warning("The number of groups to be created exceeds the upper limit,"+ + klog.Errorf("The number of groups to be created exceeds the upper limit,"+ "only %v groups can be created", num_closids) - mpamGroups = mpamGroups[:num_closids] } cleanResctrlGroup(mpamGroups) -- Gitee