MCPcopy Index your code
hub / github.com/google/cadvisor / validateKernelVersion

Function validateKernelVersion

validate/validate.go:58–79  ·  view source on GitHub ↗
(version string)

Source from the content-addressed store, hash-verified

56}
57
58func validateKernelVersion(version string) (string, string) {
59 desc := fmt.Sprintf("Kernel version is %s. Versions >= 2.6 are supported. 3.0+ are recommended.\n", version)
60 major, minor, err := getMajorMinor(version)
61 if err != nil {
62 desc = fmt.Sprintf("Could not parse kernel version. %s", desc)
63 return Unknown, desc
64 }
65
66 if major < 2 {
67 return Unsupported, desc
68 }
69
70 if major == 2 && minor < 6 {
71 return Unsupported, desc
72 }
73
74 if major >= 3 {
75 return Recommended, desc
76 }
77
78 return Supported, desc
79}
80
81func validateDockerVersion(version string) (string, string) {
82 desc := fmt.Sprintf("Docker version is %s. Versions >= 1.0 are supported. 1.2+ are recommended.\n", version)

Callers 2

HandleRequestFunction · 0.85

Calls 1

getMajorMinorFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…