DockerCLI/cli/command
Sebastiaan van Stijn b4ca1c7368
registry: don't call "/info" API endpoint to get default registry
The CLI currenly calls the `/info` endpoint to get the address
of the default registry to use.

This functionality was added as part of the initial Windows implementation
of the engine. For legal reasons, Microsoft Windows (and thus Docker images
based on Windows) were not allowed to be distributed through non-Microsoft
infrastructure. As a temporary solution, a dedicated "registry-win-tp3.docker.io"
registry was created to serve Windows images.

As a result, the default registry was no longer "fixed", so a helper function
(`ElectAuthServer`) was added to allow the CLI to get the correct registry
address from the daemon. (docker/docker PR's/issues 18019, 19891, 19973)

Using separate registries was not an ideal solution, and a more permanent
solution was created by introducing "foreign image layers" in the distribution
spec, after which the "registry-win-tp3.docker.io" ceased to exist, and
removed from the engine through docker/docker PR 21100.

However, the `ElectAuthServer` was left in place, quoting from that PR;

> make the client check which default registry the daemon uses is still
> more correct than leaving it up to the client, even if it won't technically
> matter after this PR. There may be some backward compatibility scenarios
> where `ElectAuthServer` [sic] is still helpful.

That comment was 5 years ago, and given that the engine and cli are
released in tandem, and the default registry is not configurable, we
can save the extra roundtrip to the daemon by using a fixed value.

This patch deprecates the `ElectAuthServer` function, and makes it
return the default registry without calling (potentially expensie)
`/info` API endpoint.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-15 16:30:42 +01:00
..
builder Fix builder prune -a/--all flag description 2020-02-18 14:30:28 +01:00
checkpoint cli/command/checkpoint: remove deprecated io/ioutil 2022-02-25 15:35:51 +01:00
commands Remove "docker engine" subcommands 2019-12-12 17:51:25 +01:00
config Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
container Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
context Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
formatter Added "json" as specific value for --format flag in list commands, as an alias to `{{json .}}` 2022-03-15 15:33:19 +01:00
idresolver bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-23 00:28:55 +01:00
image Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
inspect Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
manifest remove unneeded "digest" alias for "go-digest" 2022-03-04 14:45:37 +01:00
network Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
node Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
plugin Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
registry registry: don't call "/info" API endpoint to get default registry 2022-03-15 16:30:42 +01:00
secret Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
service Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
stack Update list commands with better format flag description 2022-03-15 15:35:53 +01:00
swarm cli/command/swarm: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:42:11 +01:00
system Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
task formatter: reduce minimum width for columns in table-view 2020-08-31 16:31:15 +02:00
testdata Dynamically register kubernetes context store endpoint type. 2019-05-20 13:28:11 +01:00
trust cli/command/trust: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:42:12 +01:00
volume Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
cli.go Merge pull request #3136 from thaJeztah/remove_clientinfo 2022-03-15 15:12:22 +01:00
cli_options.go Implement WithDefaultContextStoreConfig() DockerCliOption 2022-03-03 14:47:59 +01:00
cli_options_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-23 00:28:55 +01:00
cli_test.go Merge pull request #3136 from thaJeztah/remove_clientinfo 2022-03-15 15:12:22 +01:00
context.go remove obsolete mutli-orchestrator support 2022-02-22 15:28:12 +01:00
context_test.go remove obsolete mutli-orchestrator support 2022-02-22 15:28:12 +01:00
defaultcontextstore.go remove obsolete mutli-orchestrator support 2022-02-22 15:28:12 +01:00
defaultcontextstore_test.go cli/command: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:42:14 +01:00
events_utils.go updated vendoring 2017-09-01 19:41:06 -04:00
registry.go registry: don't call "/info" API endpoint to get default registry 2022-03-15 16:30:42 +01:00
registry_test.go registry: don't call "/info" API endpoint to get default registry 2022-03-15 16:30:42 +01:00
streams.go Extract streams helpers from command package to their own package to remove a cyclic dependency from command to internal/containerizedengine 2019-01-28 14:36:00 +01:00
trust.go Refactor content_trust cli/flags handling 2018-03-08 15:00:43 -05:00
utils.go build: remove PersistentPreRunE hack for experimental --platform 2020-11-16 14:58:11 +01:00
utils_test.go cli/command: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:42:14 +01:00