Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump compose-go to v2.4.9 #3064

Merged
merged 2 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions bake/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding"
"io"
"maps"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -1104,9 +1105,7 @@ func (t *Target) GetEvalContexts(ectx *hcl.EvalContext, block *hcl.Block, loadDe
e2 := ectx.NewChild()
e2.Variables = make(map[string]cty.Value)
if e != ectx {
for k, v := range e.Variables {
e2.Variables[k] = v
}
maps.Copy(e2.Variables, e.Variables)
}
e2.Variables[k] = v
ectxs2 = append(ectxs2, e2)
Expand Down
7 changes: 3 additions & 4 deletions bake/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package bake
import (
"context"
"fmt"
"maps"
"os"
"path/filepath"
"slices"
Expand Down Expand Up @@ -91,9 +92,7 @@ func ParseCompose(cfgs []composetypes.ConfigFile, envs map[string]string) (*Conf
var additionalContexts map[string]string
if s.Build.AdditionalContexts != nil {
additionalContexts = map[string]string{}
for k, v := range s.Build.AdditionalContexts {
additionalContexts[k] = v
}
maps.Copy(additionalContexts, s.Build.AdditionalContexts)
}

var shmSize *string
Expand Down Expand Up @@ -214,7 +213,7 @@ func validateComposeFile(dt []byte, fn string) (bool, error) {
}

func validateCompose(dt []byte, envs map[string]string) error {
_, err := loader.Load(composetypes.ConfigDetails{
_, err := loader.LoadWithContext(context.Background(), composetypes.ConfigDetails{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have a better context for this that we could pass in?

ConfigFiles: []composetypes.ConfigFile{
{
Content: dt,
Expand Down
5 changes: 2 additions & 3 deletions build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"encoding/json"
"fmt"
"io"
"maps"
"os"
"slices"
"strconv"
Expand Down Expand Up @@ -431,9 +432,7 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opts map[
FrontendInputs: frontendInputs,
FrontendOpt: make(map[string]string),
}
for k, v := range so.FrontendAttrs {
req.FrontendOpt[k] = v
}
maps.Copy(req.FrontendOpt, so.FrontendAttrs)
so.Frontend = ""
so.FrontendInputs = nil

Expand Down
5 changes: 2 additions & 3 deletions build/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package build

import (
"context"
"maps"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -127,9 +128,7 @@ func getGitAttributes(ctx context.Context, contextPath, dockerfilePath string) (
if so.FrontendAttrs == nil {
so.FrontendAttrs = make(map[string]string)
}
for k, v := range res {
so.FrontendAttrs[k] = v
}
maps.Copy(so.FrontendAttrs, res)

if !setGitInfo || root == "" {
return
Expand Down
5 changes: 2 additions & 3 deletions build/provenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/base64"
"encoding/json"
"io"
"maps"
"strings"
"sync"

Expand Down Expand Up @@ -40,9 +41,7 @@ func setRecordProvenance(ctx context.Context, c *client.Client, sr *client.Solve
if err != nil {
return err
}
for k, v := range res {
sr.ExporterResponse[k] = v
}
maps.Copy(sr.ExporterResponse, res)
return nil
})
}
Expand Down
5 changes: 2 additions & 3 deletions commands/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"maps"
"sort"
"strings"
"time"
Expand Down Expand Up @@ -409,9 +410,7 @@ func truncPlatforms(pfs []string, max int) truncatedPlatforms {
left[ppf] = append(left[ppf], pf)
}
}
for k, v := range left {
res[k] = v
}
maps.Copy(res, left)
return truncatedPlatforms{
res: res,
input: pfs,
Expand Down
10 changes: 6 additions & 4 deletions controller/pb/cache.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package pb

import "github.com/moby/buildkit/client"
import (
"maps"

"github.com/moby/buildkit/client"
)

func CreateCaches(entries []*CacheOptionsEntry) []client.CacheOptionsEntry {
var outs []client.CacheOptionsEntry
Expand All @@ -12,9 +16,7 @@ func CreateCaches(entries []*CacheOptionsEntry) []client.CacheOptionsEntry {
Type: entry.Type,
Attrs: map[string]string{},
}
for k, v := range entry.Attrs {
out.Attrs[k] = v
}
maps.Copy(out.Attrs, entry.Attrs)
outs = append(outs, out)
}
return outs
Expand Down
5 changes: 2 additions & 3 deletions controller/pb/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pb

import (
"io"
"maps"
"os"
"strconv"

Expand All @@ -26,9 +27,7 @@ func CreateExports(entries []*ExportEntry) ([]client.ExportEntry, []string, erro
Type: entry.Type,
Attrs: map[string]string{},
}
for k, v := range entry.Attrs {
out.Attrs[k] = v
}
maps.Copy(out.Attrs, entry.Attrs)

supportFile := false
supportDir := false
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/docker/buildx

go 1.22.0
go 1.23.0

require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/Microsoft/go-winio v0.6.2
github.com/aws/aws-sdk-go-v2/config v1.27.27
github.com/compose-spec/compose-go/v2 v2.4.8
github.com/compose-spec/compose-go/v2 v2.4.9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think PR title is wrong and should be bump compose-go to v2.4.9 😅

github.com/containerd/console v1.0.4
github.com/containerd/containerd/v2 v2.0.3
github.com/containerd/continuity v0.4.5
Expand Down Expand Up @@ -159,6 +159,7 @@ require (
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.56.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004 h1:lkAMpLVBDaj17e
github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
github.com/compose-spec/compose-go/v2 v2.4.8 h1:7Myl8wDRl/4mRz77S+eyDJymGGEHu0diQdGSSeyq90A=
github.com/compose-spec/compose-go/v2 v2.4.8/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc=
github.com/compose-spec/compose-go/v2 v2.4.9 h1:2K4TDw+1ba2idiR6empXHKRXvWYpnvAKoNQy93/sSOs=
github.com/compose-spec/compose-go/v2 v2.4.9/go.mod h1:6k5l/0TxCg0/2uLEhRVEsoBWBprS2uvZi32J7xub3lo=
github.com/containerd/cgroups/v3 v3.0.5 h1:44na7Ud+VwyE7LIoJ8JTNQOa549a8543BmzaJHo6Bzo=
github.com/containerd/cgroups/v3 v3.0.5/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM5GEVisn4jpins=
github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro=
Expand Down Expand Up @@ -459,6 +459,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/zclconf/go-cty v1.4.0/go.mod h1:nHzOclRkoj++EU9ZjSrZvRG0BXIWt8c7loYc0qXAFGQ=
Expand Down
9 changes: 3 additions & 6 deletions store/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package store

import (
"fmt"
"maps"
"slices"
"time"

Expand Down Expand Up @@ -93,9 +94,7 @@ func (ng *NodeGroup) Update(name, endpoint string, platforms []string, endpoints
needsRestart = true
}
if buildkitdConfigFile != "" {
for k, v := range files {
n.Files[k] = v
}
maps.Copy(n.Files, files)
needsRestart = true
}
if needsRestart {
Expand Down Expand Up @@ -147,9 +146,7 @@ func (n *Node) Copy() *Node {
buildkitdFlags := []string{}
copy(buildkitdFlags, n.BuildkitdFlags)
driverOpts := map[string]string{}
for k, v := range n.DriverOpts {
driverOpts[k] = v
}
maps.Copy(driverOpts, n.DriverOpts)
files := map[string][]byte{}
for k, v := range n.Files {
vv := []byte{}
Expand Down
4 changes: 1 addition & 3 deletions util/imagetools/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ func (r *Resolver) Combine(ctx context.Context, srcs []*Source, ann map[exptypes
if old.Annotations == nil {
old.Annotations = map[string]string{}
}
for k, v := range d.Annotations {
old.Annotations[k] = v
}
maps.Copy(old.Annotations, d.Annotations)
newDescs[idx] = old
} else {
m[d.Digest] = len(newDescs)
Expand Down
11 changes: 4 additions & 7 deletions util/imagetools/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"encoding/base64"
"encoding/json"
"maps"
"regexp"
"sort"
"strings"
Expand Down Expand Up @@ -126,13 +127,9 @@ func (l *loader) Load(ctx context.Context, ref string) (*result, error) {
}

var a asset
annotations := make(map[string]string, len(mfst.manifest.Annotations)+len(mfst.desc.Annotations))
for k, v := range mfst.desc.Annotations {
annotations[k] = v
}
for k, v := range mfst.manifest.Annotations {
annotations[k] = v
}
annotations := map[string]string{}
maps.Copy(annotations, mfst.desc.Annotations)
maps.Copy(annotations, mfst.manifest.Annotations)

if err := l.scanConfig(ctx, fetcher, mfst.manifest.Config, &a); err != nil {
return nil, err
Expand Down
10 changes: 0 additions & 10 deletions vendor/github.com/compose-spec/compose-go/v2/cli/options.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 16 additions & 3 deletions vendor/github.com/compose-spec/compose-go/v2/dotenv/format.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/compose-spec/compose-go/v2/dotenv/parser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading