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

Function parseDevice

pkg/container/docker_cli.go:1002–1012  ·  view source on GitHub ↗

parseDevice parses a device mapping string to a container.DeviceMapping struct

(device, serverOS string)

Source from the content-addressed store, hash-verified

1000
1001// parseDevice parses a device mapping string to a container.DeviceMapping struct
1002func 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

Callers 1

parseFunction · 0.85

Calls 1

parseLinuxDeviceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…