Skip to content

Commit 9b6f446

Browse files
authored
fix: prevent build logs from crashing envbox process (#95)
- While not pushing build logs results in a degraded experience it shouldn't prevent workspace startup.
1 parent a27862d commit 9b6f446

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cli/docker.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,15 @@ func dockerCmd(ch chan func() error) *cobra.Command {
180180

181181
agent, err := buildlog.OpenCoderClient(ctx, coderURL, log, flags.agentToken)
182182
if err != nil {
183-
return xerrors.Errorf("open coder client: %w", err)
183+
// Don't fail workspace startup on
184+
// an inability to push build logs.
185+
log.Error(ctx, "failed to instantiate coder build log client, no logs will be pushed", slog.Error(err))
186+
} else {
187+
blog = buildlog.MultiLogger(
188+
buildlog.OpenCoderLogger(ctx, agent, log),
189+
blog,
190+
)
184191
}
185-
186-
blog = buildlog.MultiLogger(
187-
buildlog.OpenCoderLogger(ctx, agent, log),
188-
blog,
189-
)
190192
}
191193
defer blog.Close()
192194

0 commit comments

Comments
 (0)