Skip to content

Commit 4aa315a

Browse files
authored
fix: fixes first few lines not showing up. fixes #3139 (#3142)
1 parent 7911836 commit 4aa315a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/docker/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func (d *httpClient) ContainerStats(ctx context.Context, id string, stats chan<-
323323
func (d *httpClient) ContainerLogs(ctx context.Context, id string, since time.Time, stdType StdType) (io.ReadCloser, error) {
324324
log.WithField("id", id).WithField("since", since).WithField("stdType", stdType).Debug("streaming logs for container")
325325

326-
sinceQuery := since.Add(time.Millisecond).Format(time.RFC3339Nano)
326+
sinceQuery := since.Add(-50 * time.Millisecond).Format(time.RFC3339Nano)
327327
options := container.LogsOptions{
328328
ShowStdout: stdType&STDOUT != 0,
329329
ShowStderr: stdType&STDERR != 0,

internal/docker/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func Test_dockerClient_ContainerLogs_happy(t *testing.T) {
156156
Follow: true,
157157
Tail: "100",
158158
Timestamps: true,
159-
Since: "2021-01-01T00:00:00.001Z"}
159+
Since: "2020-12-31T23:59:59.95Z"}
160160
proxy.On("ContainerLogs", mock.Anything, id, options).Return(reader, nil)
161161

162162
client := &httpClient{proxy, filters.NewArgs(), Host{ID: "localhost"}, system.Info{}}

0 commit comments

Comments
 (0)