@@ -7,18 +7,19 @@ import (
7
7
"strings"
8
8
9
9
"github.com/docker/go-units"
10
+ "github.com/moby/buildkit/frontend/dockerui/types"
10
11
"github.com/moby/buildkit/util/suggest"
11
12
"github.com/pkg/errors"
12
13
)
13
14
14
- type MountType string
15
+ type MountType = types. MountType
15
16
16
17
const (
17
- MountTypeBind MountType = "bind"
18
- MountTypeCache MountType = "cache"
19
- MountTypeTmpfs MountType = "tmpfs"
20
- MountTypeSecret MountType = "secret"
21
- MountTypeSSH MountType = "ssh"
18
+ MountTypeBind = types . MountTypeBind
19
+ MountTypeCache = types . MountTypeCache
20
+ MountTypeTmpfs = types . MountTypeTmpfs
21
+ MountTypeSecret = types . MountTypeSecret
22
+ MountTypeSSH = types . MountTypeSSH
22
23
)
23
24
24
25
var allowedMountTypes = map [MountType ]struct {}{
@@ -29,12 +30,12 @@ var allowedMountTypes = map[MountType]struct{}{
29
30
MountTypeSSH : {},
30
31
}
31
32
32
- type ShareMode string
33
+ type ShareMode = types. ShareMode
33
34
34
35
const (
35
- MountSharingShared ShareMode = "shared"
36
- MountSharingPrivate ShareMode = "private"
37
- MountSharingLocked ShareMode = "locked"
36
+ MountSharingShared = types . MountSharingShared
37
+ MountSharingPrivate = types . MountSharingPrivate
38
+ MountSharingLocked = types . MountSharingLocked
38
39
)
39
40
40
41
var allowedSharingModes = map [ShareMode ]struct {}{
@@ -113,20 +114,7 @@ type mountState struct {
113
114
mounts []* Mount
114
115
}
115
116
116
- type Mount struct {
117
- Type MountType
118
- From string
119
- Source string
120
- Target string
121
- ReadOnly bool
122
- SizeLimit int64
123
- CacheID string
124
- CacheSharing ShareMode
125
- Required bool
126
- Mode * uint64
127
- UID * uint64
128
- GID * uint64
129
- }
117
+ type Mount = types.Mount
130
118
131
119
func parseMount (val string , expander SingleWordExpander ) (* Mount , error ) {
132
120
csvReader := csv .NewReader (strings .NewReader (val ))
0 commit comments