mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
62
vendor/github.com/moby/buildkit/client/llb/meta.go
generated
vendored
62
vendor/github.com/moby/buildkit/client/llb/meta.go
generated
vendored
@ -18,12 +18,15 @@ var (
|
||||
keyArgs = contextKeyT("llb.exec.args")
|
||||
keyDir = contextKeyT("llb.exec.dir")
|
||||
keyEnv = contextKeyT("llb.exec.env")
|
||||
keyUser = contextKeyT("llb.exec.user")
|
||||
keyHostname = contextKeyT("llb.exec.hostname")
|
||||
keyExtraHost = contextKeyT("llb.exec.extrahost")
|
||||
keyPlatform = contextKeyT("llb.platform")
|
||||
keyNetwork = contextKeyT("llb.network")
|
||||
keySecurity = contextKeyT("llb.security")
|
||||
keyHostname = contextKeyT("llb.exec.hostname")
|
||||
keyShmSize = contextKeyT("llb.exec.shmsize")
|
||||
keyUlimit = contextKeyT("llb.exec.ulimit")
|
||||
keyUser = contextKeyT("llb.exec.user")
|
||||
|
||||
keyPlatform = contextKeyT("llb.platform")
|
||||
keyNetwork = contextKeyT("llb.network")
|
||||
keySecurity = contextKeyT("llb.security")
|
||||
)
|
||||
|
||||
func AddEnvf(key, value string, v ...interface{}) StateOption {
|
||||
@ -232,6 +235,55 @@ type HostIP struct {
|
||||
IP net.IP
|
||||
}
|
||||
|
||||
func shmSize(kb int64) StateOption {
|
||||
return func(s State) State {
|
||||
return s.WithValue(keyShmSize, kb)
|
||||
}
|
||||
}
|
||||
|
||||
func getShmSize(s State) func(context.Context, *Constraints) (*int64, error) {
|
||||
return func(ctx context.Context, c *Constraints) (*int64, error) {
|
||||
v, err := s.getValue(keyShmSize)(ctx, c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if v != nil {
|
||||
kb := v.(int64)
|
||||
return &kb, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
func ulimit(name UlimitName, soft int64, hard int64) StateOption {
|
||||
return func(s State) State {
|
||||
return s.withValue(keyUlimit, func(ctx context.Context, c *Constraints) (interface{}, error) {
|
||||
v, err := getUlimit(s)(ctx, c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return append(v, pb.Ulimit{
|
||||
Name: string(name),
|
||||
Soft: soft,
|
||||
Hard: hard,
|
||||
}), nil
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func getUlimit(s State) func(context.Context, *Constraints) ([]pb.Ulimit, error) {
|
||||
return func(ctx context.Context, c *Constraints) ([]pb.Ulimit, error) {
|
||||
v, err := s.getValue(keyUlimit)(ctx, c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if v != nil {
|
||||
return v.([]pb.Ulimit), nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
func Network(v pb.NetMode) StateOption {
|
||||
return func(s State) State {
|
||||
return s.WithValue(keyNetwork, v)
|
||||
|
Reference in New Issue
Block a user