Skip to content

Commit bf83ff3

Browse files
fix duplicated log entries when streaming logs (#95)
1 parent a0b06f3 commit bf83ff3

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
* Updated argo-workflows to v3.1.8 to address CVE-2021-37914
2121
(https://github.com/argoproj/argo-workflows/security/advisories/GHSA-h563-xh25-x54q).
2222

23+
### Fixed
24+
* Duplicated log entries when streaming logs.
25+
2326
## [0.8.1] - 2021-08-20
2427
### Fixed
2528
* Target credential_type only supports 'assumed_role'.

cli/cmd/logs.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ var logsCmd = &cobra.Command{
2525
if streamLogs {
2626
// This is a _very_ simple approach to streaming.
2727
cobra.CheckErr(apiCl.StreamLogs(context.Background(), os.Stdout, workflowName))
28+
} else {
29+
resp, err := apiCl.GetLogs(context.Background(), workflowName)
30+
if err != nil {
31+
cobra.CheckErr(err)
32+
}
33+
fmt.Println(strings.Join(resp.Logs, "\n"))
2834
}
29-
30-
resp, err := apiCl.GetLogs(context.Background(), workflowName)
31-
if err != nil {
32-
cobra.CheckErr(err)
33-
}
34-
35-
fmt.Println(strings.Join(resp.Logs, "\n"))
3635
},
3736
}
3837

0 commit comments

Comments
 (0)