mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(scripts/apitypings): force health.Message and health.Severity to correct types (#11043)
* Force typegen types for some fields of derp health report
* Explicitly allocate slices for RegionReport.{Errors,Warnings} to avoid nulls in API response
This commit is contained in:
@@ -945,6 +945,12 @@ func convertProxy(p database.WorkspaceProxy, status proxyhealth.ProxyStatus) cod
|
||||
if status.Status == "" {
|
||||
status.Status = proxyhealth.Unknown
|
||||
}
|
||||
if status.Report.Errors == nil {
|
||||
status.Report.Errors = make([]string, 0)
|
||||
}
|
||||
if status.Report.Warnings == nil {
|
||||
status.Report.Warnings = make([]string, 0)
|
||||
}
|
||||
return codersdk.WorkspaceProxy{
|
||||
Region: convertRegion(p, status),
|
||||
DerpEnabled: p.DerpEnabled,
|
||||
|
||||
Reference in New Issue
Block a user