( ctx context.Context, aAPI proto.DRPCAgentClient28, dc codersdk.WorkspaceAgentDevcontainer, script codersdk.WorkspaceAgentScript, )
| 1432 | } |
| 1433 | |
| 1434 | func (a *agent) createDevcontainer( |
| 1435 | ctx context.Context, |
| 1436 | aAPI proto.DRPCAgentClient28, |
| 1437 | dc codersdk.WorkspaceAgentDevcontainer, |
| 1438 | script codersdk.WorkspaceAgentScript, |
| 1439 | ) (err error) { |
| 1440 | var ( |
| 1441 | exitCode = int32(0) |
| 1442 | startTime = a.clock.Now() |
| 1443 | status = proto.Timing_OK |
| 1444 | ) |
| 1445 | if err = a.containerAPI.CreateDevcontainer(dc.WorkspaceFolder, dc.ConfigPath); err != nil { |
| 1446 | exitCode = 1 |
| 1447 | status = proto.Timing_EXIT_FAILURE |
| 1448 | } |
| 1449 | endTime := a.clock.Now() |
| 1450 | |
| 1451 | if _, scriptErr := aAPI.ScriptCompleted(ctx, &proto.WorkspaceAgentScriptCompletedRequest{ |
| 1452 | Timing: &proto.Timing{ |
| 1453 | ScriptId: script.ID[:], |
| 1454 | Start: timestamppb.New(startTime), |
| 1455 | End: timestamppb.New(endTime), |
| 1456 | ExitCode: exitCode, |
| 1457 | Stage: proto.Timing_START, |
| 1458 | Status: status, |
| 1459 | }, |
| 1460 | }); scriptErr != nil { |
| 1461 | a.logger.Warn(ctx, "reporting script completed failed", slog.Error(scriptErr)) |
| 1462 | } |
| 1463 | return err |
| 1464 | } |
| 1465 | |
| 1466 | // createOrUpdateNetwork waits for the manifest to be set using manifestOK, then creates or updates |
| 1467 | // the tailnet using the information in the manifest |
no test coverage detected