@@ -198,18 +198,19 @@ func isTransientError(err error) bool {
198
198
}
199
199
200
200
func tail (ctx context.Context , provider client.Provider , projectName string , options TailOptions ) error {
201
- var since , until * timestamppb.Timestamp
201
+ var sinceTs , untilTs * timestamppb.Timestamp
202
202
if pkg .IsValidTime (options .Since ) {
203
- since = timestamppb .New (options .Since )
203
+ sinceTs = timestamppb .New (options .Since )
204
204
} else {
205
205
options .Since = time .Now () // this is used to continue from the last timestamp
206
206
}
207
207
if pkg .IsValidTime (options .Until ) {
208
- until = timestamppb .New (options .Until )
208
+ until := options .Until .Add (time .Millisecond ) // add a millisecond to make it inclusive
209
+ untilTs = timestamppb .New (until )
209
210
// If the user specifies a deadline in the future, we should respect it
210
- if options . Until .After (time .Now ()) {
211
+ if until .After (time .Now ()) {
211
212
var cancel context.CancelFunc
212
- ctx , cancel = context .WithDeadline (ctx , options . Until )
213
+ ctx , cancel = context .WithDeadline (ctx , until )
213
214
defer cancel ()
214
215
}
215
216
}
@@ -220,8 +221,8 @@ func tail(ctx context.Context, provider client.Provider, projectName string, opt
220
221
Pattern : options .Filter ,
221
222
Project : projectName ,
222
223
Services : options .Services ,
223
- Since : since , // this is also used to continue from the last timestamp
224
- Until : until ,
224
+ Since : sinceTs , // this is also used to continue from the last timestamp
225
+ Until : untilTs ,
225
226
}
226
227
227
228
serverStream , err := provider .QueryLogs (ctx , tailRequest )
0 commit comments