Skip to content

Commit

Permalink
Merge b4938c6 into 54ac4d5
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis authored May 6, 2021
2 parents 54ac4d5 + b4938c6 commit 93fff2a
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions pkg/cluster/operation/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,35 @@ func checkOSInfo(opt *CheckOptions, osInfo *sysinfo.OS) *CheckResult {

// check OS vendor
switch osInfo.Vendor {
case "centos", "redhat":
case "centos", "redhat", "rhel":
// check version
if ver, _ := strconv.Atoi(osInfo.Version); ver < 7 {
result.Err = fmt.Errorf("%s %s not supported, use version 7 or higher",
osInfo.Name, osInfo.Release)
return result
}
case "debian", "ubuntu":
// check version
case "debian":
// debian support is not fully tested, but we suppose it should work
msg := "debian support is not fully tested, be careful"
result.Err = fmt.Errorf("%s (%s)", result.Msg, msg)
result.Warn = true
if ver, _ := strconv.Atoi(osInfo.Version); ver < 9 {
result.Err = fmt.Errorf("%s %s not supported, use version 9 or higher (%s)",
osInfo.Name, osInfo.Release, msg)
result.Warn = false
return result
}
case "ubuntu":
// ubuntu support is not fully tested, but we suppose it should work
msg := "ubuntu support is not fully tested, be careful"
result.Err = fmt.Errorf("%s (%s)", result.Msg, msg)
result.Warn = true
if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 18.04 {
result.Err = fmt.Errorf("%s %s not supported, use version 18.04 or higher (%s)",
osInfo.Name, osInfo.Release, msg)
result.Warn = false
return result
}
default:
result.Err = fmt.Errorf("os vendor %s not supported", osInfo.Vendor)
return result
Expand Down

0 comments on commit 93fff2a

Please sign in to comment.