Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatorResponse ¶
type GatorResponse struct { Trace *string Target string Results []*GatorResult }
Response is a collection of Constraint violations for a particular Target. Each Result is for a distinct Constraint.
type GatorResponses ¶
type GatorResponses struct { ByTarget map[string]*GatorResponse Handled map[string]bool StatsEntries []*instrumentation.StatsEntry }
func Test ¶
func Test(objs []*unstructured.Unstructured, tOpts Opts) (*GatorResponses, error)
func (*GatorResponses) Results ¶
func (r *GatorResponses) Results() []*GatorResult
type GatorResult ¶
type GatorResult struct { types.Result ViolatingObject *unstructured.Unstructured `json:"violatingObject"` // Trace is an explanation of the underlying constraint evaluation. // For instance, for OPA based evaluations, the trace is an explanation of the rego query: // https://www.openpolicyagent.org/docs/v0.44.0/policy-reference/#tracing // NOTE: This is a string pointer to differentiate between an empty ("") trace and an unset one (nil); // also for efficiency reasons as traces could be arbitrarily large theoretically. Trace *string `json:"trace"` }
type YamlGatorResult ¶
type YamlGatorResult struct { types.Result ViolatingObject map[string]interface{} `yaml:"violatingObject"` Trace *string `yaml:"trace,flow"` }
YamlGatorResult is a GatorResult minues a level of indirection on the ViolatingObject and with struct tags for yaml marshaling.
func GetYamlFriendlyResults ¶
func GetYamlFriendlyResults(results []*GatorResult) []*YamlGatorResult
GetYamlFriendlyResults is a convenience func to remove a level of indirection between unstructured.Unstructured and unstructured.Unstructured.Object when calling MarshalYaml.
Click to show internal directories.
Click to hide internal directories.