diff --git a/vendor.mod b/vendor.mod index 57663ea1a9..8807bfafe7 100644 --- a/vendor.mod +++ b/vendor.mod @@ -33,7 +33,7 @@ require ( github.com/mattn/go-runewidth v0.0.24 github.com/moby/go-archive v0.2.1 github.com/moby/moby/api v1.55.0 - github.com/moby/moby/client v0.5.0 + github.com/moby/moby/client v0.5.1 github.com/moby/patternmatcher v0.6.1 github.com/moby/swarmkit/v2 v2.1.2 github.com/moby/sys/atomicwriter v0.1.0 diff --git a/vendor.sum b/vendor.sum index 31f8a925fd..dec8036cad 100644 --- a/vendor.sum +++ b/vendor.sum @@ -111,8 +111,8 @@ github.com/moby/go-archive v0.2.1 h1:fAa0wUS/ikZKyx7o/1fhUYmhZ7RgpthdeoDhJvunTLc github.com/moby/go-archive v0.2.1/go.mod h1:Npdv43fFqlhZW7Xo8fbm3ZMYFvAGNviUPqX21VERbcE= github.com/moby/moby/api v1.55.0 h1:2/sexvQyqIWS8pRSCFddBfpW2qE7vR7FCL+vN8pxwMc= github.com/moby/moby/api v1.55.0/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs= -github.com/moby/moby/client v0.5.0 h1:5XhyPk2fuOWf6RlSFa3MkIIgDZkF25xToXW8Q/BH7cc= -github.com/moby/moby/client v0.5.0/go.mod h1:rcVpF8ncl9vo5gaIBdol6CnbEtSj1uxMvEV/UrykF/s= +github.com/moby/moby/client v0.5.1 h1:tYNaJno4c0HXz12y5BiqEDy0rVTYkWzI26lGvnTMiJw= +github.com/moby/moby/client v0.5.1/go.mod h1:odLstlZ6uSnfvAgVxMpvgmb8SUdd+siH2T0GBuxVAlM= github.com/moby/patternmatcher v0.6.1 h1:qlhtafmr6kgMIJjKJMDmMWq7WLkKIo23hsrpR3x084U= github.com/moby/patternmatcher v0.6.1/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/swarmkit/v2 v2.1.2 h1:1WDZAI6HVYNKdCG4zlXnTAPyLsLwuhRGWlHoOUf5Z6I= diff --git a/vendor/github.com/moby/moby/client/README.md b/vendor/github.com/moby/moby/client/README.md index aed3e641d9..ebe29495c9 100644 --- a/vendor/github.com/moby/moby/client/README.md +++ b/vendor/github.com/moby/moby/client/README.md @@ -2,7 +2,6 @@ [![PkgGoDev](https://pkg.go.dev/badge/github.com/moby/moby/client)](https://pkg.go.dev/github.com/moby/moby/client) ![GitHub License](https://img.shields.io/github/license/moby/moby) -[![Go Report Card](https://goreportcard.com/badge/github.com/moby/moby/client)](https://goreportcard.com/report/github.com/moby/moby/client) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/moby/moby/badge)](https://scorecard.dev/viewer/?uri=github.com/moby/moby) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10989/badge)](https://www.bestpractices.dev/projects/10989) diff --git a/vendor/github.com/moby/moby/client/container_commit.go b/vendor/github.com/moby/moby/client/container_commit.go index 79da44a54f..f73cd22f51 100644 --- a/vendor/github.com/moby/moby/client/container_commit.go +++ b/vendor/github.com/moby/moby/client/container_commit.go @@ -31,8 +31,9 @@ func (cli *Client) ContainerCommit(ctx context.Context, containerID string, opti if err != nil { return ContainerCommitResult{}, err } + query := url.Values{} + query.Set("container", containerID) - var repository, tag string if options.Reference != "" { ref, err := reference.ParseNormalizedNamed(options.Reference) if err != nil { @@ -44,18 +45,18 @@ func (cli *Client) ContainerCommit(ctx context.Context, containerID string, opti } ref = reference.TagNameOnly(ref) + query.Set("repo", ref.Name()) if tagged, ok := ref.(reference.Tagged); ok { - tag = tagged.Tag() + query.Set("tag", tagged.Tag()) } - repository = ref.Name() } - query := url.Values{} - query.Set("container", containerID) - query.Set("repo", repository) - query.Set("tag", tag) - query.Set("comment", options.Comment) - query.Set("author", options.Author) + if options.Comment != "" { + query.Set("comment", options.Comment) + } + if options.Author != "" { + query.Set("author", options.Author) + } for _, change := range options.Changes { query.Add("changes", change) } diff --git a/vendor/github.com/moby/moby/client/container_restart.go b/vendor/github.com/moby/moby/client/container_restart.go index e883f75891..df7ca4c7ed 100644 --- a/vendor/github.com/moby/moby/client/container_restart.go +++ b/vendor/github.com/moby/moby/client/container_restart.go @@ -16,7 +16,8 @@ type ContainerRestartOptions struct { // Timeout (optional) is the timeout (in seconds) to wait for the container // to stop gracefully before forcibly terminating it with SIGKILL. // - // - Use nil to use the default timeout (10 seconds). + // - Use nil to use the container's configured timeout, or the engine default + // if the container has no configured timeout. // - Use '-1' to wait indefinitely. // - Use '0' to not wait for the container to exit gracefully, and // immediately proceeds to forcibly terminating the container. diff --git a/vendor/github.com/moby/moby/client/container_stop.go b/vendor/github.com/moby/moby/client/container_stop.go index d4d47d8fd4..d72358c5ee 100644 --- a/vendor/github.com/moby/moby/client/container_stop.go +++ b/vendor/github.com/moby/moby/client/container_stop.go @@ -16,7 +16,8 @@ type ContainerStopOptions struct { // Timeout (optional) is the timeout (in seconds) to wait for the container // to stop gracefully before forcibly terminating it with SIGKILL. // - // - Use nil to use the default timeout (10 seconds). + // - Use nil to use the container's configured timeout, or the engine default + // if the container has no configured timeout. // - Use '-1' to wait indefinitely. // - Use '0' to not wait for the container to exit gracefully, and // immediately proceeds to forcibly terminating the container. diff --git a/vendor/github.com/moby/moby/client/internal/mod/mod.go b/vendor/github.com/moby/moby/client/internal/mod/mod.go index 355eb95326..c9a11b3e56 100644 --- a/vendor/github.com/moby/moby/client/internal/mod/mod.go +++ b/vendor/github.com/moby/moby/client/internal/mod/mod.go @@ -87,7 +87,7 @@ func getVersion(name string, dep *debug.Module) (string, bool) { func normalize(v string) string { base, metas, dirty := splitMetadata(v) - out := base + var out strings.Builder if base2, rev, undoPatch, ok := splitPseudo(base); ok { if undoPatch { // Downgrade the patch version that was raised by pseudo-versions: @@ -102,18 +102,22 @@ func normalize(v string) string { if len(rev) > 12 { rev = rev[:12] } - out = base2 + "+" + rev + out.WriteString(base2) + out.WriteByte('+') + out.WriteString(rev) + } else { + out.WriteString(base) } // Preserve other metadata (except for "+incompatible"). for _, m := range metas { - out += m + out.WriteString(m) } if dirty { // +dirty goes last - out += "+dirty" + out.WriteString("+dirty") } - return out + return out.String() } func splitMetadata(v string) (base string, metas []string, dirty bool) { diff --git a/vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go b/vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go index e3ac43afd4..a955363d8a 100644 --- a/vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go +++ b/vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go @@ -128,7 +128,7 @@ func cursorDown(out io.Writer, l uint) { // Display prints the JSONMessage to out. If isTerminal is true, it erases // the entire current line when displaying the progressbar. It returns an -// error if the [JSONMessage.Error] field is non-nil. +// error if [jsonstream.Message.Error] is non-nil. func Display(jm jsonstream.Message, out io.Writer, isTerminal bool, width uint16) error { if jm.Error != nil { return jm.Error diff --git a/vendor/github.com/moby/moby/client/service_create.go b/vendor/github.com/moby/moby/client/service_create.go index 319bca6f4c..8d5926bb9b 100644 --- a/vendor/github.com/moby/moby/client/service_create.go +++ b/vendor/github.com/moby/moby/client/service_create.go @@ -137,21 +137,37 @@ func imageDigestAndPlatforms(ctx context.Context, cli DistributionAPIClient, ima if len(distributionInspect.Platforms) > 0 { platforms = make([]swarm.Platform, 0, len(distributionInspect.Platforms)) + seen := make(map[swarm.Platform]struct{}, len(distributionInspect.Platforms)) for _, p := range distributionInspect.Platforms { + // skip attestations and other data included in the manifest index. + if p.OS == "unknown" || p.Architecture == "unknown" { + continue + } // clear architecture field for arm. This is a temporary patch to address - // https://github.com/docker/swarmkit/issues/2294. The issue is that while + // https://github.com/moby/swarmkit/issues/2294. The issue is that while // image manifests report "arm" as the architecture, the node reports // something like "armv7l" (includes the variant), which causes arm images // to stop working with swarm mode. This patch removes the architecture // constraint for arm images to ensure tasks get scheduled. arch := p.Architecture - if strings.ToLower(arch) == "arm" { + if strings.EqualFold(arch, "arm") { arch = "" } - platforms = append(platforms, swarm.Platform{ + platform := swarm.Platform{ Architecture: arch, OS: p.OS, - }) + } + + // Skip duplicates. Swarm currently only uses os/arch, and doesn't + // support other fields (Variant, OSVersion, OSFeatures), which + // usually results in duplicate "os/arch" combinations coming from + // the image. + if _, ok := seen[platform]; ok { + continue + } + seen[platform] = struct{}{} + + platforms = append(platforms, platform) } } return imageWithDigest, platforms, err diff --git a/vendor/github.com/moby/moby/client/service_inspect.go b/vendor/github.com/moby/moby/client/service_inspect.go index 9bda43f861..7b7d098941 100644 --- a/vendor/github.com/moby/moby/client/service_inspect.go +++ b/vendor/github.com/moby/moby/client/service_inspect.go @@ -3,7 +3,6 @@ package client import ( "context" "encoding/json" - "fmt" "net/url" "github.com/moby/moby/api/types/swarm" @@ -28,7 +27,9 @@ func (cli *Client) ServiceInspect(ctx context.Context, serviceID string, options } query := url.Values{} - query.Set("insertDefaults", fmt.Sprintf("%v", options.InsertDefaults)) + if options.InsertDefaults { + query.Set("insertDefaults", "1") + } resp, err := cli.get(ctx, "/services/"+serviceID, query, nil) if err != nil { return ServiceInspectResult{}, err diff --git a/vendor/modules.txt b/vendor/modules.txt index 8eea29e673..557f445fb7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -189,7 +189,7 @@ github.com/moby/moby/api/types/storage github.com/moby/moby/api/types/swarm github.com/moby/moby/api/types/system github.com/moby/moby/api/types/volume -# github.com/moby/moby/client v0.5.0 +# github.com/moby/moby/client v0.5.1 ## explicit; go 1.24 github.com/moby/moby/client github.com/moby/moby/client/internal