Skip to content

Commit

Permalink
fix: printing logs when TFE plan fails (#3180)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeyheath authored Mar 27, 2024
1 parent d765d4b commit c24adc6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions shared/workspace_repo/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,11 @@ func (s *TFEWorkspace) WaitWithOptions(ctx context.Context, waitOptions options.
if err != nil {
logrus.Errorf("failed to get events: %s", err.Error())
}
err = waitOptions.Orchestrator.PrintLogs(ctx, waitOptions.StackName, waitOptions.Services)
if err != nil {
logrus.Errorf("failed to retrieve logs: %s", err.Error())
if options.DebugLogsDuringDeploymentFromCtx(ctx) {
err = waitOptions.Orchestrator.PrintLogs(ctx, waitOptions.StackName, waitOptions.Services)
if err != nil {
logrus.Errorf("failed to retrieve logs: %s", err.Error())
}
}
}
}
Expand Down

0 comments on commit c24adc6

Please sign in to comment.