@@ -997,9 +997,11 @@ func parseDevice(device, serverOS string) (container.DeviceMapping, error) {
997997 case "linux" :
998998 return parseLinuxDevice (device )
999999 case "windows" :
1000- return parseWindowsDevice (device )
1000+ // Windows doesn't support mapping, so passing the given value as-is.
1001+ return container.DeviceMapping {PathOnHost : device }, nil
1002+ default :
1003+ return container.DeviceMapping {}, fmt .Errorf ("unknown server OS: %s" , serverOS )
10011004 }
1002- return container.DeviceMapping {}, fmt .Errorf ("unknown server OS: %s" , serverOS )
10031005}
10041006
10051007// parseLinuxDevice parses a device mapping string to a container.DeviceMapping struct
@@ -1030,18 +1032,11 @@ func parseLinuxDevice(device string) (container.DeviceMapping, error) {
10301032 dst = src
10311033 }
10321034
1033- deviceMapping := container.DeviceMapping {
1035+ return container.DeviceMapping {
10341036 PathOnHost : src ,
10351037 PathInContainer : dst ,
10361038 CgroupPermissions : permissions ,
1037- }
1038- return deviceMapping , nil
1039- }
1040-
1041- // parseWindowsDevice parses a device mapping string to a container.DeviceMapping struct
1042- // knowing that the target is a Windows daemon
1043- func parseWindowsDevice (device string ) (container.DeviceMapping , error ) {
1044- return container.DeviceMapping {PathOnHost : device }, nil
1039+ }, nil
10451040}
10461041
10471042// validateDeviceCgroupRule validates a device cgroup rule string format
0 commit comments