Documentation ¶
Index ¶
- func AddElementToContext(ctx engineapi.PolicyContext, element interface{}, index, nesting int, ...) error
- func ApplyPatchNew(resource, patch []byte) ([]byte, error)
- func ApplyPatches(resource []byte, patches [][]byte) ([]byte, error)
- func EvaluateList(jmesPath string, ctx enginecontext.EvalInterface) ([]interface{}, error)
- func ExtractMatchingImages(resource unstructured.Unstructured, context enginecontext.Interface, ...) ([]apiutils.ImageInfo, string, error)
- func GetMatchingImages(images map[string]map[string]apiutils.ImageInfo, rule kyvernov1.Rule) ([]apiutils.ImageInfo, string)
- func ImageMatches(image string, imagePatterns []string) bool
- func InvertElements(elements []interface{}) []interface{}
- func IsDeleteRequest(ctx engineapi.PolicyContext) bool
- func IsEmptyUnstructured(u *unstructured.Unstructured) bool
- func IsImageVerified(resource unstructured.Unstructured, image string, log logr.Logger) (engineapi.ImageVerificationMetadataStatus, error)
- func IsSameRuleResponse(r1 *engineapi.RuleResponse, r2 *engineapi.RuleResponse) bool
- func IsUpdateRequest(ctx engineapi.PolicyContext) bool
- func MatchesException(polexs []*kyvernov2.PolicyException, policyContext engineapi.PolicyContext, ...) []kyvernov2.PolicyException
- func MatchesResourceDescription(resource unstructured.Unstructured, rule kyvernov1.Rule, ...) error
- func TransformConditions(original apiextensions.JSON) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddElementToContext ¶ added in v1.10.0
func AddElementToContext(ctx engineapi.PolicyContext, element interface{}, index, nesting int, elementScope *bool) error
func ApplyPatchNew ¶
ApplyPatchNew patches given resource with given joined patches
func ApplyPatches ¶
ApplyPatches patches given resource with given patches and returns patched document return original resource if any error occurs
func EvaluateList ¶ added in v1.10.0
func EvaluateList(jmesPath string, ctx enginecontext.EvalInterface) ([]interface{}, error)
EvaluateList evaluates the context using the given JMESPath expression and returns a unified slice of interfaces.
func ExtractMatchingImages ¶ added in v1.10.0
func ExtractMatchingImages( resource unstructured.Unstructured, context enginecontext.Interface, rule kyvernov1.Rule, cfg config.Configuration, ) ([]apiutils.ImageInfo, string, error)
func GetMatchingImages ¶ added in v1.10.0
func ImageMatches ¶ added in v1.10.0
func InvertElements ¶ added in v1.12.2
func InvertElements(elements []interface{}) []interface{}
InvertElements inverts the order of elements for patchStrategicMerge policies as kustomize patch reverses the order of patch resources.
func IsDeleteRequest ¶ added in v1.10.0
func IsDeleteRequest(ctx engineapi.PolicyContext) bool
func IsEmptyUnstructured ¶ added in v1.10.0
func IsEmptyUnstructured(u *unstructured.Unstructured) bool
func IsImageVerified ¶ added in v1.10.0
func IsImageVerified(resource unstructured.Unstructured, image string, log logr.Logger) (engineapi.ImageVerificationMetadataStatus, error)
func IsSameRuleResponse ¶ added in v1.11.2
func IsSameRuleResponse(r1 *engineapi.RuleResponse, r2 *engineapi.RuleResponse) bool
func IsUpdateRequest ¶ added in v1.11.2
func IsUpdateRequest(ctx engineapi.PolicyContext) bool
func MatchesException ¶ added in v1.12.0
func MatchesException(polexs []*kyvernov2.PolicyException, policyContext engineapi.PolicyContext, logger logr.Logger) []kyvernov2.PolicyException
MatchesException takes a list of exceptions and checks if there is an exception applies to the incoming resource. It returns the matched policy exception.
func MatchesResourceDescription ¶ added in v1.10.0
func MatchesResourceDescription( resource unstructured.Unstructured, rule kyvernov1.Rule, admissionInfo kyvernov2.RequestInfo, namespaceLabels map[string]string, policyNamespace string, gvk schema.GroupVersionKind, subresource string, operation kyvernov1.AdmissionOperation, ) error
matchesResourceDescription checks if the resource matches resource description of the rule or not
func TransformConditions ¶ added in v1.10.0
func TransformConditions(original apiextensions.JSON) (interface{}, error)
Types ¶
This section is empty.