Skip to content

Commit

Permalink
Revert "feat(cluster): add check network"
Browse files Browse the repository at this point in the history
This reverts commit 49d1f08.
  • Loading branch information
9547 committed Feb 4, 2021
1 parent 9b2931d commit da10481
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions pkg/cluster/operation/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ var (
CheckNamePortListen = "listening-port"
CheckNameEpoll = "epoll-exclusive"
CheckNameMem = "memory"
CheckNameNet = "network"
CheckNameLimits = "limits"
CheckNameSysService = "service"
CheckNameSELinux = "selinux"
Expand Down Expand Up @@ -136,9 +135,6 @@ func checkSysInfo(opt *CheckOptions, sysInfo *sysinfo.SysInfo) []*CheckResult {
// check memory size
results = append(results, checkMem(opt, &sysInfo.Memory)...)

// check network
results = append(results, checkNetwork(opt, sysInfo.Network)...)

return results
}

Expand Down Expand Up @@ -237,29 +233,6 @@ func checkMem(opt *CheckOptions, memInfo *sysinfo.Memory) []*CheckResult {
return results
}

func checkNetwork(opt *CheckOptions, networkDevices []sysinfo.NetworkDevice) []*CheckResult {
var results []*CheckResult
for _, netdev := range networkDevices {
// ignore the network devices that cannot be detected
if netdev.Speed == 0 {
continue
}
if netdev.Speed > 1000 {
results = append(results, &CheckResult{
Name: CheckNameNet,
Msg: fmt.Sprintf("network speed of %s is %dMB", netdev.Name, netdev.Speed),
})
} else {
results = append(results, &CheckResult{
Name: CheckNameNet,
Err: fmt.Errorf("network speed of %s is %dMB too low, needs 1GB or more", netdev.Name, netdev.Speed),
})
}
}

return results
}

// CheckSysLimits checks limits in /etc/security/limits.conf
func CheckSysLimits(opt *CheckOptions, user string, l []byte) []*CheckResult {
var results []*CheckResult
Expand Down

0 comments on commit da10481

Please sign in to comment.