From 36c76ae8f1e6eae87d4e0774d298be65a9fadfdc Mon Sep 17 00:00:00 2001 From: fengjianqing <1416100064@qq.com> Date: Mon, 23 Sep 2024 14:33:20 +0800 Subject: [PATCH 1/7] =?UTF-8?q?cleanCode=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/common/constants.go | 11 ++++---- pkg/common/fault_code.go | 4 +-- pkg/common/fault_code_test.go | 9 +++--- pkg/common/slice_common_test.go | 3 +- pkg/device/ascendcommon_test.go | 50 ++++++++++++++++++--------------- 5 files changed, 43 insertions(+), 34 deletions(-) diff --git a/pkg/common/constants.go b/pkg/common/constants.go index cf121aa6..d1c91bc6 100644 --- a/pkg/common/constants.go +++ b/pkg/common/constants.go @@ -461,7 +461,7 @@ const ( // RootGID is root group id RootGID = 0 - // KeySliceLengthCheck is the length of key slice check + // KeySliceLength KeySliceLengthCheck is the length of key slice check KeySliceLength = 2 // DotSepDev if the separator between devices on labels @@ -484,9 +484,9 @@ const ( EdgeScene = "edge" // A300IA2BoardId board id of A300I A2 A300IA2BoardId = 0x28 - // A800IA2NoneHccsBoardId is the boardid of a800i a2 device,0x33 is server without hccs + // A800IA2NoneHccsBoardIdOld A800IA2NoneHccsBoardId is the boardid of a800i a2 device,0x33 is server without hccs A800IA2NoneHccsBoardIdOld = 0x33 - //0x33 changed to 0x3c , and compatible with the old boardId ,since 2024.9.4 + // A800IA2NoneHccsBoardId 0x33 changed to 0x3c , and compatible with the old boardId ,since 2024.9.4 A800IA2NoneHccsBoardId = 0x3c // EmptyBoardId is the boardid of device before initialized EmptyBoardId = 0x00 @@ -512,7 +512,7 @@ const ( HotResetClose = -1 // HotResetInfer using infer chip hot reset HotResetInfer = 0 - // HotResetTrainOnline using train chip hot reset online + // HotResetTrainOnLine using train chip hot reset online HotResetTrainOnLine = 1 // HotResetTrainOffLine using train chip hot reset offline HotResetTrainOffLine = 2 @@ -779,7 +779,8 @@ const ( const ( // HbmDoubleBitFaultCode indicate 0x80E01801 - HbmDoubleBitFaultCode = 2162169857 + HbmDoubleBitFaultCode = 2162169857 + // HbmDoubleBitFaultCodeStr indicate 80E01801 HbmDoubleBitFaultCodeStr = "80E01801" // AivBusFaultCode indicate 0x80CB8009 AivBusFaultCode = 2160820233 diff --git a/pkg/common/fault_code.go b/pkg/common/fault_code.go index de6a4443..10c53535 100644 --- a/pkg/common/fault_code.go +++ b/pkg/common/fault_code.go @@ -322,7 +322,7 @@ func (h *HbmFaultManager) aicFaultEventInQue(faultInfo common.DevFaultInfo) { } func (h *HbmFaultManager) aicFaultEventOutQue(logicId int32) []common.DevFaultInfo { - var faultInfoList []common.DevFaultInfo + faultInfoList := make([]common.DevFaultInfo, 0) faultEventQue, ok := h.AicFaultEventQue[logicId] if !ok { return faultInfoList @@ -330,7 +330,7 @@ func (h *HbmFaultManager) aicFaultEventOutQue(logicId int32) []common.DevFaultIn if _, ok := h.HbmOccurTimeCache[logicId]; !ok { h.HbmOccurTimeCache[logicId] = 0 } - var newFaultEventQue []common.DevFaultInfo + newFaultEventQue := make([]common.DevFaultInfo, 0) nowTime := time.Now().Unix() for i := 0; i < len(faultEventQue); i++ { // The fault aic error occurring ten seconds before and after the occurrence of hbm error should be deleted, diff --git a/pkg/common/fault_code_test.go b/pkg/common/fault_code_test.go index 28507d39..855a27d3 100644 --- a/pkg/common/fault_code_test.go +++ b/pkg/common/fault_code_test.go @@ -1576,6 +1576,7 @@ func TestLoadSwitchFaultCode(t *testing.T) { // TestHbmFaultManager Test HbmFaultManager func TestHbmFaultManager(t *testing.T) { + var fakeAlarmRaisedTime int64 = 123456789 convey.Convey("test new fault manager", t, func() { hbmFaultManager := NewHbmFaultManager() convey.So(hbmFaultManager, convey.ShouldNotBeNil) @@ -1585,25 +1586,25 @@ func TestHbmFaultManager(t *testing.T) { faultInfo := common.DevFaultInfo{ LogicID: 1, EventID: HbmDoubleBitFaultCode, - AlarmRaisedTime: 123456789, + AlarmRaisedTime: fakeAlarmRaisedTime, } hbmFaultManager.updateHbmOccurTime(faultInfo) hbmOccurTime, ok := hbmFaultManager.HbmOccurTimeCache[1] convey.So(ok, convey.ShouldBeTrue) - convey.So(hbmOccurTime, convey.ShouldEqual, 123456789) + convey.So(hbmOccurTime, convey.ShouldEqual, fakeAlarmRaisedTime) }) convey.Convey("test fault event in que ", t, func() { hbmFaultManager := NewHbmFaultManager() faultInfo := common.DevFaultInfo{ LogicID: 1, EventID: AivBusFaultCode, - AlarmRaisedTime: 123456789, + AlarmRaisedTime: fakeAlarmRaisedTime, } hbmFaultManager.aicFaultEventInQue(faultInfo) faultInfoList, ok := hbmFaultManager.AicFaultEventQue[1] convey.So(ok, convey.ShouldBeTrue) convey.So(len(faultInfoList), convey.ShouldEqual, 1) - convey.So(faultInfoList[0].AlarmRaisedTime, convey.ShouldEqual, 123456789) + convey.So(faultInfoList[0].AlarmRaisedTime, convey.ShouldEqual, fakeAlarmRaisedTime) }) convey.Convey("test fault event in que ", t, func() { hbmFaultManager := NewHbmFaultManager() diff --git a/pkg/common/slice_common_test.go b/pkg/common/slice_common_test.go index ad1c9203..500bc21c 100644 --- a/pkg/common/slice_common_test.go +++ b/pkg/common/slice_common_test.go @@ -24,6 +24,7 @@ import ( var ( testInt64Source = []int64{1} stringSource = []string{"1"} + testResult = 2 ) // TestContains for test Contains @@ -138,6 +139,6 @@ func TestInt64ToolAbs(t *testing.T) { convey.Convey("test int64Tool.Abs case negative number", t, func() { tool := int64Tool{} testVal1, testVal2 := int64(1), int64(-1) - convey.So(tool.Abs(testVal1, testVal2), convey.ShouldEqual, 2) + convey.So(tool.Abs(testVal1, testVal2), convey.ShouldEqual, testResult) }) } diff --git a/pkg/device/ascendcommon_test.go b/pkg/device/ascendcommon_test.go index 19caef24..bcc49e65 100644 --- a/pkg/device/ascendcommon_test.go +++ b/pkg/device/ascendcommon_test.go @@ -164,28 +164,6 @@ func TestAddPodAnnotation1(t *testing.T) { }, common.Ascend310Pc2, "", nil) convey.So(err, convey.ShouldBeNil) }) - convey.Convey("ParseInt failed", func() { - tool.name = common.Ascend910 - err := tool.AddPodAnnotation(&common.PodDeviceInfo{ - Pod: v1.Pod{}, - KltDevice: nil, - RealDevice: []string{common.Ascend910 + "-a"}, - }, common.Ascend910, "", nil) - convey.So(err, convey.ShouldNotBeNil) - }) - convey.Convey("GetLogicIDFromPhysicID failed", func() { - mockGetLogicIDFromPhysicID := gomonkey.ApplyMethod(reflect.TypeOf(new(devmanager.DeviceManagerMock)), - "GetLogicIDFromPhysicID", func(_ *devmanager.DeviceManagerMock, physicID int32) (int32, error) { - return 0, fmt.Errorf("error") - }) - defer mockGetLogicIDFromPhysicID.Reset() - err := tool.AddPodAnnotation(&common.PodDeviceInfo{ - Pod: v1.Pod{}, - KltDevice: nil, - RealDevice: []string{common.Ascend910 + "-0"}, - }, common.Ascend910, "", nil) - convey.So(err, convey.ShouldNotBeNil) - }) }) } @@ -236,6 +214,34 @@ func TestAddPodAnnotation2(t *testing.T) { }) } +// TestAddPodAnnotation3 for test the interface AddPodAnnotation, part 3 +func TestAddPodAnnotation3(t *testing.T) { + tool := AscendTools{name: common.Ascend910, client: &kubeclient.ClientK8s{}, + dmgr: &devmanager.DeviceManagerMock{}} + convey.Convey("GetLogicIDFromPhysicID failed", func() { + mockGetLogicIDFromPhysicID := gomonkey.ApplyMethod(reflect.TypeOf(new(devmanager.DeviceManagerMock)), + "GetLogicIDFromPhysicID", func(_ *devmanager.DeviceManagerMock, physicID int32) (int32, error) { + return 0, fmt.Errorf("error") + }) + defer mockGetLogicIDFromPhysicID.Reset() + err := tool.AddPodAnnotation(&common.PodDeviceInfo{ + Pod: v1.Pod{}, + KltDevice: nil, + RealDevice: []string{common.Ascend910 + "-0"}, + }, common.Ascend910, "", nil) + convey.So(err, convey.ShouldNotBeNil) + }) + convey.Convey("ParseInt failed", func() { + tool.name = common.Ascend910 + err := tool.AddPodAnnotation(&common.PodDeviceInfo{ + Pod: v1.Pod{}, + KltDevice: nil, + RealDevice: []string{common.Ascend910 + "-a"}, + }, common.Ascend910, "", nil) + convey.So(err, convey.ShouldNotBeNil) + }) +} + // TestCreateVirtualDevice testCreateVirtualDevice func TestCreateVirtualDevice(t *testing.T) { tool := AscendTools{name: common.Ascend310P, client: &kubeclient.ClientK8s{}, -- Gitee From 5c972e8c69aa2c92fa34e3d3f46db53ff5408919 Mon Sep 17 00:00:00 2001 From: fengjianqing <1416100064@qq.com> Date: Mon, 23 Sep 2024 14:37:52 +0800 Subject: [PATCH 2/7] =?UTF-8?q?cleanCode=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 554f9dff..a22a3345 100644 --- a/go.mod +++ b/go.mod @@ -75,7 +75,7 @@ require ( replace ( github.com/containernetworking/cni => github.com/containernetworking/cni v0.8.1 github.com/gorilla/websocket => github.com/gorilla/websocket v1.4.2 - huawei.com/npu-exporter/v6 => gitee.com/ascend/ascend-npu-exporter/v6 v6.0.0-RC3.b001 + huawei.com/npu-exporter/v6 => gitee.com/ascend/ascend-npu-exporter/v6 v6.0.0-RC3.b002 k8s.io/api => k8s.io/api v0.25.13 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.13 k8s.io/apimachinery => k8s.io/apimachinery v0.25.13 diff --git a/go.sum b/go.sum index 9199a47f..6cc9a689 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -gitee.com/ascend/ascend-npu-exporter/v6 v6.0.0-RC3.b001 h1:qO/rapWPJMHUdZ15a0qv07+Dn4KQJyWmlxxt4q8Nk2E= -gitee.com/ascend/ascend-npu-exporter/v6 v6.0.0-RC3.b001/go.mod h1:tQw2ukw5YzlXWJa5cDfY8TNcTiBieor69lsdHFEiMZ8= +gitee.com/ascend/ascend-npu-exporter/v6 v6.0.0-RC3.b002 h1:iNi4Yyj90/pWmKJ+kzHVq1knqrYiFPGikvd6DnuPYv8= +gitee.com/ascend/ascend-npu-exporter/v6 v6.0.0-RC3.b002/go.mod h1:tQw2ukw5YzlXWJa5cDfY8TNcTiBieor69lsdHFEiMZ8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.4.17 h1:iT12IBVClFevaf8PuVyi3UmZOVh4OqnaLxDTW2O6j3w= github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -- Gitee From 437997b371f3eb328749e3c037174e3130e7ca35 Mon Sep 17 00:00:00 2001 From: fengjianqing <1416100064@qq.com> Date: Mon, 23 Sep 2024 19:01:52 +0800 Subject: [PATCH 3/7] =?UTF-8?q?cleanCode=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/device/ascendcommon_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/device/ascendcommon_test.go b/pkg/device/ascendcommon_test.go index bcc49e65..fd0769f1 100644 --- a/pkg/device/ascendcommon_test.go +++ b/pkg/device/ascendcommon_test.go @@ -218,6 +218,12 @@ func TestAddPodAnnotation2(t *testing.T) { func TestAddPodAnnotation3(t *testing.T) { tool := AscendTools{name: common.Ascend910, client: &kubeclient.ClientK8s{}, dmgr: &devmanager.DeviceManagerMock{}} + mockTryUpdatePodAnnotation := gomonkey.ApplyMethod(reflect.TypeOf(new(kubeclient.ClientK8s)), + "TryUpdatePodAnnotation", func(_ *kubeclient.ClientK8s, pod *v1.Pod, + annotation map[string]string) error { + return nil + }) + defer mockTryUpdatePodAnnotation.Reset() convey.Convey("GetLogicIDFromPhysicID failed", func() { mockGetLogicIDFromPhysicID := gomonkey.ApplyMethod(reflect.TypeOf(new(devmanager.DeviceManagerMock)), "GetLogicIDFromPhysicID", func(_ *devmanager.DeviceManagerMock, physicID int32) (int32, error) { -- Gitee From 7898b2d7edbf342282f22c9f679044c3db81cc5f Mon Sep 17 00:00:00 2001 From: fengjianqing <1416100064@qq.com> Date: Mon, 23 Sep 2024 19:08:50 +0800 Subject: [PATCH 4/7] =?UTF-8?q?cleanCode=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/device/ascendcommon_test.go | 54 +++++++++++++++++---------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/pkg/device/ascendcommon_test.go b/pkg/device/ascendcommon_test.go index fd0769f1..481ddea7 100644 --- a/pkg/device/ascendcommon_test.go +++ b/pkg/device/ascendcommon_test.go @@ -218,33 +218,35 @@ func TestAddPodAnnotation2(t *testing.T) { func TestAddPodAnnotation3(t *testing.T) { tool := AscendTools{name: common.Ascend910, client: &kubeclient.ClientK8s{}, dmgr: &devmanager.DeviceManagerMock{}} - mockTryUpdatePodAnnotation := gomonkey.ApplyMethod(reflect.TypeOf(new(kubeclient.ClientK8s)), - "TryUpdatePodAnnotation", func(_ *kubeclient.ClientK8s, pod *v1.Pod, - annotation map[string]string) error { - return nil - }) - defer mockTryUpdatePodAnnotation.Reset() - convey.Convey("GetLogicIDFromPhysicID failed", func() { - mockGetLogicIDFromPhysicID := gomonkey.ApplyMethod(reflect.TypeOf(new(devmanager.DeviceManagerMock)), - "GetLogicIDFromPhysicID", func(_ *devmanager.DeviceManagerMock, physicID int32) (int32, error) { - return 0, fmt.Errorf("error") + convey.Convey("test AddPodAnnotation 2", t, func() { + mockTryUpdatePodAnnotation := gomonkey.ApplyMethod(reflect.TypeOf(new(kubeclient.ClientK8s)), + "TryUpdatePodAnnotation", func(_ *kubeclient.ClientK8s, pod *v1.Pod, + annotation map[string]string) error { + return nil }) - defer mockGetLogicIDFromPhysicID.Reset() - err := tool.AddPodAnnotation(&common.PodDeviceInfo{ - Pod: v1.Pod{}, - KltDevice: nil, - RealDevice: []string{common.Ascend910 + "-0"}, - }, common.Ascend910, "", nil) - convey.So(err, convey.ShouldNotBeNil) - }) - convey.Convey("ParseInt failed", func() { - tool.name = common.Ascend910 - err := tool.AddPodAnnotation(&common.PodDeviceInfo{ - Pod: v1.Pod{}, - KltDevice: nil, - RealDevice: []string{common.Ascend910 + "-a"}, - }, common.Ascend910, "", nil) - convey.So(err, convey.ShouldNotBeNil) + defer mockTryUpdatePodAnnotation.Reset() + convey.Convey("GetLogicIDFromPhysicID failed", func() { + mockGetLogicIDFromPhysicID := gomonkey.ApplyMethod(reflect.TypeOf(new(devmanager.DeviceManagerMock)), + "GetLogicIDFromPhysicID", func(_ *devmanager.DeviceManagerMock, physicID int32) (int32, error) { + return 0, fmt.Errorf("error") + }) + defer mockGetLogicIDFromPhysicID.Reset() + err := tool.AddPodAnnotation(&common.PodDeviceInfo{ + Pod: v1.Pod{}, + KltDevice: nil, + RealDevice: []string{common.Ascend910 + "-0"}, + }, common.Ascend910, "", nil) + convey.So(err, convey.ShouldNotBeNil) + }) + convey.Convey("ParseInt failed", func() { + tool.name = common.Ascend910 + err := tool.AddPodAnnotation(&common.PodDeviceInfo{ + Pod: v1.Pod{}, + KltDevice: nil, + RealDevice: []string{common.Ascend910 + "-a"}, + }, common.Ascend910, "", nil) + convey.So(err, convey.ShouldNotBeNil) + }) }) } -- Gitee From e8a661c4995b6d10a8586a18498b6a079f1cd0e7 Mon Sep 17 00:00:00 2001 From: fengjianqing <1416100064@qq.com> Date: Mon, 23 Sep 2024 19:08:59 +0800 Subject: [PATCH 5/7] =?UTF-8?q?cleanCode=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/device/ascendcommon_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/device/ascendcommon_test.go b/pkg/device/ascendcommon_test.go index 481ddea7..bc057195 100644 --- a/pkg/device/ascendcommon_test.go +++ b/pkg/device/ascendcommon_test.go @@ -218,7 +218,7 @@ func TestAddPodAnnotation2(t *testing.T) { func TestAddPodAnnotation3(t *testing.T) { tool := AscendTools{name: common.Ascend910, client: &kubeclient.ClientK8s{}, dmgr: &devmanager.DeviceManagerMock{}} - convey.Convey("test AddPodAnnotation 2", t, func() { + convey.Convey("test AddPodAnnotation 3", t, func() { mockTryUpdatePodAnnotation := gomonkey.ApplyMethod(reflect.TypeOf(new(kubeclient.ClientK8s)), "TryUpdatePodAnnotation", func(_ *kubeclient.ClientK8s, pod *v1.Pod, annotation map[string]string) error { -- Gitee From c7d5cfdcb71fea2fa5ff7be7323e50d21eca6950 Mon Sep 17 00:00:00 2001 From: fengjianqing <1416100064@qq.com> Date: Mon, 23 Sep 2024 19:48:21 +0800 Subject: [PATCH 6/7] =?UTF-8?q?cleanCode=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/common/fault_code.go | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/pkg/common/fault_code.go b/pkg/common/fault_code.go index 10c53535..7ca39496 100644 --- a/pkg/common/fault_code.go +++ b/pkg/common/fault_code.go @@ -978,26 +978,14 @@ func SetNewFaultAndCacheOnceRecoverFault(logicID int32, faultInfos []common.DevF hwlog.RunLog.Error("param device is nil in SetNewFaultAndCacheOnceRecoverFault") return } - + newFaultInfos := faultInfos if _, ok := faultDurationMap[HbmDoubleBitFaultCodeStr]; ok { - var newFaultInfos []common.DevFaultInfo - // dealing with Hbm and Aic/Aiv associated faults - for i := 0; i < len(faultInfos); i++ { - if faultInfos[i].EventID == HbmDoubleBitFaultCode && faultInfos[i].Assertion != common.FaultRecover { - hbmTool.updateHbmOccurTime(faultInfos[i]) - } - if faultInfos[i].EventID == AicBusFaultCode || faultInfos[i].EventID == AivBusFaultCode { - hbmTool.aicFaultEventInQue(faultInfos[i]) - continue - } - newFaultInfos = append(newFaultInfos, faultInfos[i]) - } - faultInfos = append(newFaultInfos, hbmTool.aicFaultEventOutQue(logicID)...) + newFaultInfos = newFaultInfosForHBMErr(logicID, faultInfos) } // it must deal with two 'for', because the fault may recover one moment, in this case, // the recover message and occur message both in faultInfos, this fault cannot be reports outside. - for _, faultInfo := range faultInfos { + for _, faultInfo := range newFaultInfos { if NetworkFaultCodes.Has(faultInfo.EventID) { continue } @@ -1012,7 +1000,7 @@ func SetNewFaultAndCacheOnceRecoverFault(logicID int32, faultInfos []common.DevF recoverFaultMap[logicID] = append(recoverFaultMap[logicID], faultInfo.EventID) } } - for _, faultInfo := range faultInfos { + for _, faultInfo := range newFaultInfos { if NetworkFaultCodes.Has(faultInfo.EventID) { continue } @@ -1040,6 +1028,22 @@ func SetNetworkNewFaultAndCacheOnceRecoverFault(logicID int32, faultInfos []comm setNetworkAlarmRaisedTime(device) } +func newFaultInfosForHBMErr(logicID int32, faultInfos []common.DevFaultInfo) []common.DevFaultInfo { + var newFaultInfos []common.DevFaultInfo + // dealing with Hbm and Aic/Aiv associated faults + for i := 0; i < len(faultInfos); i++ { + if faultInfos[i].EventID == HbmDoubleBitFaultCode && faultInfos[i].Assertion != common.FaultRecover { + hbmTool.updateHbmOccurTime(faultInfos[i]) + } + if faultInfos[i].EventID == AicBusFaultCode || faultInfos[i].EventID == AivBusFaultCode { + hbmTool.aicFaultEventInQue(faultInfos[i]) + continue + } + newFaultInfos = append(newFaultInfos, faultInfos[i]) + } + return append(newFaultInfos, hbmTool.aicFaultEventOutQue(logicID)...) +} + func networkFaultRecoverAndFaultOnceHandle(logicID int32, faultInfos []common.DevFaultInfo, device *NpuDevice) { for _, faultInfo := range faultInfos { if !NetworkFaultCodes.Has(faultInfo.EventID) { -- Gitee From 43ba04ea1e3981805fc79bed3103ce0a4507ea59 Mon Sep 17 00:00:00 2001 From: fengjianqing <1416100064@qq.com> Date: Tue, 24 Sep 2024 17:07:16 +0800 Subject: [PATCH 7/7] =?UTF-8?q?cleanCode=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/common/constants.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/common/constants.go b/pkg/common/constants.go index b2a24dbb..97608a71 100644 --- a/pkg/common/constants.go +++ b/pkg/common/constants.go @@ -461,7 +461,7 @@ const ( // RootGID is root group id RootGID = 0 - // KeySliceLength KeySliceLengthCheck is the length of key slice check + // KeySliceLength is the length of key slice check KeySliceLength = 2 // DotSepDev if the separator between devices on labels @@ -484,7 +484,7 @@ const ( EdgeScene = "edge" // A300IA2BoardId board id of A300I A2 A300IA2BoardId = 0x28 - // A800IA2NoneHccsBoardIdOld A800IA2NoneHccsBoardId is the boardid of a800i a2 device,0x33 is server without hccs + // A800IA2NoneHccsBoardIdOld is the boardid of a800i a2 device,0x33 is server without hccs A800IA2NoneHccsBoardIdOld = 0x33 // A800IA2NoneHccsBoardId 0x33 changed to 0x3c , and compatible with the old boardId ,since 2024.9.4 A800IA2NoneHccsBoardId = 0x3c -- Gitee