mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to 2f99651
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
40
vendor/github.com/moby/buildkit/client/llb/exec.go
generated
vendored
40
vendor/github.com/moby/buildkit/client/llb/exec.go
generated
vendored
@ -284,6 +284,12 @@ func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
|
||||
|
||||
if len(e.secrets) > 0 {
|
||||
addCap(&e.constraints, pb.CapExecMountSecret)
|
||||
for _, s := range e.secrets {
|
||||
if s.IsEnv {
|
||||
addCap(&e.constraints, pb.CapExecSecretEnv)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(e.ssh) > 0 {
|
||||
@ -369,18 +375,26 @@ func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
|
||||
}
|
||||
|
||||
for _, s := range e.secrets {
|
||||
pm := &pb.Mount{
|
||||
Dest: s.Target,
|
||||
MountType: pb.MountType_SECRET,
|
||||
SecretOpt: &pb.SecretOpt{
|
||||
if s.IsEnv {
|
||||
peo.Secretenv = append(peo.Secretenv, &pb.SecretEnv{
|
||||
ID: s.ID,
|
||||
Uid: uint32(s.UID),
|
||||
Gid: uint32(s.GID),
|
||||
Name: s.Target,
|
||||
Optional: s.Optional,
|
||||
Mode: uint32(s.Mode),
|
||||
},
|
||||
})
|
||||
} else {
|
||||
pm := &pb.Mount{
|
||||
Dest: s.Target,
|
||||
MountType: pb.MountType_SECRET,
|
||||
SecretOpt: &pb.SecretOpt{
|
||||
ID: s.ID,
|
||||
Uid: uint32(s.UID),
|
||||
Gid: uint32(s.GID),
|
||||
Optional: s.Optional,
|
||||
Mode: uint32(s.Mode),
|
||||
},
|
||||
}
|
||||
peo.Mounts = append(peo.Mounts, pm)
|
||||
}
|
||||
peo.Mounts = append(peo.Mounts, pm)
|
||||
}
|
||||
|
||||
for _, s := range e.ssh {
|
||||
@ -661,6 +675,7 @@ type SecretInfo struct {
|
||||
UID int
|
||||
GID int
|
||||
Optional bool
|
||||
IsEnv bool
|
||||
}
|
||||
|
||||
var SecretOptional = secretOptionFunc(func(si *SecretInfo) {
|
||||
@ -673,6 +688,13 @@ func SecretID(id string) SecretOption {
|
||||
})
|
||||
}
|
||||
|
||||
// SecretAsEnv defines if the secret should be added as an environment variable
|
||||
func SecretAsEnv(v bool) SecretOption {
|
||||
return secretOptionFunc(func(si *SecretInfo) {
|
||||
si.IsEnv = v
|
||||
})
|
||||
}
|
||||
|
||||
func SecretFileOpt(uid, gid, mode int) SecretOption {
|
||||
return secretOptionFunc(func(si *SecretInfo) {
|
||||
si.UID = uid
|
||||
|
Reference in New Issue
Block a user