backport of commit df16c96a9fc6bfaf2afd661cb2bebb30a9e5b2d4 (#18640)

Co-authored-by: James Rasell <jrasell@users.noreply.github.com>
This commit is contained in:
hc-github-team-nomad-core 2023-10-03 04:39:12 -05:00 committed by GitHub
parent 57c97b39b1
commit 5147682d40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

3
.changelog/18604.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
cli: Use same offset when following single or multiple alloc logs
```

View File

@ -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.