parseDevice parses a device mapping string to a container.DeviceMapping struct
(device, serverOS string)
| 1000 | |
| 1001 | // parseDevice parses a device mapping string to a container.DeviceMapping struct |
| 1002 | func parseDevice(device, serverOS string) (container.DeviceMapping, error) { |
| 1003 | switch serverOS { |
| 1004 | case "linux": |
| 1005 | return parseLinuxDevice(device) |
| 1006 | case "windows": |
| 1007 | // Windows doesn't support mapping, so passing the given value as-is. |
| 1008 | return container.DeviceMapping{PathOnHost: device}, nil |
| 1009 | default: |
| 1010 | return container.DeviceMapping{}, fmt.Errorf("unknown server OS: %s", serverOS) |
| 1011 | } |
| 1012 | } |
| 1013 | |
| 1014 | // parseLinuxDevice parses a device mapping string to a container.DeviceMapping struct |
| 1015 | // knowing that the target is a Linux daemon |
no test coverage detected
searching dependent graphs…