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

Function validateDockerVersion

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

Source from the content-addressed store, hash-verified

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)
83 major, minor, err := getMajorMinor(version)
84 if err != nil {
85 desc = fmt.Sprintf("Could not parse docker version. %s\n\t", desc)
86 return Unknown, desc
87 }
88 if major < 1 {
89 return Unsupported, desc
90 }
91
92 if major == 1 && minor < 2 {
93 return Supported, desc
94 }
95
96 return Recommended, desc
97}
98
99func getEnabledCgroups() (map[string]int, error) {
100 out, err := os.ReadFile("/proc/cgroups")

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…