Skip to content

Commit 51687c7

Browse files
authored
fix(coderd/healthcheck): do not return null regions in RegionsResponse (#11088)
1 parent 228cbec commit 51687c7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coderd/healthcheck/workspaceproxy.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ func (r *WorkspaceProxyReport) Run(ctx context.Context, opts *WorkspaceProxyRepo
7777
}
7878

7979
r.WorkspaceProxies = proxies
80+
if r.WorkspaceProxies.Regions == nil {
81+
r.WorkspaceProxies.Regions = make([]codersdk.WorkspaceProxy, 0)
82+
}
83+
8084
// Stable sort based on create timestamp.
8185
sort.Slice(r.WorkspaceProxies.Regions, func(i int, j int) bool {
8286
return r.WorkspaceProxies.Regions[i].CreatedAt.Before(r.WorkspaceProxies.Regions[j].CreatedAt)

0 commit comments

Comments
 (0)