From 9f04558daf87831021b9aa68a36165766c9625a9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 25 Jul 2023 09:09:50 +0200 Subject: [PATCH] vendor: github.com/docker/cli v24.0.5 Fix a panic when `auths: null` is found in the CLI config file. full diff: https://github.com/docker/cli/compare/v24.0.4...v24.0.5 Signed-off-by: Sebastiaan van Stijn (cherry picked from commit ab4585f38c9aed781ca95d83c38d536b093e7e64) Signed-off-by: Sebastiaan van Stijn --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/docker/cli/cli/config/configfile/file.go | 3 +++ .../docker/cli/cli/config/credentials/file_store.go | 3 ++- vendor/modules.txt | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 14769000..a5ff89a6 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/containerd/containerd v1.7.2 github.com/containerd/continuity v0.4.1 github.com/containerd/typeurl/v2 v2.1.1 - github.com/docker/cli v24.0.4+incompatible + github.com/docker/cli v24.0.5+incompatible github.com/docker/cli-docs-tool v0.6.0 github.com/docker/distribution v2.8.2+incompatible github.com/docker/docker v24.0.5+incompatible diff --git a/go.sum b/go.sum index 498fa2e5..41f729d3 100644 --- a/go.sum +++ b/go.sum @@ -149,8 +149,8 @@ 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/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/docker/cli v24.0.4+incompatible h1:Y3bYF9ekNTm2VFz5U/0BlMdJy73D+Y1iAAZ8l63Ydzw= -github.com/docker/cli v24.0.4+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rMi4aXAvodc= +github.com/docker/cli v24.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli-docs-tool v0.6.0 h1:Z9x10SaZgFaB6jHgz3OWooynhSa40CsWkpe5hEnG/qA= github.com/docker/cli-docs-tool v0.6.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= diff --git a/vendor/github.com/docker/cli/cli/config/configfile/file.go b/vendor/github.com/docker/cli/cli/config/configfile/file.go index 5db7f8b8..442c3111 100644 --- a/vendor/github.com/docker/cli/cli/config/configfile/file.go +++ b/vendor/github.com/docker/cli/cli/config/configfile/file.go @@ -94,6 +94,9 @@ func (configFile *ConfigFile) ContainsAuth() bool { // GetAuthConfigs returns the mapping of repo to auth configuration func (configFile *ConfigFile) GetAuthConfigs() map[string]types.AuthConfig { + if configFile.AuthConfigs == nil { + configFile.AuthConfigs = make(map[string]types.AuthConfig) + } return configFile.AuthConfigs } diff --git a/vendor/github.com/docker/cli/cli/config/credentials/file_store.go b/vendor/github.com/docker/cli/cli/config/credentials/file_store.go index de1c676e..ea30fc30 100644 --- a/vendor/github.com/docker/cli/cli/config/credentials/file_store.go +++ b/vendor/github.com/docker/cli/cli/config/credentials/file_store.go @@ -52,7 +52,8 @@ func (c *fileStore) GetAll() (map[string]types.AuthConfig, error) { // Store saves the given credentials in the file store. func (c *fileStore) Store(authConfig types.AuthConfig) error { - c.file.GetAuthConfigs()[authConfig.ServerAddress] = authConfig + authConfigs := c.file.GetAuthConfigs() + authConfigs[authConfig.ServerAddress] = authConfig return c.file.Save() } diff --git a/vendor/modules.txt b/vendor/modules.txt index a00a8516..2737c0ef 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -206,7 +206,7 @@ github.com/davecgh/go-spew/spew # github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa ## explicit; go 1.18 github.com/distribution/distribution/v3/reference -# github.com/docker/cli v24.0.4+incompatible +# github.com/docker/cli v24.0.5+incompatible ## explicit github.com/docker/cli/cli github.com/docker/cli/cli-plugins/manager