feat: include server agent API version in buildinfo (#11057)

First part of #10340 -- we need this version to compare with agents to tell if they are on a deprecated Agent API version
This commit is contained in:
Spike Curtis
2023-12-08 12:50:25 +04:00
committed by GitHub
parent f0969f99ad
commit b4ca1d6579
9 changed files with 33 additions and 14 deletions

View File

@ -71,10 +71,11 @@ func (api *API) deploymentStats(rw http.ResponseWriter, r *http.Request) {
func buildInfo(accessURL *url.URL) http.HandlerFunc {
return func(rw http.ResponseWriter, r *http.Request) {
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.BuildInfoResponse{
ExternalURL: buildinfo.ExternalURL(),
Version: buildinfo.Version(),
DashboardURL: accessURL.String(),
WorkspaceProxy: false,
ExternalURL: buildinfo.ExternalURL(),
Version: buildinfo.Version(),
AgentAPIVersion: AgentAPIVersionREST,
DashboardURL: accessURL.String(),
WorkspaceProxy: false,
})
}
}