mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
remove client-side for supported logging drivers
The `docker logs` command performed a client-side check if the container's logging driver was supported. Now that we allow the client to connect to both "older" and "newer" daemon versions, this check is best done daemon-side. This patch remove the check on the client side, and leaves validation to the daemon, which should be the source of truth. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -21,13 +21,16 @@ import (
|
||||
// ContainerLogs hooks up a container's stdout and stderr streams
|
||||
// configured with the given struct.
|
||||
func (daemon *Daemon) ContainerLogs(ctx context.Context, containerName string, config *backend.ContainerLogsConfig, started chan struct{}) error {
|
||||
if !(config.ShowStdout || config.ShowStderr) {
|
||||
return fmt.Errorf("You must choose at least one stream")
|
||||
}
|
||||
container, err := daemon.GetContainer(containerName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !(config.ShowStdout || config.ShowStderr) {
|
||||
return fmt.Errorf("You must choose at least one stream")
|
||||
if container.HostConfig.LogConfig.Type == "none" {
|
||||
return logger.ErrReadLogsNotSupported
|
||||
}
|
||||
|
||||
cLog, err := daemon.getLogger(container)
|
||||
|
||||
Reference in New Issue
Block a user