Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: log api call handling. Fixes: #13585 #13866

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/workflow/workflow_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ func TestPodLogs(t *testing.T) {
err := server.PodLogs(&workflowpkg.WorkflowLogRequest{
Name: "hello-world-9tql2",
Namespace: "workflows",
LogOptions: &corev1.PodLogOptions{},
LogOptions: &corev1.PodLogOptions{Container: "main"},
}, &testPodLogsServer{testServerStream{ctx}})
assert.NoError(t, err)
}()
Expand Down
4 changes: 4 additions & 0 deletions util/logs/workflow-logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ func WorkflowLogs(ctx context.Context, wfClient versioned.Interface, kubeClient
logOptions = &corev1.PodLogOptions{}
}
logCtx.WithField("options", logOptions).Debug("Log options")
// todo this should really check if the container name exists in the pod
if logOptions.Container == "" {
return fmt.Errorf("container name must be specified")
}

// make a copy of requested log options and set timestamps to true, so they can be parsed out later
podLogStreamOptions := *logOptions
Expand Down
Loading