Documentation
¶
Index ¶
- func GVK(obj unstructured.Unstructured) string
- func NamespacedName(obj unstructured.Unstructured) string
- type Check
- type CheckResult
- func (r *CheckResult) AddError(err error)
- func (r *CheckResult) AddErrors(errs ...error)
- func (r *CheckResult) AddFailed(obj unstructured.Unstructured)
- func (r *CheckResult) AddPassed(obj unstructured.Unstructured)
- func (r *CheckResult) AddSkipped(obj unstructured.Unstructured)
- func (r *CheckResult) UpdateStatus()
- type CheckStatus
- type Match
- type Report
- type ResourceRule
- type Severity
- type Test
- type Validation
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GVK ¶
func GVK(obj unstructured.Unstructured) string
GVK returns the GroupVersionKind string of the given resource
func NamespacedName ¶
func NamespacedName(obj unstructured.Unstructured) string
NamespacedName returns the namespaced name string of the given resource
Types ¶
type Check ¶
type Check struct {
ID string `json:"id"`
Match Match `json:"match"`
Validations []Validation `json:"validations"`
Variables []Variable `json:"variables"`
Params map[string]any `json:"params"`
Severity Severity `json:"severity"`
Message string `json:"message"`
Labels map[string]string `json:"labels,omitempty"`
Builtin bool `json:"builtin"`
Path string `json:"path,omitempty"`
}
type CheckResult ¶
type CheckResult struct {
ID string `json:"id"`
Message string `json:"message"`
Severity Severity `json:"severity"`
Builtin bool `json:"builtin"`
Path string `json:"path"`
Labels map[string]string `json:"labels,omitempty"`
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(check Check) *CheckResult
func (*CheckResult) AddError ¶
func (r *CheckResult) AddError(err error)
func (*CheckResult) AddErrors ¶
func (r *CheckResult) AddErrors(errs ...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 ( StatusUnknown CheckStatus = iota StatusPassed StatusSkipped StatusFailed StatusError )
func ParseStatus ¶ added in v0.1.6
func ParseStatus(s string) CheckStatus
func (CheckStatus) MarshalJSON ¶
func (s CheckStatus) MarshalJSON() ([]byte, error)
func (CheckStatus) String ¶
func (s CheckStatus) String() string
func (*CheckStatus) UnmarshalJSON ¶ added in v0.1.6
func (s *CheckStatus) UnmarshalJSON(b []byte) error
type Match ¶
type Match struct {
Resources []ResourceRule `json:"resources"`
}
type Report ¶
type Report struct {
KubeVersion *version.Info `json:"kubeVersion"`
Checks []*CheckResult `json:"checks"`
GVRs map[string]string `json:"gvrs,omitempty"`
}
func (*Report) Add ¶
func (r *Report) Add(cr *CheckResult)
type ResourceRule ¶
type ResourceRule struct {
Group string `json:"group,omitempty"`
Version string `json:"version"`
Resource string `json:"resource"`
}
func (*ResourceRule) ToGVR ¶
func (r *ResourceRule) ToGVR() schema.GroupVersionResource
type Severity ¶
type Severity int
func ParseSeverity ¶
func (Severity) MarshalJSON ¶
func (*Severity) UnmarshalJSON ¶
type Validation ¶
Click to show internal directories.
Click to hide internal directories.