Skip to content

Commit

Permalink
fix: No panic on watch. Fixes #3411 (#3426)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Jul 8, 2020
1 parent b4da1bc commit 910f636
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cmd/argo/commands/watch.go
Expand Up @@ -72,8 +72,12 @@ func watchWorkflow(ctx context.Context, serviceClient workflowpkg.WorkflowServic
log.Debug("Re-establishing workflow watch")
stream, err = serviceClient.WatchWorkflows(ctx, req)
errors.CheckError(err)
continue
}
errors.CheckError(err)
if event == nil {
continue
}
wfChan <- event.Object
}
}()
Expand Down
5 changes: 4 additions & 1 deletion util/logs/workflow-logger.go
Expand Up @@ -65,7 +65,10 @@ func WorkflowLogs(ctx context.Context, wfClient versioned.Interface, kubeClient
var wg sync.WaitGroup
// A non-blocking channel for log entries to go down.
unsortedEntries := make(chan logEntry, 128)
logOptions := req.GetLogOptions().DeepCopy()
logOptions := req.GetLogOptions()
if logOptions == nil {
logOptions = &corev1.PodLogOptions{}
}
logOptions.Timestamps = true

// this func start a stream if one is not already running
Expand Down

0 comments on commit 910f636

Please sign in to comment.