From df16c96a9fc6bfaf2afd661cb2bebb30a9e5b2d4 Mon Sep 17 00:00:00 2001 From: James Rasell Date: Tue, 3 Oct 2023 08:43:14 +0100 Subject: [PATCH] cli: use same offset when following single or multiple alloc logs. (#18604) --- .changelog/18604.txt | 3 +++ command/alloc_logs.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .changelog/18604.txt diff --git a/.changelog/18604.txt b/.changelog/18604.txt new file mode 100644 index 00000000000..34bfc0c446a --- /dev/null +++ b/.changelog/18604.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: Use same offset when following single or multiple alloc logs +``` diff --git a/command/alloc_logs.go b/command/alloc_logs.go index 45a1341921e..fb430a753ca 100644 --- a/command/alloc_logs.go +++ b/command/alloc_logs.go @@ -358,7 +358,7 @@ func (l *AllocLogsCommand) tailMultipleFiles(client *api.Client, alloc *api.Allo defer close(cancel) stdoutFrames, stdoutErrCh := client.AllocFS().Logs( - alloc, true, l.task, api.FSLogNameStdout, api.OriginEnd, 1, cancel, nil) + alloc, true, l.task, api.FSLogNameStdout, api.OriginEnd, 0, cancel, nil) // Setting up the logs stream can fail, therefore we need to check the // error channel before continuing further. @@ -369,7 +369,7 @@ func (l *AllocLogsCommand) tailMultipleFiles(client *api.Client, alloc *api.Allo } stderrFrames, stderrErrCh := client.AllocFS().Logs( - alloc, true, l.task, api.FSLogNameStderr, api.OriginEnd, 1, cancel, nil) + alloc, true, l.task, api.FSLogNameStderr, api.OriginEnd, 0, cancel, nil) // Setting up the logs stream can fail, therefore we need to check the // error channel before continuing further.