1
0
mirror of https://github.com/docker/cli.git synced 2026-01-25 03:42:05 +03:00

service logs: Support no-follow mode

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: c2d435e4f05d262aaa3d4d5cc2fe8965377eebdf
Component: engine
This commit is contained in:
Andrea Luzzardi
2016-11-18 12:38:36 -08:00
parent 5e08f57e6b
commit abd795e582
4 changed files with 44 additions and 13 deletions

View File

@@ -1275,7 +1275,7 @@ func (c *Cluster) ServiceLogs(ctx context.Context, input string, config *backend
ServiceIDs: []string{service.ID},
},
Options: &swarmapi.LogSubscriptionOptions{
Follow: true,
Follow: config.Follow,
},
})
if err != nil {

View File

@@ -419,7 +419,11 @@ func (c *containerAdapter) logs(ctx context.Context, options api.LogSubscription
}
chStarted := make(chan struct{})
go c.backend.ContainerLogs(ctx, c.container.name(), apiOptions, chStarted)
go func() {
defer writer.Close()
c.backend.ContainerLogs(ctx, c.container.name(), apiOptions, chStarted)
}()
return reader, nil
}