MCPcopy Index your code
hub / github.com/docker/cli / validateDevice

Function validateDevice

cli/command/container/opts.go:1075–1084  ·  view source on GitHub ↗

validateDevice validates a path for devices

(val string, serverOS string)

Source from the content-addressed store, hash-verified

1073
1074// validateDevice validates a path for devices
1075func validateDevice(val string, serverOS string) (string, error) {
1076 switch serverOS {
1077 case "linux":
1078 return validateLinuxPath(val, validDeviceMode)
1079 case "windows":
1080 // Windows does validation entirely server-side
1081 return val, nil
1082 }
1083 return "", fmt.Errorf("unknown server OS: %s", serverOS)
1084}
1085
1086// validateLinuxPath is the implementation of validateDevice knowing that the
1087// target server operating system is a Linux daemon.

Callers 2

TestValidateDeviceFunction · 0.85
parseFunction · 0.85

Calls 1

validateLinuxPathFunction · 0.85

Tested by 1

TestValidateDeviceFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…