diff --git a/go.mod b/go.mod index e36289cf..4492085d 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/jinzhu/gorm v1.9.2 // indirect github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/moby/buildkit v0.10.0-rc2.0.20220308185020-fdecd0ae108b + github.com/moby/buildkit v0.10.1-0.20220403220257-10e6f94bf90d github.com/morikuni/aec v1.0.0 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5 diff --git a/go.sum b/go.sum index 795a8fc6..b697c5f2 100644 --- a/go.sum +++ b/go.sum @@ -968,8 +968,8 @@ github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGg github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/moby/buildkit v0.8.1/go.mod h1:/kyU1hKy/aYCuP39GZA9MaKioovHku57N6cqlKZIaiQ= -github.com/moby/buildkit v0.10.0-rc2.0.20220308185020-fdecd0ae108b h1:plbnJxjht8Z6D3c/ga79D1+VaA/IUfNVp08J3lcDgI8= -github.com/moby/buildkit v0.10.0-rc2.0.20220308185020-fdecd0ae108b/go.mod h1:WvwAZv8aRScHkqc/+X46cRC2CKMKpqcaX+pRvUTtPes= +github.com/moby/buildkit v0.10.1-0.20220403220257-10e6f94bf90d h1:6pLVBJO3V/lMegbVD5kh2QrpZwqS4ZrxEm/MyifCPaY= +github.com/moby/buildkit v0.10.1-0.20220403220257-10e6f94bf90d/go.mod h1:WvwAZv8aRScHkqc/+X46cRC2CKMKpqcaX+pRvUTtPes= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= diff --git a/vendor/github.com/moby/buildkit/util/imageutil/buildinfo.go b/vendor/github.com/moby/buildkit/util/imageutil/buildinfo.go new file mode 100644 index 00000000..2ef1e75c --- /dev/null +++ b/vendor/github.com/moby/buildkit/util/imageutil/buildinfo.go @@ -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 +} diff --git a/vendor/github.com/moby/buildkit/util/progress/progressui/printer.go b/vendor/github.com/moby/buildkit/util/progress/progressui/printer.go index 21b3cf12..550b8c0b 100644 --- a/vendor/github.com/moby/buildkit/util/progress/progressui/printer.go +++ b/vendor/github.com/moby/buildkit/util/progress/progressui/printer.go @@ -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 diff --git a/vendor/modules.txt b/vendor/modules.txt index 8bcf83d7..695b36cb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -294,7 +294,7 @@ github.com/miekg/pkcs11 github.com/mitchellh/go-wordwrap # github.com/mitchellh/mapstructure v1.4.3 github.com/mitchellh/mapstructure -# github.com/moby/buildkit v0.10.0-rc2.0.20220308185020-fdecd0ae108b +# github.com/moby/buildkit v0.10.1-0.20220403220257-10e6f94bf90d ## explicit github.com/moby/buildkit/api/services/control github.com/moby/buildkit/api/types