mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-14 07:27:07 +08:00
vendor: update buildkit to 10e6f94b
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
32
vendor/github.com/moby/buildkit/util/imageutil/buildinfo.go
generated
vendored
Normal file
32
vendor/github.com/moby/buildkit/util/imageutil/buildinfo.go
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
package imageutil
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
|
||||
binfotypes "github.com/moby/buildkit/util/buildinfo/types"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// BuildInfo returns build info from image config.
|
||||
func BuildInfo(dt []byte) (*binfotypes.BuildInfo, error) {
|
||||
if len(dt) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
var config binfotypes.ImageConfig
|
||||
if err := json.Unmarshal(dt, &config); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal image config")
|
||||
}
|
||||
if len(config.BuildInfo) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
dtbi, err := base64.StdEncoding.DecodeString(config.BuildInfo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var bi binfotypes.BuildInfo
|
||||
if err = json.Unmarshal(dtbi, &bi); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to decode buildinfo from image config")
|
||||
}
|
||||
return &bi, nil
|
||||
}
|
6
vendor/github.com/moby/buildkit/util/progress/progressui/printer.go
generated
vendored
6
vendor/github.com/moby/buildkit/util/progress/progressui/printer.go
generated
vendored
@ -256,7 +256,7 @@ func (p *textMux) print(t *trace) {
|
||||
}
|
||||
// make any open vertex active
|
||||
for dgst, v := range t.byDigest {
|
||||
if v.isStarted() && !v.isCompleted() {
|
||||
if v.isStarted() && !v.isCompleted() && v.ProgressGroup == nil && !v.hidden {
|
||||
p.printVtx(t, dgst)
|
||||
return
|
||||
}
|
||||
@ -281,6 +281,10 @@ func (p *textMux) print(t *trace) {
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if v.lastBlockTime == nil {
|
||||
// shouldn't happen, but not worth crashing over
|
||||
continue
|
||||
}
|
||||
tm := now.Sub(*v.lastBlockTime)
|
||||
speed := float64(v.count) / tm.Seconds()
|
||||
overLimit := tm > maxDelay && dgst != current
|
||||
|
Reference in New Issue
Block a user