mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
fix: background image verification not working (#7564)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
43685aedc2
commit
7ba136767a
1 changed files with 6 additions and 0 deletions
|
@ -85,6 +85,12 @@ func (s *scanner) validateResource(ctx context.Context, resource unstructured.Un
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *scanner) validateImages(ctx context.Context, resource unstructured.Unstructured, nsLabels map[string]string, policy kyvernov1.PolicyInterface) (*engineapi.EngineResponse, error) {
|
func (s *scanner) validateImages(ctx context.Context, resource unstructured.Unstructured, nsLabels map[string]string, policy kyvernov1.PolicyInterface) (*engineapi.EngineResponse, error) {
|
||||||
|
annotations := resource.GetAnnotations()
|
||||||
|
if annotations != nil {
|
||||||
|
resource = *resource.DeepCopy()
|
||||||
|
delete(annotations, "kyverno.io/verify-images")
|
||||||
|
resource.SetAnnotations(annotations)
|
||||||
|
}
|
||||||
policyCtx, err := engine.NewPolicyContext(s.jp, resource, kyvernov1.Create, nil, s.config)
|
policyCtx, err := engine.NewPolicyContext(s.jp, resource, kyvernov1.Create, nil, s.config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Add table
Reference in a new issue