1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-13 19:28:55 +00:00

fix: deep copy before validaitng (#8483)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-09-21 11:01:14 +02:00 committed by GitHub
parent af50fabc6e
commit ae1fa9b260
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,7 +104,8 @@ func kubectlValidateLoader(bytes []byte) ([]kyvernov1.PolicyInterface, []v1alpha
if err != nil {
return nil, nil, err
}
if err := factory.Validate(untyped); err != nil {
// TODO remove DeepCopy when fixed upstream
if err := factory.Validate(untyped.DeepCopy()); err != nil {
return nil, nil, err
}
switch gvk {