mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-14 11:48:53 +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:
parent
af50fabc6e
commit
ae1fa9b260
1 changed files with 2 additions and 1 deletions
|
@ -104,7 +104,8 @@ func kubectlValidateLoader(bytes []byte) ([]kyvernov1.PolicyInterface, []v1alpha
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
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
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
switch gvk {
|
switch gvk {
|
||||||
|
|
Loading…
Add table
Reference in a new issue