mirror of
https://github.com/docker/cli.git
synced 2026-08-24 02:24:17 -05:00
vendor: github.com/moby/moby/client v0.5.1
full diff: https://github.com/moby/moby/compare/client/v0.5.0...client/v0.5.1 Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
+2
-2
@@ -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=
|
||||
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
|
||||
[](https://pkg.go.dev/github.com/moby/moby/client)
|
||||

|
||||
[](https://goreportcard.com/report/github.com/moby/moby/client)
|
||||
[](https://scorecard.dev/viewer/?uri=github.com/moby/moby)
|
||||
[](https://www.bestpractices.dev/projects/10989)
|
||||
|
||||
|
||||
+10
-9
@@ -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)
|
||||
}
|
||||
|
||||
+2
-1
@@ -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.
|
||||
|
||||
+2
-1
@@ -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.
|
||||
|
||||
+9
-5
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+20
-4
@@ -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
|
||||
|
||||
+3
-2
@@ -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
|
||||
|
||||
Vendored
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user