cli/cli
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
..
command registry: don't call "/info" API endpoint to get default registry 2022-03-15 16:30:42 +01:00
compose cli/compose/schema: make version: "3" equivalent to "3.x" (latest) 2022-03-01 09:40:33 +01:00
config cli/config: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:42:15 +01:00
connhelper Use designated test domains (RFC2606) in tests 2021-04-30 10:03:45 +02:00
context remove unneeded "digest" alias for "go-digest" 2022-03-04 14:45:37 +01:00
debug updated vendoring 2017-09-01 19:41:06 -04:00
flags Update list commands with better format flag description 2022-03-15 15:35:53 +01:00
manifest remove unneeded "digest" alias for "go-digest" 2022-03-04 14:45:37 +01:00
registry/client remove unneeded "digest" alias for "go-digest" 2022-03-04 14:45:37 +01:00
streams update docker, replace github.com/docker/pkg/term, github.com/docker/pkg/mount 2020-04-22 17:16:13 +02:00
trust remove unneeded "digest" alias for "go-digest" 2022-03-04 14:45:37 +01:00
version Move versioning variables to a separate package. 2019-01-29 11:26:40 +00:00
winresources Use goversioninfo to create Windows Version Info 2021-10-11 16:54:22 +02:00
cobra.go remove alias for cli/config imports 2022-03-04 14:45:33 +01:00
cobra_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-23 00:28:55 +01:00
error.go
required.go Disable unparam linter: cli/required.go:102:16: `pluralize` - `word` always receives `"argument"` (unparam) 2019-10-31 19:22:22 +01:00
required_test.go cli: remove deprecated io/ioutil 2022-02-25 15:42:19 +01:00