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:
Sebastiaan van Stijn
2016-11-22 14:51:22 +01:00
parent 054e479bfa
commit 05dc9846e1
5 changed files with 14 additions and 21 deletions

View File

@@ -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)