MCPcopy
hub / github.com/nektos/act / validateDevice

Function validateDevice

pkg/container/docker_cli.go:1082–1091  ·  view source on GitHub ↗

validateDevice validates a path for devices

(val string, serverOS string)

Source from the content-addressed store, hash-verified

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

Callers 2

parseFunction · 0.85
TestValidateDeviceFunction · 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…