From ee907b7b217e9a37fe57fcfd68b67a162cbc1f10 Mon Sep 17 00:00:00 2001 From: kun Date: Tue, 24 Apr 2018 10:33:02 +0800 Subject: [PATCH] remove log format type check Option `LogConfig` is omitempty in config. That means we allow `c.HostConfig.LogConfig` is nil. There is no need to check the log type, we don't use it now in log sub command, maybe in the furture. --- cli/logs.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/cli/logs.go b/cli/logs.go index 4a19e83ca..8301c8bf1 100644 --- a/cli/logs.go +++ b/cli/logs.go @@ -63,15 +63,6 @@ func (lc *LogsCommand) runLogs(args []string) error { ctx := context.Background() apiClient := lc.cli.Client() - c, err := apiClient.ContainerGet(ctx, containerName) - if err != nil { - return err - } - - if !validDrivers[c.HostConfig.LogConfig.Type] { - return fmt.Errorf("\"logs\" command is supported only for \"json-file\" and \"journald\" logging drivers (got; %s)", c.HostConfig.LogConfig.Type) - } - opts := types.ContainerLogsOptions{ ShowStdout: true, ShowStderr: true,