Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregatedReport ¶
type AggregatedReport struct { ClusterIdentities map[string]map[string]string `json:"cluster_identities"` Templates []ReportForTemplate `json:"templates"` }
AggregatedReport is the data structure that doop-api produces. It aggregates multiple instances of type Report from different clusters.
func (*AggregatedReport) Sort ¶
func (r *AggregatedReport) Sort()
Sort sorts all lists in this report in the respective canonical order.
type MetadataForConstraint ¶
type MetadataForConstraint struct { Severity string `json:"severity,omitempty"` TemplateSource string `json:"template_source,omitempty"` ConstraintSource string `json:"constraint_source,omitempty"` Docstring string `json:"docstring,omitempty"` // AuditTimestamp is always present in type Report, but omitted in type AggregatedReport. AuditTimestamp string `json:"auditTimestamp,omitempty"` }
MetadataForConstraint appears in type ReportForConstraint.
type Report ¶
type Report struct { ClusterIdentity map[string]string `json:"cluster_identity"` Templates []ReportForTemplate `json:"templates"` }
Report is the data structure that doop-analyzer produces.
func (Report) SetClusterName ¶
SetClusterName sets the ClusterName field on all Violation objects in this Report. This is used at report loading time to prepare the report for aggregation. The self-return is used to shorten setup code in unit tests.
type ReportForConstraint ¶
type ReportForConstraint struct { Name string `json:"name"` Metadata MetadataForConstraint `json:"metadata"` // Before processing, Violations is filled and ViolationGroups is nil. // After processing, Violations is nil and ViolationGroups is filled. Violations []Violation `json:"violations,omitempty"` ViolationGroups []ViolationGroup `json:"violation_groups,omitempty"` }
ReportForConstraint appears in type ReportForTemplate.
func (*ReportForConstraint) Sort ¶
func (r *ReportForConstraint) Sort()
Sort sorts all lists in this report in the respective canonical order.
type ReportForTemplate ¶
type ReportForTemplate struct { Kind string `json:"kind"` Constraints []ReportForConstraint `json:"constraints"` }
ReportForTemplate appears in type Report.
func (*ReportForTemplate) Sort ¶
func (r *ReportForTemplate) Sort()
Sort sorts all lists in this report in the respective canonical order.
type Violation ¶
type Violation struct { // All fields are omitempty because we compress ViolationGroups by omitting all fields // from instances that are identical to the respective fields in the pattern. Kind string `json:"kind,omitempty"` Name string `json:"name,omitempty"` Namespace string `json:"namespace,omitempty"` Message string `json:"message,omitempty"` ObjectIdentity map[string]string `json:"object_identity,omitempty"` // This field is only set when this Violation appears as a ViolationGroup instance inside an AggregatedReport. // It is written by Report.SetClusterName() at report loading time. ClusterName string `json:"cluster,omitempty"` }
Violation describes a single policy violation, or the common pattern within a ViolationGroup.
func (Violation) CompareTo ¶
CompareTo is a three-way compare between violations. As per the usual convention, 0 means `v == other`, negative means `v < other`, and positive means `v > other`.
func (Violation) DifferenceTo ¶
DifferenceTo returns a copy of this violation, with all fields cleared out that are identical to the pattern.
type ViolationGroup ¶
type ViolationGroup struct { Pattern Violation `json:"pattern"` Instances []Violation `json:"instances"` }
ViolationGroup describes a set of one or more policy violations that follow a common pattern.