From 773f4e96e8cece6f81f6d94373815b596356979f Mon Sep 17 00:00:00 2001 From: hc-github-team-nomad-core <82989552+hc-github-team-nomad-core@users.noreply.github.com> Date: Tue, 3 Oct 2023 04:39:12 -0500 Subject: [PATCH] backport of commit df16c96a9fc6bfaf2afd661cb2bebb30a9e5b2d4 (#18640) Co-authored-by: James Rasell --- .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 090f17a7502..505211a7fd1 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.