Skip to content

Commit 1393854

Browse files
authored
fix(logs): flush Argo workflow log stream (#364)
1 parent 70c030f commit 1393854

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.15.2] - 2022-10-12
8+
### Changed
9+
* Flush Argo Workflow log stream
10+
711
## [0.15.1] - 2022-10-11
812
### Changed
913
* Remove Argo Workflow status call from log streaming

service/internal/workflow/workflow.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ func (a ArgoWorkflow) Logs(ctx context.Context, workflowName string) (*Logs, err
133133
}
134134

135135
// LogStream returns a log stream for a workflow.
136-
func (a ArgoWorkflow) LogStream(ctx context.Context, workflowName string, w http.ResponseWriter) error {
137-
stream, err := a.svc.WorkflowLogs(ctx, &argoWorkflowAPIClient.WorkflowLogRequest{
136+
func (a ArgoWorkflow) LogStream(argoCtx context.Context, workflowName string, w http.ResponseWriter) error {
137+
stream, err := a.svc.WorkflowLogs(argoCtx, &argoWorkflowAPIClient.WorkflowLogRequest{
138138
Name: workflowName,
139139
Namespace: a.namespace,
140140
LogOptions: &v1.PodLogOptions{
@@ -157,6 +157,7 @@ func (a ArgoWorkflow) LogStream(ctx context.Context, workflowName string, w http
157157
}
158158

159159
fmt.Fprintf(w, "%s: %s\n", event.PodName, event.Content)
160+
w.(http.Flusher).Flush()
160161
}
161162
}
162163

0 commit comments

Comments
 (0)