Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EngineResponse ¶
type EngineResponse struct { // Resource patched with the engine action changes PatchedResource unstructured.Unstructured // Policy Response PolicyResponse PolicyResponse }
EngineResponse engine response to the action
func (EngineResponse) GetFailedRules ¶
func (er EngineResponse) GetFailedRules() []string
GetFailedRules returns failed rules
func (EngineResponse) GetPatches ¶
func (er EngineResponse) GetPatches() [][]byte
GetPatches returns all the patches joined
func (EngineResponse) GetSuccessRules ¶
func (er EngineResponse) GetSuccessRules() []string
GetSuccessRules returns success rules
func (EngineResponse) IsSuccessful ¶ added in v1.1.7
func (er EngineResponse) IsSuccessful() bool
IsSuccessful checks if any rule has failed or not
type PolicyResponse ¶
type PolicyResponse struct { // policy name Policy string `json:"policy"` // resource details Resource ResourceSpec `json:"resource"` // policy statistics PolicyStats `json:",inline"` // rule response Rules []RuleResponse `json:"rules"` // ValidationFailureAction: audit(default if not set),enforce ValidationFailureAction string }
PolicyResponse policy application response
type PolicyStats ¶
type PolicyStats struct { // time required to process the policy rules on a resource ProcessingTime time.Duration `json:"processingTime"` // Count of rules that were applied successfully RulesAppliedCount int `json:"rulesAppliedCount"` }
PolicyStats stores statistics for the single policy application
type ResourceSpec ¶
type ResourceSpec struct { //TODO: support ApiVersion Kind string `json:"kind"` APIVersion string `json:"apiVersion"` Namespace string `json:"namespace"` Name string `json:"name"` }
ResourceSpec resource action applied on
type RuleResponse ¶
type RuleResponse struct { // rule name specified in policy Name string `json:"name"` // rule type (Mutation,Generation,Validation) for Kyverno Policy Type string `json:"type"` // message response from the rule application Message string `json:"message"` // JSON patches, for mutation rules Patches [][]byte `json:"patches,omitempty"` // success/fail Success bool `json:"success"` // statistics RuleStats `json:",inline"` }
RuleResponse details for each rule applicatino
Click to show internal directories.
Click to hide internal directories.