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 InvertedElement(elements []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 []kyvernov2beta1.PolicyException, policyContext engineapi.PolicyContext, ...) *kyvernov2beta1.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)
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 InvertedElement ¶ added in v1.10.0
func InvertedElement(elements []interface{})
InvertedElement inverted the order of element for patchStrategicMerge policies as kustomize patch revering 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 []kyvernov2beta1.PolicyException, policyContext engineapi.PolicyContext, logger logr.Logger, ) *kyvernov2beta1.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 kyvernov1beta1.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.
Click to show internal directories.
Click to hide internal directories.