vendor: github.com/docker/docker v23.0.6

full diff:
- https://github.com/docker/docker/compare/v23.0.1...v23.0.6
- https://github.com/docker/cli/compare/v23.0.1...v23.0.6

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
pull/1788/head
CrazyMax 2 years ago
parent 1eb9ad979e
commit 45a2ae6762
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

@ -9,10 +9,10 @@ require (
github.com/containerd/console v1.0.3 github.com/containerd/console v1.0.3
github.com/containerd/containerd v1.7.0 github.com/containerd/containerd v1.7.0
github.com/containerd/typeurl/v2 v2.1.0 github.com/containerd/typeurl/v2 v2.1.0
github.com/docker/cli v23.0.1+incompatible github.com/docker/cli v23.0.6+incompatible
github.com/docker/cli-docs-tool v0.5.1 github.com/docker/cli-docs-tool v0.5.1
github.com/docker/distribution v2.8.1+incompatible github.com/docker/distribution v2.8.1+incompatible
github.com/docker/docker v23.0.1+incompatible github.com/docker/docker v23.0.6+incompatible
github.com/docker/go-units v0.5.0 github.com/docker/go-units v0.5.0
github.com/gofrs/flock v0.8.1 github.com/gofrs/flock v0.8.1
github.com/gogo/protobuf v1.3.2 github.com/gogo/protobuf v1.3.2

@ -170,14 +170,14 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa h1:L9Ay/slwQ4ERSPaurC+TVkZrM0K98GNrEEo1En3e8as= github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa h1:L9Ay/slwQ4ERSPaurC+TVkZrM0K98GNrEEo1En3e8as=
github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI=
github.com/docker/cli v23.0.1+incompatible h1:LRyWITpGzl2C9e9uGxzisptnxAn1zfZKXy13Ul2Q5oM= github.com/docker/cli v23.0.6+incompatible h1:CScadyCJ2ZKUDpAMZta6vK8I+6/m60VIjGIV7Wg/Eu4=
github.com/docker/cli v23.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v23.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli-docs-tool v0.5.1 h1:jIk/cCZurZERhALPVKhqlNxTQGxn2kcI+56gE57PQXg= github.com/docker/cli-docs-tool v0.5.1 h1:jIk/cCZurZERhALPVKhqlNxTQGxn2kcI+56gE57PQXg=
github.com/docker/cli-docs-tool v0.5.1/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o= github.com/docker/cli-docs-tool v0.5.1/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v23.0.1+incompatible h1:vjgvJZxprTTE1A37nm+CLNAdwu6xZekyoiVlUZEINcY= github.com/docker/docker v23.0.6+incompatible h1:aBD4np894vatVX99UTx/GyOUOK4uEcROwA3+bQhEcoU=
github.com/docker/docker v23.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v23.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=

@ -3,6 +3,7 @@ package manager
import ( import (
"fmt" "fmt"
"os" "os"
"sync"
"github.com/docker/cli/cli/command" "github.com/docker/cli/cli/command"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -31,64 +32,69 @@ const (
CommandAnnotationPluginInvalid = "com.docker.cli.plugin-invalid" CommandAnnotationPluginInvalid = "com.docker.cli.plugin-invalid"
) )
var pluginCommandStubsOnce sync.Once
// AddPluginCommandStubs adds a stub cobra.Commands for each valid and invalid // AddPluginCommandStubs adds a stub cobra.Commands for each valid and invalid
// plugin. The command stubs will have several annotations added, see // plugin. The command stubs will have several annotations added, see
// `CommandAnnotationPlugin*`. // `CommandAnnotationPlugin*`.
func AddPluginCommandStubs(dockerCli command.Cli, rootCmd *cobra.Command) error { func AddPluginCommandStubs(dockerCli command.Cli, rootCmd *cobra.Command) (err error) {
plugins, err := ListPlugins(dockerCli, rootCmd) pluginCommandStubsOnce.Do(func() {
if err != nil { var plugins []Plugin
return err plugins, err = ListPlugins(dockerCli, rootCmd)
} if err != nil {
for _, p := range plugins { return
p := p
vendor := p.Vendor
if vendor == "" {
vendor = "unknown"
}
annotations := map[string]string{
CommandAnnotationPlugin: "true",
CommandAnnotationPluginVendor: vendor,
CommandAnnotationPluginVersion: p.Version,
} }
if p.Err != nil { for _, p := range plugins {
annotations[CommandAnnotationPluginInvalid] = p.Err.Error() p := p
} vendor := p.Vendor
rootCmd.AddCommand(&cobra.Command{ if vendor == "" {
Use: p.Name, vendor = "unknown"
Short: p.ShortDescription, }
Run: func(_ *cobra.Command, _ []string) {}, annotations := map[string]string{
Annotations: annotations, CommandAnnotationPlugin: "true",
DisableFlagParsing: true, CommandAnnotationPluginVendor: vendor,
RunE: func(cmd *cobra.Command, args []string) error { CommandAnnotationPluginVersion: p.Version,
flags := rootCmd.PersistentFlags() }
flags.SetOutput(nil) if p.Err != nil {
err := flags.Parse(args) annotations[CommandAnnotationPluginInvalid] = p.Err.Error()
if err != nil { }
return err rootCmd.AddCommand(&cobra.Command{
} Use: p.Name,
if flags.Changed("help") { Short: p.ShortDescription,
cmd.HelpFunc()(rootCmd, args) Run: func(_ *cobra.Command, _ []string) {},
return nil Annotations: annotations,
} DisableFlagParsing: true,
return fmt.Errorf("docker: '%s' is not a docker command.\nSee 'docker --help'", cmd.Name()) RunE: func(cmd *cobra.Command, args []string) error {
}, flags := rootCmd.PersistentFlags()
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { flags.SetOutput(nil)
// Delegate completion to plugin perr := flags.Parse(args)
cargs := []string{p.Path, cobra.ShellCompRequestCmd, p.Name} if perr != nil {
cargs = append(cargs, args...) return err
cargs = append(cargs, toComplete) }
os.Args = cargs if flags.Changed("help") {
runCommand, err := PluginRunCommand(dockerCli, p.Name, cmd) cmd.HelpFunc()(rootCmd, args)
if err != nil { return nil
}
return fmt.Errorf("docker: '%s' is not a docker command.\nSee 'docker --help'", cmd.Name())
},
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
// Delegate completion to plugin
cargs := []string{p.Path, cobra.ShellCompRequestCmd, p.Name}
cargs = append(cargs, args...)
cargs = append(cargs, toComplete)
os.Args = cargs
runCommand, runErr := PluginRunCommand(dockerCli, p.Name, cmd)
if runErr != nil {
return nil, cobra.ShellCompDirectiveError
}
runErr = runCommand.Run()
if runErr == nil {
os.Exit(0) // plugin already rendered complete data
}
return nil, cobra.ShellCompDirectiveError return nil, cobra.ShellCompDirectiveError
} },
err = runCommand.Run() })
if err == nil { }
os.Exit(0) // plugin already rendered complete data })
} return err
return nil, cobra.ShellCompDirectiveError
},
})
}
return nil
} }

@ -1,15 +1,18 @@
package manager package manager
import ( import (
"context"
"os" "os"
"path/filepath" "path/filepath"
"sort" "sort"
"strings" "strings"
"sync"
"github.com/docker/cli/cli/command" "github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/config" "github.com/docker/cli/cli/config"
"github.com/fvbommel/sortorder" "github.com/fvbommel/sortorder"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
exec "golang.org/x/sys/execabs" exec "golang.org/x/sys/execabs"
) )
@ -120,7 +123,7 @@ func GetPlugin(name string, dockerCli command.Cli, rootcmd *cobra.Command) (*Plu
return nil, errPluginNotFound(name) return nil, errPluginNotFound(name)
} }
c := &candidate{paths[0]} c := &candidate{paths[0]}
p, err := newPlugin(c, rootcmd) p, err := newPlugin(c, rootcmd.Commands())
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -146,19 +149,32 @@ func ListPlugins(dockerCli command.Cli, rootcmd *cobra.Command) ([]Plugin, error
} }
var plugins []Plugin var plugins []Plugin
var mu sync.Mutex
eg, _ := errgroup.WithContext(context.TODO())
cmds := rootcmd.Commands()
for _, paths := range candidates { for _, paths := range candidates {
if len(paths) == 0 { func(paths []string) {
continue eg.Go(func() error {
} if len(paths) == 0 {
c := &candidate{paths[0]} return nil
p, err := newPlugin(c, rootcmd) }
if err != nil { c := &candidate{paths[0]}
return nil, err p, err := newPlugin(c, cmds)
} if err != nil {
if !IsNotFound(p.Err) { return err
p.ShadowedPaths = paths[1:] }
plugins = append(plugins, p) if !IsNotFound(p.Err) {
} p.ShadowedPaths = paths[1:]
mu.Lock()
defer mu.Unlock()
plugins = append(plugins, p)
}
return nil
})
}(paths)
}
if err := eg.Wait(); err != nil {
return nil, err
} }
sort.Slice(plugins, func(i, j int) bool { sort.Slice(plugins, func(i, j int) bool {
@ -199,7 +215,7 @@ func PluginRunCommand(dockerCli command.Cli, name string, rootcmd *cobra.Command
} }
c := &candidate{path: path} c := &candidate{path: path}
plugin, err := newPlugin(c, rootcmd) plugin, err := newPlugin(c, rootcmd.Commands())
if err != nil { if err != nil {
return nil, err return nil, err
} }

@ -31,7 +31,7 @@ type Plugin struct {
// is set, and is always a `pluginError`, but the `Plugin` is still // is set, and is always a `pluginError`, but the `Plugin` is still
// returned with no error. An error is only returned due to a // returned with no error. An error is only returned due to a
// non-recoverable error. // non-recoverable error.
func newPlugin(c Candidate, rootcmd *cobra.Command) (Plugin, error) { func newPlugin(c Candidate, cmds []*cobra.Command) (Plugin, error) {
path := c.Path() path := c.Path()
if path == "" { if path == "" {
return Plugin{}, errors.New("plugin candidate path cannot be empty") return Plugin{}, errors.New("plugin candidate path cannot be empty")
@ -62,22 +62,20 @@ func newPlugin(c Candidate, rootcmd *cobra.Command) (Plugin, error) {
return p, nil return p, nil
} }
if rootcmd != nil { for _, cmd := range cmds {
for _, cmd := range rootcmd.Commands() { // Ignore conflicts with commands which are
// Ignore conflicts with commands which are // just plugin stubs (i.e. from a previous
// just plugin stubs (i.e. from a previous // call to AddPluginCommandStubs).
// call to AddPluginCommandStubs). if IsPluginCommand(cmd) {
if IsPluginCommand(cmd) { continue
continue }
} if cmd.Name() == p.Name {
if cmd.Name() == p.Name { p.Err = NewPluginError("plugin %q duplicates builtin command", p.Name)
p.Err = NewPluginError("plugin %q duplicates builtin command", p.Name) return p, nil
return p, nil }
} if cmd.HasAlias(p.Name) {
if cmd.HasAlias(p.Name) { p.Err = NewPluginError("plugin %q duplicates an alias of builtin command %q", p.Name, cmd.Name())
p.Err = NewPluginError("plugin %q duplicates an alias of builtin command %q", p.Name, cmd.Name()) return p, nil
return p, nil
}
} }
} }

@ -204,6 +204,16 @@ func DisableFlagsInUseLine(cmd *cobra.Command) {
}) })
} }
// HasCompletionArg returns true if a cobra completion arg request is found.
func HasCompletionArg(args []string) bool {
for _, arg := range args {
if arg == cobra.ShellCompRequestCmd || arg == cobra.ShellCompNoDescRequestCmd {
return true
}
}
return false
}
var helpCommand = &cobra.Command{ var helpCommand = &cobra.Command{
Use: "help [command]", Use: "help [command]",
Short: "Help about the command", Short: "Help about the command",

@ -164,8 +164,8 @@ func (cli *DockerCli) ContentTrustEnabled() bool {
// BuildKitEnabled returns buildkit is enabled or not. // BuildKitEnabled returns buildkit is enabled or not.
func (cli *DockerCli) BuildKitEnabled() (bool, error) { func (cli *DockerCli) BuildKitEnabled() (bool, error) {
// use DOCKER_BUILDKIT env var value if set // use DOCKER_BUILDKIT env var value if set and not empty
if v, ok := os.LookupEnv("DOCKER_BUILDKIT"); ok { if v := os.Getenv("DOCKER_BUILDKIT"); v != "" {
enabled, err := strconv.ParseBool(v) enabled, err := strconv.ParseBool(v)
if err != nil { if err != nil {
return false, errors.Wrap(err, "DOCKER_BUILDKIT environment variable expects boolean value") return false, errors.Wrap(err, "DOCKER_BUILDKIT environment variable expects boolean value")

@ -21,8 +21,9 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// ElectAuthServer returns the default registry to use // ElectAuthServer returns the default registry to use.
// Deprecated: use registry.IndexServer instead //
// Deprecated: use [registry.IndexServer] instead.
func ElectAuthServer(_ context.Context, _ Cli) string { func ElectAuthServer(_ context.Context, _ Cli) string {
return registry.IndexServer return registry.IndexServer
} }
@ -55,9 +56,12 @@ func RegistryAuthenticationPrivilegedFunc(cli Cli, index *registrytypes.IndexInf
} }
} }
// ResolveAuthConfig is like registry.ResolveAuthConfig, but if using the // ResolveAuthConfig returns auth-config for the given registry from the
// default index, it uses the default index name for the daemon's platform, // credential-store. It returns an empty AuthConfig if no credentials were
// not the client's platform. // found.
//
// It is similar to [registry.ResolveAuthConfig], but uses the credentials-
// store, instead of looking up credentials from a map.
func ResolveAuthConfig(_ context.Context, cli Cli, index *registrytypes.IndexInfo) types.AuthConfig { func ResolveAuthConfig(_ context.Context, cli Cli, index *registrytypes.IndexInfo) types.AuthConfig {
configKey := index.Name configKey := index.Name
if index.Official { if index.Official {

@ -1,23 +1,32 @@
package command package command
import ( import (
"io"
"github.com/docker/cli/cli/streams" "github.com/docker/cli/cli/streams"
) )
// InStream is an input stream used by the DockerCli to read user input // InStream is an input stream used by the DockerCli to read user input
// Deprecated: Use github.com/docker/cli/cli/streams.In instead //
// Deprecated: Use [streams.In] instead.
type InStream = streams.In type InStream = streams.In
// OutStream is an output stream used by the DockerCli to write normal program // OutStream is an output stream used by the DockerCli to write normal program
// output. // output.
// Deprecated: Use github.com/docker/cli/cli/streams.Out instead //
// Deprecated: Use [streams.Out] instead.
type OutStream = streams.Out type OutStream = streams.Out
var ( // NewInStream returns a new [streams.In] from an [io.ReadCloser].
// NewInStream returns a new InStream object from a ReadCloser //
// Deprecated: Use github.com/docker/cli/cli/streams.NewIn instead // Deprecated: Use [streams.NewIn] instead.
NewInStream = streams.NewIn func NewInStream(in io.ReadCloser) *streams.In {
// NewOutStream returns a new OutStream object from a Writer return streams.NewIn(in)
// Deprecated: Use github.com/docker/cli/cli/streams.NewOut instead }
NewOutStream = streams.NewOut
) // NewOutStream returns a new [streams.Out] from an [io.Writer].
//
// Deprecated: Use [streams.NewOut] instead.
func NewOutStream(out io.Writer) *streams.Out {
return streams.NewOut(out)
}

@ -2,12 +2,14 @@ package store
import ( import (
"encoding/json" "encoding/json"
"fmt"
"os" "os"
"path/filepath" "path/filepath"
"reflect" "reflect"
"sort" "sort"
"github.com/docker/docker/errdefs" "github.com/docker/docker/errdefs"
"github.com/docker/docker/pkg/ioutils"
"github.com/fvbommel/sortorder" "github.com/fvbommel/sortorder"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
@ -35,7 +37,7 @@ func (s *metadataStore) createOrUpdate(meta Metadata) error {
if err != nil { if err != nil {
return err return err
} }
return os.WriteFile(filepath.Join(contextDir, metaFile), bytes, 0o644) return ioutils.AtomicWriteFile(filepath.Join(contextDir, metaFile), bytes, 0o644)
} }
func parseTypedOrMap(payload []byte, getter TypeGetter) (interface{}, error) { func parseTypedOrMap(payload []byte, getter TypeGetter) (interface{}, error) {
@ -65,7 +67,8 @@ func (s *metadataStore) get(name string) (Metadata, error) {
} }
func (s *metadataStore) getByID(id contextdir) (Metadata, error) { func (s *metadataStore) getByID(id contextdir) (Metadata, error) {
bytes, err := os.ReadFile(filepath.Join(s.contextDir(id), metaFile)) fileName := filepath.Join(s.contextDir(id), metaFile)
bytes, err := os.ReadFile(fileName)
if err != nil { if err != nil {
if errors.Is(err, os.ErrNotExist) { if errors.Is(err, os.ErrNotExist) {
return Metadata{}, errdefs.NotFound(errors.Wrap(err, "context not found")) return Metadata{}, errdefs.NotFound(errors.Wrap(err, "context not found"))
@ -77,15 +80,15 @@ func (s *metadataStore) getByID(id contextdir) (Metadata, error) {
Endpoints: make(map[string]interface{}), Endpoints: make(map[string]interface{}),
} }
if err := json.Unmarshal(bytes, &untyped); err != nil { if err := json.Unmarshal(bytes, &untyped); err != nil {
return Metadata{}, err return Metadata{}, fmt.Errorf("parsing %s: %v", fileName, err)
} }
r.Name = untyped.Name r.Name = untyped.Name
if r.Metadata, err = parseTypedOrMap(untyped.Metadata, s.config.contextType); err != nil { if r.Metadata, err = parseTypedOrMap(untyped.Metadata, s.config.contextType); err != nil {
return Metadata{}, err return Metadata{}, fmt.Errorf("parsing %s: %v", fileName, err)
} }
for k, v := range untyped.Endpoints { for k, v := range untyped.Endpoints {
if r.Endpoints[k], err = parseTypedOrMap(v, s.config.endpointTypes[k]); err != nil { if r.Endpoints[k], err = parseTypedOrMap(v, s.config.endpointTypes[k]); err != nil {
return Metadata{}, err return Metadata{}, fmt.Errorf("parsing %s: %v", fileName, err)
} }
} }
return r, err return r, err

@ -5,6 +5,7 @@ import (
"path/filepath" "path/filepath"
"github.com/docker/docker/errdefs" "github.com/docker/docker/errdefs"
"github.com/docker/docker/pkg/ioutils"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
@ -31,7 +32,7 @@ func (s *tlsStore) createOrUpdate(name, endpointName, filename string, data []by
if err := os.MkdirAll(endpointDir, 0o700); err != nil { if err := os.MkdirAll(endpointDir, 0o700); err != nil {
return err return err
} }
return os.WriteFile(filepath.Join(endpointDir, filename), data, 0o600) return ioutils.AtomicWriteFile(filepath.Join(endpointDir, filename), data, 0o600)
} }
func (s *tlsStore) getData(name, endpointName, filename string) ([]byte, error) { func (s *tlsStore) getData(name, endpointName, filename string) ([]byte, error) {

@ -6,9 +6,10 @@ https://docs.docker.com/engine/api/
# Usage # Usage
You use the library by creating a client object and calling methods on it. The You use the library by constructing a client object using [NewClientWithOpts]
client can be created either from environment variables with NewClientWithOpts(client.FromEnv), and calling methods on it. The client can be configured from environment
or configured manually with NewClient(). variables by passing the [FromEnv] option, or configured manually by passing any
of the other available [Opts].
For example, to list running containers (the equivalent of "docker ps"): For example, to list running containers (the equivalent of "docker ps"):

@ -9,7 +9,11 @@ import "net/http"
// It won't send any version information if the version number is empty. It is // It won't send any version information if the version number is empty. It is
// highly recommended that you set a version or your client may break if the // highly recommended that you set a version or your client may break if the
// server is upgraded. // server is upgraded.
// Deprecated: use NewClientWithOpts //
// Deprecated: use [NewClientWithOpts] passing the [WithHost], [WithVersion],
// [WithHTTPClient] and [WithHTTPHeaders] options. We recommend enabling API
// version negotiation by passing the [WithAPIVersionNegotiation] option instead
// of WithVersion.
func NewClient(host string, version string, client *http.Client, httpHeaders map[string]string) (*Client, error) { func NewClient(host string, version string, client *http.Client, httpHeaders map[string]string) (*Client, error) {
return NewClientWithOpts(WithHost(host), WithVersion(version), WithHTTPClient(client), WithHTTPHeaders(httpHeaders)) return NewClientWithOpts(WithHost(host), WithVersion(version), WithHTTPClient(client), WithHTTPHeaders(httpHeaders))
} }
@ -17,7 +21,7 @@ func NewClient(host string, version string, client *http.Client, httpHeaders map
// NewEnvClient initializes a new API client based on environment variables. // NewEnvClient initializes a new API client based on environment variables.
// See FromEnv for a list of support environment variables. // See FromEnv for a list of support environment variables.
// //
// Deprecated: use NewClientWithOpts(FromEnv) // Deprecated: use [NewClientWithOpts] passing the [FromEnv] option.
func NewEnvClient() (*Client, error) { func NewEnvClient() (*Client, error) {
return NewClientWithOpts(FromEnv) return NewClientWithOpts(FromEnv)
} }

@ -711,7 +711,7 @@ func createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, L
} }
} }
case tar.TypeReg, tar.TypeRegA: case tar.TypeReg:
// Source is regular file. We use sequential file access to avoid depleting // Source is regular file. We use sequential file access to avoid depleting
// the standby list on Windows. On Linux, this equates to a regular os.OpenFile. // the standby list on Windows. On Linux, this equates to a regular os.OpenFile.
file, err := sequential.OpenFile(path, os.O_CREATE|os.O_WRONLY, hdrInfo.Mode()) file, err := sequential.OpenFile(path, os.O_CREATE|os.O_WRONLY, hdrInfo.Mode())

@ -211,7 +211,7 @@ github.com/davecgh/go-spew/spew
# github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa # github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa
## explicit; go 1.18 ## explicit; go 1.18
github.com/distribution/distribution/v3/reference github.com/distribution/distribution/v3/reference
# github.com/docker/cli v23.0.1+incompatible # github.com/docker/cli v23.0.6+incompatible
## explicit ## explicit
github.com/docker/cli/cli github.com/docker/cli/cli
github.com/docker/cli/cli-plugins/manager github.com/docker/cli/cli-plugins/manager
@ -259,7 +259,7 @@ github.com/docker/distribution/registry/client/transport
github.com/docker/distribution/registry/storage/cache github.com/docker/distribution/registry/storage/cache
github.com/docker/distribution/registry/storage/cache/memory github.com/docker/distribution/registry/storage/cache/memory
github.com/docker/distribution/uuid github.com/docker/distribution/uuid
# github.com/docker/docker v23.0.1+incompatible # github.com/docker/docker v23.0.6+incompatible
## explicit ## explicit
github.com/docker/docker/api github.com/docker/docker/api
github.com/docker/docker/api/types github.com/docker/docker/api/types

Loading…
Cancel
Save