Documentation ¶
Index ¶
- func Evaluate(log logr.Logger, ctx context.EvalInterface, condition kyverno.Condition) bool
- func EvaluateConditions(log logr.Logger, ctx context.EvalInterface, conditions interface{}) bool
- func FindAndShiftReferences(log logr.Logger, value, shift, pivot string) string
- func IsReference(value string) bool
- func IsVariable(value string) bool
- func ReplaceAllVars(src string, repl func(string) string) string
- func RuleToUntyped(rule kyverno.Rule) (interface{}, error)
- func SubstituteAll(log logr.Logger, ctx context.EvalInterface, document interface{}) (_ interface{}, err error)
- func SubstituteAllForceMutate(log logr.Logger, ctx context.EvalInterface, typedRule kyverno.Rule) (_ kyverno.Rule, err error)
- func SubstituteAllInRule(log logr.Logger, ctx context.EvalInterface, typedRule kyverno.Rule) (_ kyverno.Rule, err error)
- func UntypedToRule(untyped interface{}) (kyverno.Rule, error)
- func ValidateBackgroundModeVars(log logr.Logger, ctx context.EvalInterface, rule interface{}) (interface{}, error)
- type NotFoundVariableErr
- type NotResolvedReferenceErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateConditions ¶
func EvaluateConditions(log logr.Logger, ctx context.EvalInterface, conditions interface{}) bool
EvaluateConditions evalues all the conditions present in a slice, in a backwards compatible way
func FindAndShiftReferences ¶ added in v1.3.5
func IsReference ¶ added in v1.3.5
IsReference returns true if the element contains a 'valid' reference $()
func IsVariable ¶ added in v1.2.0
IsVariable returns true if the element contains a 'valid' variable {{}}
func ReplaceAllVars ¶ added in v1.3.5
ReplaceAllVars replaces all variables with the value defined in the replacement function This is used to avoid validation errors
func RuleToUntyped ¶ added in v1.3.5
func SubstituteAll ¶ added in v1.3.5
func SubstituteAll(log logr.Logger, ctx context.EvalInterface, document interface{}) (_ interface{}, err error)
func SubstituteAllForceMutate ¶ added in v1.3.5
func SubstituteAllInRule ¶ added in v1.3.5
func UntypedToRule ¶ added in v1.3.5
func ValidateBackgroundModeVars ¶ added in v1.3.5
func ValidateBackgroundModeVars(log logr.Logger, ctx context.EvalInterface, rule interface{}) (interface{}, error)
ValidateBackgroundModeVars validates variables against the specified context, which contains a list of allowed JMESPath queries in background processing, and throws an error if the variable is not allowed.
Types ¶
type NotFoundVariableErr ¶ added in v1.2.0
type NotFoundVariableErr struct {
// contains filtered or unexported fields
}
NotFoundVariableErr is returned when it is impossible to resolve the variable
func (NotFoundVariableErr) Error ¶ added in v1.2.0
func (n NotFoundVariableErr) Error() string
type NotResolvedReferenceErr ¶ added in v1.3.5
type NotResolvedReferenceErr struct {
// contains filtered or unexported fields
}
NotResolvedReferenceErr is returned when it is impossible to resolve the variable
func (NotResolvedReferenceErr) Error ¶ added in v1.3.5
func (n NotResolvedReferenceErr) Error() string