report

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckResult

type CheckResult struct {
	ID       string          `json:"id"`
	Message  string          `json:"message"`
	Severity checks.Severity `json:"severity"`
	Builtin  bool            `json:"builtin"`
	Path     string          `json:"path"`

	Status  CheckStatus         `json:"status"`
	Failed  map[string][]string `json:"failed"`
	Passed  map[string][]string `json:"passed"`
	Skipped map[string][]string `json:"skipped"`
	Errors  []string            `json:"errors"`

	TotalFailed  int `json:"totalFailed"`
	TotalPassed  int `json:"totalPassed"`
	TotalSkipped int `json:"totalSkipped"`
}

func NewCheckResult

func NewCheckResult(c checks.Check) *CheckResult

func (*CheckResult) AddError

func (r *CheckResult) AddError(err error)

func (*CheckResult) AddFailed

func (r *CheckResult) AddFailed(obj unstructured.Unstructured)

func (*CheckResult) AddPassed

func (r *CheckResult) AddPassed(obj unstructured.Unstructured)

func (*CheckResult) AddSkipped

func (r *CheckResult) AddSkipped(obj unstructured.Unstructured)

func (*CheckResult) UpdateStatus

func (r *CheckResult) UpdateStatus()

type CheckStatus

type CheckStatus int
const (
	StatusPassed CheckStatus = iota
	StatusSkipped
	StatusFailed
	StatusError
)

func (CheckStatus) MarshalJSON

func (s CheckStatus) MarshalJSON() ([]byte, error)

func (CheckStatus) String

func (s CheckStatus) String() string

type Report

type Report struct {
	KubeVersion *version.Info  `json:"kubeVersion"`
	Checks      []*CheckResult `json:"checks"`
}

func New

func New(kubeVersion *version.Info) *Report

func (*Report) Add

func (r *Report) Add(cr *CheckResult)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL