summaryrefslogtreecommitdiff
path: root/pkg/spec/parse.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-10-30 10:12:40 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2018-10-30 10:12:40 -0500
commitdcb68d1aa24b2dd00d793f5a66f96cc5403b43c3 (patch)
tree230cc7586cf8d333680f27b915a65cf587e72a6b /pkg/spec/parse.go
parenteb4c2035aef32fd7f0037bbea0447205fcd29d33 (diff)
parentce24ce7c530f8fb0354d3af7b394240a3915b733 (diff)
downloadpodman-dcb68d1aa24b2dd00d793f5a66f96cc5403b43c3.tar.gz
podman-dcb68d1aa24b2dd00d793f5a66f96cc5403b43c3.tar.bz2
podman-dcb68d1aa24b2dd00d793f5a66f96cc5403b43c3.zip
Merge branch 'master' of github.com:containers/libpod into vendor
Diffstat (limited to 'pkg/spec/parse.go')
-rw-r--r--pkg/spec/parse.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/spec/parse.go b/pkg/spec/parse.go
index 9b2dd1347..4d20e35d4 100644
--- a/pkg/spec/parse.go
+++ b/pkg/spec/parse.go
@@ -148,21 +148,21 @@ func getLoggingPath(opts []string) string {
return ""
}
-// parseDevice parses device mapping string to a src, dest & permissions string
-func parseDevice(device string) (string, string, string, error) { //nolint
+// ParseDevice parses device mapping string to a src, dest & permissions string
+func ParseDevice(device string) (string, string, string, error) { //nolint
src := ""
dst := ""
permissions := "rwm"
arr := strings.Split(device, ":")
switch len(arr) {
case 3:
- if !validDeviceMode(arr[2]) {
+ if !IsValidDeviceMode(arr[2]) {
return "", "", "", fmt.Errorf("invalid device mode: %s", arr[2])
}
permissions = arr[2]
fallthrough
case 2:
- if validDeviceMode(arr[1]) {
+ if IsValidDeviceMode(arr[1]) {
permissions = arr[1]
} else {
if arr[1][0] != '/' {
@@ -183,9 +183,9 @@ func parseDevice(device string) (string, string, string, error) { //nolint
return src, dst, permissions, nil
}
-// validDeviceMode checks if the mode for device is valid or not.
-// Valid mode is a composition of r (read), w (write), and m (mknod).
-func validDeviceMode(mode string) bool {
+// IsValidDeviceMode checks if the mode for device is valid or not.
+// IsValid mode is a composition of r (read), w (write), and m (mknod).
+func IsValidDeviceMode(mode string) bool {
var legalDeviceMode = map[rune]bool{
'r': true,
'w': true,