Documentation ¶
Index ¶
- func CheckNotFoundErr(err error) bool
- func ConditionsToJSONObject(conditions []kyvernov1.AnyAllConditions) ([]map[string]interface{}, error)
- func DefaultVariableResolver(ctx context.EvalInterface, variable string) (interface{}, error)
- func Evaluate(logger logr.Logger, ctx context.EvalInterface, condition kyvernov1.Condition) (bool, string, error)
- func EvaluateAnyAllConditions(log logr.Logger, ctx context.EvalInterface, ...) (bool, string, error)
- func EvaluateConditions(log logr.Logger, ctx context.EvalInterface, conditions interface{}) (bool, string, error)
- func FindAndShiftReferences(log logr.Logger, value, shift, pivot string) string
- func JSONObjectToConditions(data interface{}) ([]kyvernov1.AnyAllConditions, error)
- func ReplaceAllVars(src string, repl func(string) string) string
- func SubstituteAll(log logr.Logger, ctx context.EvalInterface, document interface{}) (interface{}, error)
- func SubstituteAllForceMutate(log logr.Logger, ctx context.Interface, typedRule kyvernov1.Rule) (_ kyvernov1.Rule, err error)
- func SubstituteAllInConditions(log logr.Logger, ctx context.EvalInterface, ...) ([]kyvernov1.AnyAllConditions, error)
- func SubstituteAllInPreconditions(log logr.Logger, ctx context.EvalInterface, document interface{}) (interface{}, error)
- func SubstituteAllInRule(log logr.Logger, ctx context.EvalInterface, rule kyvernov1.Rule) (kyvernov1.Rule, error)
- func SubstituteAllInType[T any](log logr.Logger, ctx context.EvalInterface, t *T) (*T, error)
- func ValidateElementInForEach(log logr.Logger, rule interface{}) (interface{}, error)
- type NotResolvedReferenceError
- type VariableResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckNotFoundErr ¶ added in v1.9.0
func ConditionsToJSONObject ¶ added in v1.5.0
func ConditionsToJSONObject(conditions []kyvernov1.AnyAllConditions) ([]map[string]interface{}, error)
func DefaultVariableResolver ¶ added in v1.4.2
func DefaultVariableResolver(ctx context.EvalInterface, variable string) (interface{}, error)
DefaultVariableResolver is used in all variable substitutions except preconditions
func Evaluate ¶
func Evaluate(logger logr.Logger, ctx context.EvalInterface, condition kyvernov1.Condition) (bool, string, error)
Evaluate evaluates the condition
func EvaluateAnyAllConditions ¶ added in v1.5.0
func EvaluateAnyAllConditions(log logr.Logger, ctx context.EvalInterface, conditions []kyvernov1.AnyAllConditions) (bool, string, error)
func EvaluateConditions ¶
func EvaluateConditions(log logr.Logger, ctx context.EvalInterface, conditions interface{}) (bool, string, error)
EvaluateConditions evaluates all the conditions present in a slice, in a backwards compatible way
func FindAndShiftReferences ¶ added in v1.3.5
func JSONObjectToConditions ¶ added in v1.5.0
func JSONObjectToConditions(data interface{}) ([]kyvernov1.AnyAllConditions, error)
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 SubstituteAll ¶ added in v1.3.5
func SubstituteAll(log logr.Logger, ctx context.EvalInterface, document interface{}) (interface{}, error)
SubstituteAll substitutes variables and references in the document. The document must be JSON data i.e. string, []interface{}, map[string]interface{}
func SubstituteAllForceMutate ¶ added in v1.3.5
func SubstituteAllInConditions ¶ added in v1.5.0
func SubstituteAllInConditions(log logr.Logger, ctx context.EvalInterface, conditions []kyvernov1.AnyAllConditions) ([]kyvernov1.AnyAllConditions, error)
func SubstituteAllInPreconditions ¶ added in v1.4.2
func SubstituteAllInPreconditions(log logr.Logger, ctx context.EvalInterface, document interface{}) (interface{}, error)
func SubstituteAllInRule ¶ added in v1.3.5
func SubstituteAllInType ¶ added in v1.9.0
func ValidateElementInForEach ¶ added in v1.5.0
Types ¶
type NotResolvedReferenceError ¶ added in v1.8.0
type NotResolvedReferenceError struct {
// contains filtered or unexported fields
}
NotResolvedReferenceError is returned when it is impossible to resolve the variable
func (NotResolvedReferenceError) Error ¶ added in v1.8.0
func (n NotResolvedReferenceError) Error() string
type VariableResolver ¶ added in v1.4.2
type VariableResolver = func(ctx context.EvalInterface, variable string) (interface{}, error)
VariableResolver defines the handler function for variable substitution
Click to show internal directories.
Click to hide internal directories.