MCPcopy Create free account
hub / github.com/containerd/cgroups / hash

Function hash

cgroup2/devicefilter_test.go:27–37  ·  view source on GitHub ↗
(s, comm string)

Source from the content-addressed store, hash-verified

25)
26
27func hash(s, comm string) string {
28 var res []string
29 for _, l := range strings.Split(s, "\n") {
30 trimmed := strings.TrimSpace(l)
31 if trimmed == "" || strings.HasPrefix(trimmed, comm) {
32 continue
33 }
34 res = append(res, trimmed)
35 }
36 return strings.Join(res, "\n")
37}
38
39func testDeviceFilter(t testing.TB, devices []specs.LinuxDeviceCgroup, expectedStr string) {
40 insts, _, err := DeviceFilter(devices)

Callers 1

testDeviceFilterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…