Un-export or remove utilities that have no (external) users;
- AuxFormatter (not used)
- FormatError (only used internally)
- FormatStatus (only used internally)
- NewJSONProgressOutput (used by CLI)
- NewProgressOutput (used by compose, cli for classic builder)
- NewStderrWriter (not used)
- NewStdoutWriter (not used)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Make sure Cobra is configured with the streams we use, and use
Cobra's utilities to print the validation messsage.
While updating, also add a short comment outlining why we're using
STDERR, not STDOUT for this message.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The README was useful when it was pointing to docker.go and when
docker.go contained the arg parsing and env setting code, but the
structure was simplified by @dmcgowan in 33139da522
It seems pointless to update it to say:
> main.go contains Docker daemon's main function.
and this part is out of date
> This file provides first line CLI argument parsing and environment variable setting.
It seems redundant with the new simpler structure, so delete it.
Signed-off-by: David Scott <dave@recoil.org>
This workaround was added in 3bb40af036 to
work around a limitation of Cobra, which didn't support completion if there
are no subcommands, because [Command.InitDefaultCompletionCmd] disabled
completion, as implicitly adding the hidden `completion` and `__complete`
subcommands would break binaries without subcommands that accepted positional
args.
This problem was fixed in Cobra v1.9.0 through [cobra@24ada7f], which now
dynamically adds the `completion` subcommand when invoked.
This patch removes the hidden `__dummy_command`, which was used to work around
the logic in Cobra < v1.9.0, and to make it enable completion regardless.
Completion should still work as usual:
dockerd completion --help
Usage: dockerd completion [flags]
...
source <(dockerd completion bash)
dockerd --default-<tab>
--default-address-pool (Default address pools for node specific local networks)
--default-cgroupns-mode (Default mode for containers cgroup namespace ("host" | "private"))
--default-gateway (Default gateway IPv4 address for the default bridge network)
--default-gateway-v6 (Default gateway IPv6 address for the default bridge network)
--default-ipc-mode (Default mode for containers ipc ("shareable" | "private"))
--default-network-opt (Default network options)
--default-runtime (Default OCI runtime for containers)
--default-shm-size (Default shm size for containers)
--default-ulimit (Default ulimits for containers)
[Command.InitDefaultCompletionCmd]: https://github.com/spf13/cobra/blob/v1.8.1/completions.go#L685-L698
[cobra@24ada7f]: 24ada7fe71
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Update the version of containerd used in CI and for static binaries
to v2.1.5 (linux) and v2.0.7 (windows)
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>