Skip to content

Commit

Permalink
remove log format type check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oiooj committed Apr 24, 2018
1 parent 2812ca0 commit ee907b7
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions cli/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ee907b7

Please sign in to comment.