refactor(coderd/healthcheck): make Warnings an object with { Code, Message } (#10950)

- Adds health.Message { code string, mesasge string }
- Refactors existing warnings []string to be of type []health.Message instead
This commit is contained in:
Cian Johnston
2023-11-30 14:49:50 +00:00
committed by GitHub
parent 4f9292859d
commit 07895006d9
18 changed files with 459 additions and 151 deletions

62
coderd/apidoc/docs.go generated
View File

@ -12258,7 +12258,7 @@ const docTemplate = `{
"warnings": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/health.Message"
}
}
}
@ -12297,7 +12297,7 @@ const docTemplate = `{
"warnings": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/health.Message"
}
}
}
@ -12348,7 +12348,7 @@ const docTemplate = `{
"warnings": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/health.Message"
}
}
}
@ -12367,6 +12367,56 @@ const docTemplate = `{
}
}
},
"health.Code": {
"type": "string",
"enum": [
"EUNKNOWN",
"EWP01",
"EWP02",
"EWP03",
"EWP04",
"EDB01",
"EDB02",
"EWS01",
"EWS02",
"EWS03",
"EACS01",
"EACS02",
"EACS03",
"EACS04",
"EDERP01",
"EDERP02"
],
"x-enum-varnames": [
"CodeUnknown",
"CodeProxyUpdate",
"CodeProxyFetch",
"CodeProxyVersionMismatch",
"CodeProxyUnhealthy",
"CodeDatabasePingFailed",
"CodeDatabasePingSlow",
"CodeWebsocketDial",
"CodeWebsocketEcho",
"CodeWebsocketMsg",
"CodeAccessURLNotSet",
"CodeAccessURLInvalid",
"CodeAccessURLFetch",
"CodeAccessURLNotOK",
"CodeDERPNodeUsesWebsocket",
"CodeDERPOneNodeUnhealthy"
]
},
"health.Message": {
"type": "object",
"properties": {
"code": {
"$ref": "#/definitions/health.Code"
},
"message": {
"type": "string"
}
}
},
"health.Severity": {
"type": "string",
"enum": [
@ -12420,7 +12470,7 @@ const docTemplate = `{
"warnings": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/health.Message"
}
}
}
@ -12465,7 +12515,7 @@ const docTemplate = `{
"warnings": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/health.Message"
}
}
}
@ -12579,7 +12629,7 @@ const docTemplate = `{
"warnings": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/health.Message"
}
},
"workspace_proxies": {