mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(coderd): store workspace proxy version in the database (#10790)
Stores workspace proxy version in database upon registration.
This commit is contained in:
@@ -31,6 +31,7 @@ func insertProxy(t *testing.T, db database.Store, url string) database.Workspace
|
||||
Url: url,
|
||||
WildcardHostname: "",
|
||||
ID: proxy.ID,
|
||||
Version: `v2.34.5-test+beefcake`,
|
||||
})
|
||||
require.NoError(t, err, "failed to update proxy")
|
||||
return proxy
|
||||
|
||||
@@ -625,6 +625,7 @@ func (api *API) workspaceProxyRegister(rw http.ResponseWriter, r *http.Request)
|
||||
DerpEnabled: req.DerpEnabled,
|
||||
DerpOnly: req.DerpOnly,
|
||||
WildcardHostname: req.WildcardHostname,
|
||||
Version: req.Version,
|
||||
})
|
||||
if err != nil {
|
||||
return xerrors.Errorf("register workspace proxy: %w", err)
|
||||
@@ -951,6 +952,7 @@ func convertProxy(p database.WorkspaceProxy, status proxyhealth.ProxyStatus) cod
|
||||
CreatedAt: p.CreatedAt,
|
||||
UpdatedAt: p.UpdatedAt,
|
||||
Deleted: p.Deleted,
|
||||
Version: p.Version,
|
||||
Status: codersdk.WorkspaceProxyStatus{
|
||||
Status: codersdk.ProxyHealthStatus(status.Status),
|
||||
Report: status.Report,
|
||||
|
||||
Reference in New Issue
Block a user