Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PolicyInfo ¶
type PolicyInfo struct { // Name is policy name Name string // RKind represents the resource kind RKind string // RName is resource name RName string // Namespace is the ns of resource // empty on non-namespaced resources RNamespace string //TODO: add check/enum for types ValidationFailureAction string // BlockChanges, ReportViolation Rules []RuleInfo // contains filtered or unexported fields }
PolicyInfo defines policy information
func NewPolicyInfo ¶
func NewPolicyInfo(policyName, rKind, rName, rNamespace, validationFailureAction string) PolicyInfo
NewPolicyInfo returns a new policy info
func (*PolicyInfo) AddRuleInfos ¶
func (pi *PolicyInfo) AddRuleInfos(rules []RuleInfo)
AddRuleInfos sets the rule information
func (*PolicyInfo) ErrorRules ¶
func (pi *PolicyInfo) ErrorRules() string
ErrorRules returns error msgs from all rule
func (*PolicyInfo) FailedRules ¶ added in v0.6.0
func (pi *PolicyInfo) FailedRules() []string
FailedRules returns list of failed rule names
func (*PolicyInfo) GetRuleNames ¶ added in v0.6.0
func (pi *PolicyInfo) GetRuleNames(onSuccess bool) string
GetRuleNames gets the name of successful rules
func (*PolicyInfo) IsSuccessful ¶
func (pi *PolicyInfo) IsSuccessful() bool
IsSuccessful checks if policy is succesful the policy is set to fail, if any of the rules have failed
func (*PolicyInfo) SuccessfulRules ¶ added in v0.6.0
func (pi *PolicyInfo) SuccessfulRules() []string
SuccessfulRules returns list of successful rule names
type RuleInfo ¶
type RuleInfo struct { Name string RuleType RuleType Msgs []string Patches [][]byte // this will store the mutation patch being applied by the rule // contains filtered or unexported fields }
RuleInfo defines rule struct
func NewRuleInfo ¶
NewRuleInfo creates a new RuleInfo
func (*RuleInfo) GetErrorString ¶ added in v0.6.0
GetErrorString returns the error message for a rule
func (*RuleInfo) IsSuccessful ¶
IsSuccessful checks if rule is succesful
Click to show internal directories.
Click to hide internal directories.