Skip to content

Commit af2d0dc

Browse files
committed
WIP
1 parent 7b3945a commit af2d0dc

File tree

7 files changed

+84
-63
lines changed

7 files changed

+84
-63
lines changed

coderd/apidoc/docs.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/healthcheck/accessurl.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
// @typescript-generate AccessURLReport
1717
type AccessURLReport struct {
18+
// Healthy is left for backward compatibility purposes, use `Severity` instead.
1819
Healthy bool `json:"healthy"`
1920
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
2021
Warnings []string `json:"warnings"`

coderd/healthcheck/database.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const (
1717

1818
// @typescript-generate DatabaseReport
1919
type DatabaseReport struct {
20+
// Healthy is left for backward compatibility purposes, use `Severity` instead.
2021
Healthy bool `json:"healthy"`
2122
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
2223
Warnings []string `json:"warnings"`

coderd/healthcheck/derphealth/derp.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const (
3434

3535
// @typescript-generate Report
3636
type Report struct {
37+
// Healthy is left for backward compatibility purposes, use `Severity` instead.
3738
Healthy bool `json:"healthy"`
3839
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
3940
Warnings []string `json:"warnings"`
@@ -51,6 +52,7 @@ type Report struct {
5152
type RegionReport struct {
5253
mu sync.Mutex
5354

55+
// Healthy is left for backward compatibility purposes, use `Severity` instead.
5456
Healthy bool `json:"healthy"`
5557
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
5658
Warnings []string `json:"warnings"`
@@ -65,6 +67,7 @@ type NodeReport struct {
6567
mu sync.Mutex
6668
clientCounter int
6769

70+
// Healthy is left for backward compatibility purposes, use `Severity` instead.
6871
Healthy bool `json:"healthy"`
6972
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
7073
Warnings []string `json:"warnings"`
@@ -171,6 +174,7 @@ func (r *RegionReport) Run(ctx context.Context) {
171174
defer func() {
172175
if err := recover(); err != nil {
173176
nodeReport.Error = ptr.Ref(fmt.Sprint(err))
177+
nodeReport.Severity = health.SeverityError
174178
}
175179
}()
176180

@@ -226,6 +230,7 @@ func (r *NodeReport) Run(ctx context.Context) {
226230
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
227231
defer cancel()
228232

233+
r.Severity = health.SeverityOK
229234
r.ClientLogs = [][]string{}
230235
r.ClientErrs = [][]string{}
231236

@@ -248,11 +253,12 @@ func (r *NodeReport) Run(ctx context.Context) {
248253
// The node was marked as STUN compatible but the STUN test failed.
249254
r.STUN.Error != nil {
250255
r.Healthy = false
256+
r.Severity = health.SeverityError
251257
}
252258

253259
if r.UsesWebsocket {
254260
r.Warnings = append(r.Warnings, warningNodeUsesWebsocket)
255-
// FIXME
261+
r.Severity = health.SeverityWarning
256262
}
257263
}
258264

coderd/healthcheck/websocket.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type WebsocketReportOptions struct {
2323

2424
// @typescript-generate WebsocketReport
2525
type WebsocketReport struct {
26+
// Healthy is left for backward compatibility purposes, use `Severity` instead.
2627
Healthy bool `json:"healthy"`
2728
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
2829
Warnings []string `json:"warnings"`

0 commit comments

Comments
 (0)