vendor: update buildkit to 2f99651

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-02-09 21:53:27 +01:00
parent 60a025b227
commit 307c94e5c7
360 changed files with 13218 additions and 6961 deletions

View File

@ -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