mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
feat: use agent v2 API to fetch manifest (#11832)
Agent uses the v2 API to obtain the manifest, instead of the HTTP API.
This commit is contained in:
@ -97,6 +97,16 @@ func New(opts Options) *API {
|
||||
AgentFn: api.agent,
|
||||
Database: opts.Database,
|
||||
DerpMapFn: opts.DerpMapFn,
|
||||
WorkspaceIDFn: func(ctx context.Context, wa *database.WorkspaceAgent) (uuid.UUID, error) {
|
||||
if opts.WorkspaceID != uuid.Nil {
|
||||
return opts.WorkspaceID, nil
|
||||
}
|
||||
ws, err := opts.Database.GetWorkspaceByAgentID(ctx, wa.ID)
|
||||
if err != nil {
|
||||
return uuid.Nil, err
|
||||
}
|
||||
return ws.Workspace.ID, nil
|
||||
},
|
||||
}
|
||||
|
||||
api.ServiceBannerAPI = &ServiceBannerAPI{
|
||||
|
Reference in New Issue
Block a user