feat: add dismissed property to the healthcheck section (#10940)

This commit is contained in:
Marcin Tojek
2023-11-29 16:37:40 +00:00
committed by GitHub
parent d374becdeb
commit 2b574e2b2d
19 changed files with 225 additions and 38 deletions
+8 -3
View File
@@ -16,9 +16,10 @@ import (
// @typescript-generate AccessURLReport
type AccessURLReport struct {
// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.
Healthy bool `json:"healthy"`
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
Warnings []string `json:"warnings"`
Healthy bool `json:"healthy"`
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
Warnings []string `json:"warnings"`
Dismissed bool `json:"dismissed"`
AccessURL string `json:"access_url"`
Reachable bool `json:"reachable"`
@@ -30,6 +31,8 @@ type AccessURLReport struct {
type AccessURLReportOptions struct {
AccessURL *url.URL
Client *http.Client
Dismissed bool
}
func (r *AccessURLReport) Run(ctx context.Context, opts *AccessURLReportOptions) {
@@ -38,6 +41,8 @@ func (r *AccessURLReport) Run(ctx context.Context, opts *AccessURLReportOptions)
r.Severity = health.SeverityOK
r.Warnings = []string{}
r.Dismissed = opts.Dismissed
if opts.AccessURL == nil {
r.Error = ptr.Ref("access URL is nil")
r.Severity = health.SeverityError