Skip to content

Commit

Permalink
Wrap additional calls to capture logs
Browse files Browse the repository at this point in the history
Signed-off-by: James W. Brinkerhoff <jwb@paravolve.net>
  • Loading branch information
splaspood committed Mar 3, 2021
1 parent 8f3432e commit f354b54
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/tink-worker/internal/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ func (w *Worker) execute(ctx context.Context, wfID string, action *pb.WorkflowAc
}
l.With("containerID", id, "status", status.String(), "command", action.GetOnTimeout()).Info("container created")
failedActionStatus := make(chan pb.State)
// TODD(jwb) Need to handle this capture logs as well
go w.captureLogs(ctx, id)
if captureLogs {
go w.captureLogs(ctx, id)
}
go waitFailedContainer(ctx, l, cli, id, failedActionStatus)
err = startContainer(ctx, l, cli, id)
if err != nil {
Expand All @@ -165,8 +166,9 @@ func (w *Worker) execute(ctx context.Context, wfID string, action *pb.WorkflowAc
l.Error(errors.Wrap(err, errFailedToRunCmd))
}
l.With("containerID", id, "actionStatus", status.String(), "command", action.GetOnFailure()).Info("container created")
// TODO(jwb) - Handle logging here too
go w.captureLogs(ctx, id)
if captureLogs {
go w.captureLogs(ctx, id)
}
go waitFailedContainer(ctx, l, cli, id, failedActionStatus)
err = startContainer(ctx, l, cli, id)
if err != nil {
Expand Down

0 comments on commit f354b54

Please sign in to comment.