mirror of
https://github.com/moby/moby.git
synced 2026-07-26 11:23:36 +00:00
Merge pull request #48028 from tonistiigi/update-buildkit-v0.14.1
vendor: update buildkit to v0.14.1
This commit is contained in:
@@ -60,7 +60,7 @@ require (
|
||||
github.com/miekg/dns v1.1.57
|
||||
github.com/mistifyio/go-zfs/v3 v3.0.1
|
||||
github.com/mitchellh/copystructure v1.2.0
|
||||
github.com/moby/buildkit v0.14.0
|
||||
github.com/moby/buildkit v0.14.1
|
||||
github.com/moby/docker-image-spec v1.3.1
|
||||
github.com/moby/ipvs v1.1.0
|
||||
github.com/moby/locker v1.0.1
|
||||
|
||||
@@ -479,8 +479,8 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh
|
||||
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
|
||||
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||
github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34fGzaAZGFW22KVZDfyrYW+QABMrWnJBnSs=
|
||||
github.com/moby/buildkit v0.14.0 h1:mHv2lFS8znLDRc4SMyM2B9tPjxWh2blMvr0H7ARquNM=
|
||||
github.com/moby/buildkit v0.14.0/go.mod h1:1XssG7cAqv5Bz1xcGMxJL123iCv5TYN4Z/qf647gfuk=
|
||||
github.com/moby/buildkit v0.14.1 h1:2epLCZTkn4CikdImtsLtIa++7DzCimrrZCT1sway+oI=
|
||||
github.com/moby/buildkit v0.14.1/go.mod h1:1XssG7cAqv5Bz1xcGMxJL123iCv5TYN4Z/qf647gfuk=
|
||||
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
|
||||
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
|
||||
github.com/moby/ipvs v1.1.0 h1:ONN4pGaZQgAx+1Scz5RvWV4Q7Gb+mvfRh3NsPS+1XQQ=
|
||||
|
||||
13
vendor/github.com/moby/buildkit/exporter/containerimage/export.go
generated
vendored
13
vendor/github.com/moby/buildkit/exporter/containerimage/export.go
generated
vendored
@@ -339,18 +339,7 @@ func (e *imageExporterInstance) Export(ctx context.Context, src *exporter.Source
|
||||
}
|
||||
}
|
||||
if e.push {
|
||||
if opts.RewriteTimestamp {
|
||||
annotations := map[digest.Digest]map[string]string{}
|
||||
addAnnotations(annotations, *desc)
|
||||
// e.pushImage cannot be used because src ref does not point to the rewritten image
|
||||
//
|
||||
// TODO: change e.pushImage so that it takes Result[Remote] as parameter.
|
||||
// https://github.com/moby/buildkit/pull/4057#discussion_r1324106088
|
||||
err = push.Push(ctx, e.opt.SessionManager, sessionID, e.opt.ImageWriter.opt.ContentStore, e.opt.ImageWriter.ContentStore(),
|
||||
desc.Digest, targetName, e.insecure, e.opt.RegistryHosts, e.pushByDigest, annotations)
|
||||
} else {
|
||||
err = e.pushImage(ctx, src, sessionID, targetName, desc.Digest)
|
||||
}
|
||||
err = e.pushImage(ctx, src, sessionID, targetName, desc.Digest)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrapf(err, "failed to push %v", targetName)
|
||||
}
|
||||
|
||||
24
vendor/github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb/convert.go
generated
vendored
24
vendor/github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb/convert.go
generated
vendored
@@ -1035,6 +1035,7 @@ func (ds *dispatchState) init() {
|
||||
// the paths we use back to the base image.
|
||||
ds.paths = ds.base.paths
|
||||
ds.workdirSet = ds.base.workdirSet
|
||||
ds.buildArgs = append(ds.buildArgs, ds.base.buildArgs...)
|
||||
}
|
||||
|
||||
type dispatchStates struct {
|
||||
@@ -2163,22 +2164,15 @@ func validateCommandCasing(dockerfile *parser.Result, lint *linter.Linter) {
|
||||
// Here, we check both if the command is consistent per command (ie, "CMD" or "cmd", not "Cmd")
|
||||
// as well as ensuring that the casing is consistent throughout the dockerfile by comparing the
|
||||
// command to the casing of the majority of commands.
|
||||
if !isSelfConsistentCasing(node.Value) {
|
||||
msg := linter.RuleConsistentInstructionCasing.Format(node.Value)
|
||||
var correctCasing string
|
||||
if isMajorityLower && strings.ToLower(node.Value) != node.Value {
|
||||
correctCasing = "lowercase"
|
||||
} else if !isMajorityLower && strings.ToUpper(node.Value) != node.Value {
|
||||
correctCasing = "uppercase"
|
||||
}
|
||||
if correctCasing != "" {
|
||||
msg := linter.RuleConsistentInstructionCasing.Format(node.Value, correctCasing)
|
||||
lint.Run(&linter.RuleConsistentInstructionCasing, node.Location(), msg)
|
||||
} else {
|
||||
var msg string
|
||||
var needsLintWarn bool
|
||||
if isMajorityLower && strings.ToUpper(node.Value) == node.Value {
|
||||
msg = linter.RuleFileConsistentCommandCasing.Format(node.Value, "lowercase")
|
||||
needsLintWarn = true
|
||||
} else if !isMajorityLower && strings.ToLower(node.Value) == node.Value {
|
||||
msg = linter.RuleFileConsistentCommandCasing.Format(node.Value, "uppercase")
|
||||
needsLintWarn = true
|
||||
}
|
||||
if needsLintWarn {
|
||||
lint.Run(&linter.RuleFileConsistentCommandCasing, node.Location(), msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
8
vendor/github.com/moby/buildkit/frontend/dockerfile/linter/linter.go
generated
vendored
8
vendor/github.com/moby/buildkit/frontend/dockerfile/linter/linter.go
generated
vendored
@@ -91,8 +91,12 @@ func (rule *LinterRule[F]) Run(warn LintWarnFunc, location []parser.Range, txt .
|
||||
warn(rule.Name, rule.Description, rule.URL, short, location)
|
||||
}
|
||||
|
||||
func LintFormatShort(rulename, msg string, startLine int) string {
|
||||
return fmt.Sprintf("%s: %s (line %d)", rulename, msg, startLine)
|
||||
func LintFormatShort(rulename, msg string, line int) string {
|
||||
msg = fmt.Sprintf("%s: %s", rulename, msg)
|
||||
if line > 0 {
|
||||
msg = fmt.Sprintf("%s (line %d)", msg, line)
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
type LintWarnFunc func(rulename, description, url, fmtmsg string, location []parser.Range)
|
||||
|
||||
12
vendor/github.com/moby/buildkit/frontend/dockerfile/linter/ruleset.go
generated
vendored
12
vendor/github.com/moby/buildkit/frontend/dockerfile/linter/ruleset.go
generated
vendored
@@ -29,18 +29,10 @@ var (
|
||||
return "Empty continuation line"
|
||||
},
|
||||
}
|
||||
RuleConsistentInstructionCasing = LinterRule[func(string) string]{
|
||||
RuleConsistentInstructionCasing = LinterRule[func(string, string) string]{
|
||||
Name: "ConsistentInstructionCasing",
|
||||
Description: "Instructions should be in consistent casing (all lower or all upper)",
|
||||
URL: "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||
Format: func(command string) string {
|
||||
return fmt.Sprintf("Command '%s' should be consistently cased", command)
|
||||
},
|
||||
}
|
||||
RuleFileConsistentCommandCasing = LinterRule[func(string, string) string]{
|
||||
Name: "FileConsistentCommandCasing",
|
||||
Description: "All commands within the Dockerfile should use the same casing (either upper or lower)",
|
||||
URL: "https://docs.docker.com/go/dockerfile/rule/file-consistent-command-casing/",
|
||||
URL: "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/",
|
||||
Format: func(violatingCommand, correctCasing string) string {
|
||||
return fmt.Sprintf("Command '%s' should match the case of the command majority (%s)", violatingCommand, correctCasing)
|
||||
},
|
||||
|
||||
3
vendor/github.com/moby/buildkit/frontend/dockerfile/shell/lex.go
generated
vendored
3
vendor/github.com/moby/buildkit/frontend/dockerfile/shell/lex.go
generated
vendored
@@ -429,7 +429,8 @@ func (sw *shellWord) processDollar() (string, error) {
|
||||
case '%', '#':
|
||||
// %/# matches the shortest pattern expansion, %%/## the longest
|
||||
greedy := false
|
||||
if word[0] == byte(ch) {
|
||||
|
||||
if len(word) > 0 && word[0] == byte(ch) {
|
||||
greedy = true
|
||||
word = word[1:]
|
||||
}
|
||||
|
||||
8
vendor/github.com/moby/buildkit/frontend/subrequests/lint/lint.go
generated
vendored
8
vendor/github.com/moby/buildkit/frontend/subrequests/lint/lint.go
generated
vendored
@@ -108,7 +108,7 @@ func (results *LintResults) ToResult() (*client.Result, error) {
|
||||
res.AddMeta("result.txt", b.Bytes())
|
||||
|
||||
status := 0
|
||||
if len(results.Warnings) > 0 {
|
||||
if len(results.Warnings) > 0 || results.Error != nil {
|
||||
status = 1
|
||||
}
|
||||
res.AddMeta("result.statuscode", []byte(fmt.Sprintf("%d", status)))
|
||||
@@ -169,11 +169,11 @@ func PrintLintViolations(dt []byte, w io.Writer) error {
|
||||
})
|
||||
|
||||
for _, warning := range results.Warnings {
|
||||
fmt.Fprintf(w, "%s", warning.RuleName)
|
||||
fmt.Fprintf(w, "\nWARNING: %s", warning.RuleName)
|
||||
if warning.URL != "" {
|
||||
fmt.Fprintf(w, " - %s", warning.URL)
|
||||
}
|
||||
fmt.Fprintf(w, "\n%s\n", warning.Description)
|
||||
fmt.Fprintf(w, "\n%s\n", warning.Detail)
|
||||
|
||||
if warning.Location.SourceIndex < 0 {
|
||||
continue
|
||||
@@ -187,8 +187,8 @@ func PrintLintViolations(dt []byte, w io.Writer) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Fprintln(w)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
21
vendor/github.com/moby/buildkit/util/resolver/resolver.go
generated
vendored
21
vendor/github.com/moby/buildkit/util/resolver/resolver.go
generated
vendored
@@ -10,6 +10,7 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
@@ -213,13 +214,18 @@ func newDefaultTransport() *http.Transport {
|
||||
}
|
||||
|
||||
type httpFallback struct {
|
||||
super http.RoundTripper
|
||||
host string
|
||||
super http.RoundTripper
|
||||
host string
|
||||
hostMut sync.Mutex
|
||||
}
|
||||
|
||||
func (f *httpFallback) RoundTrip(r *http.Request) (*http.Response, error) {
|
||||
// only fall back if the same host had previously fell back
|
||||
if f.host != r.URL.Host {
|
||||
f.hostMut.Lock()
|
||||
// Skip the HTTPS call only if the same host had previously fell back
|
||||
tryHTTPSFirst := f.host != r.URL.Host
|
||||
f.hostMut.Unlock()
|
||||
|
||||
if tryHTTPSFirst {
|
||||
resp, err := f.super.RoundTrip(r)
|
||||
if !isTLSError(err) && !isPortError(err, r.URL.Host) {
|
||||
return resp, err
|
||||
@@ -232,8 +238,13 @@ func (f *httpFallback) RoundTrip(r *http.Request) (*http.Response, error) {
|
||||
plainHTTPRequest := *r
|
||||
plainHTTPRequest.URL = &plainHTTPUrl
|
||||
|
||||
if f.host != r.URL.Host {
|
||||
// We tried HTTPS first but it failed.
|
||||
// Mark the host so we don't try HTTPS for this host next time
|
||||
// and refresh the request body.
|
||||
if tryHTTPSFirst {
|
||||
f.hostMut.Lock()
|
||||
f.host = r.URL.Host
|
||||
f.hostMut.Unlock()
|
||||
|
||||
// update body on the second attempt
|
||||
if r.Body != nil && r.GetBody != nil {
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -709,7 +709,7 @@ github.com/mitchellh/hashstructure/v2
|
||||
# github.com/mitchellh/reflectwalk v1.0.2
|
||||
## explicit
|
||||
github.com/mitchellh/reflectwalk
|
||||
# github.com/moby/buildkit v0.14.0
|
||||
# github.com/moby/buildkit v0.14.1
|
||||
## explicit; go 1.21
|
||||
github.com/moby/buildkit/api/services/control
|
||||
github.com/moby/buildkit/api/types
|
||||
|
||||
Reference in New Issue
Block a user