mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: github.com/moby/buildkit db304eb93126 (v0.13.0-dev)
full diff: d6e142600e...db304eb931
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
26
vendor/github.com/moby/buildkit/client/llb/exec.go
generated
vendored
26
vendor/github.com/moby/buildkit/client/llb/exec.go
generated
vendored
@ -46,6 +46,7 @@ type mount struct {
|
||||
tmpfsOpt TmpfsInfo
|
||||
cacheSharing CacheMountSharingMode
|
||||
noOutput bool
|
||||
contentCache MountContentCache
|
||||
}
|
||||
|
||||
type ExecOp struct {
|
||||
@ -281,6 +282,9 @@ func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
|
||||
} else if m.source != nil {
|
||||
addCap(&e.constraints, pb.CapExecMountBind)
|
||||
}
|
||||
if m.contentCache != MountContentCacheDefault {
|
||||
addCap(&e.constraints, pb.CapExecMountContentCache)
|
||||
}
|
||||
}
|
||||
|
||||
if len(e.secrets) > 0 {
|
||||
@ -366,6 +370,14 @@ func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
|
||||
pm.CacheOpt.Sharing = pb.CacheSharingOpt_LOCKED
|
||||
}
|
||||
}
|
||||
switch m.contentCache {
|
||||
case MountContentCacheDefault:
|
||||
pm.ContentCache = pb.MountContentCache_DEFAULT
|
||||
case MountContentCacheOn:
|
||||
pm.ContentCache = pb.MountContentCache_ON
|
||||
case MountContentCacheOff:
|
||||
pm.ContentCache = pb.MountContentCache_OFF
|
||||
}
|
||||
if m.tmpfs {
|
||||
pm.MountType = pb.MountType_TMPFS
|
||||
pm.TmpfsOpt = &pb.TmpfsOpt{
|
||||
@ -492,6 +504,12 @@ func ForceNoOutput(m *mount) {
|
||||
m.noOutput = true
|
||||
}
|
||||
|
||||
func ContentCache(cache MountContentCache) MountOption {
|
||||
return func(m *mount) {
|
||||
m.contentCache = cache
|
||||
}
|
||||
}
|
||||
|
||||
func AsPersistentCacheDir(id string, sharing CacheMountSharingMode) MountOption {
|
||||
return func(m *mount) {
|
||||
m.cacheID = id
|
||||
@ -783,3 +801,11 @@ const (
|
||||
UlimitSigpending UlimitName = "sigpending"
|
||||
UlimitStack UlimitName = "stack"
|
||||
)
|
||||
|
||||
type MountContentCache int
|
||||
|
||||
const (
|
||||
MountContentCacheDefault MountContentCache = iota
|
||||
MountContentCacheOn
|
||||
MountContentCacheOff
|
||||
)
|
||||
|
Reference in New Issue
Block a user