1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

fix: add matchConditions and variables when generating VAPs (#8308)

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
This commit is contained in:
Mariam Fahmy 2023-09-07 16:03:36 +03:00 committed by GitHub
parent 07877ef37a
commit 00fda95642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -240,10 +240,12 @@ func (c *controller) buildValidatingAdmissionPolicy(vap *v1alpha1.ValidatingAdmi
// set validating admission policy spec
vap.Spec = v1alpha1.ValidatingAdmissionPolicySpec{
ParamKind: rule.Validation.CEL.ParamKind,
MatchConstraints: &matchResources,
ParamKind: rule.Validation.CEL.ParamKind,
Variables: rule.Validation.CEL.Variables,
Validations: rule.Validation.CEL.Expressions,
AuditAnnotations: rule.Validation.CEL.AuditAnnotations,
MatchConditions: rule.CELPreconditions,
}
// set labels