(workspaceAgent database.WorkspaceAgent)
| 506 | } |
| 507 | |
| 508 | func WorkspaceAgentEnvironment(workspaceAgent database.WorkspaceAgent) (map[string]string, error) { |
| 509 | var envs map[string]string |
| 510 | if workspaceAgent.EnvironmentVariables.Valid { |
| 511 | err := json.Unmarshal(workspaceAgent.EnvironmentVariables.RawMessage, &envs) |
| 512 | if err != nil { |
| 513 | return nil, xerrors.Errorf("unmarshal environment variables: %w", err) |
| 514 | } |
| 515 | } |
| 516 | |
| 517 | return envs, nil |
| 518 | } |
| 519 | |
| 520 | func WorkspaceAgent(derpMap *tailcfg.DERPMap, coordinator tailnet.Coordinator, |
| 521 | dbAgent database.WorkspaceAgent, apps []codersdk.WorkspaceApp, scripts []codersdk.WorkspaceAgentScript, logSources []codersdk.WorkspaceAgentLogSource, |
no test coverage detected