1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/conformance/chainsaw/webhooks/policy-different-resource-group
Florian Hopfensperger 8781a38849
feat: configure webhook scope based on resource and policy type (#8065)
* feat: configure webhook scope based on policy type

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>

* Update pkg/controllers/webhook/controller.go

Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: shuting <shuting@nirmata.com>

* feat: configure webhook scope based on resource type

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>

* review comments

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>

* sorting of webhooks

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>

* Update pkg/controllers/webhook/utils.go

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix imports

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>

---------

Signed-off-by: Florian Hopfensperger <florian.hopfensperger@allianz.de>
Signed-off-by: shuting <shuting@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-26 15:07:42 +00:00
..
chainsaw-test.yaml feat: configure webhook scope based on resource and policy type (#8065) 2024-01-26 15:07:42 +00:00
policy-1-assert.yaml feat: configure webhook scope based on resource and policy type (#8065) 2024-01-26 15:07:42 +00:00
policy-1.yaml feat: configure webhook scope based on resource and policy type (#8065) 2024-01-26 15:07:42 +00:00
policy-2-assert.yaml feat: configure webhook scope based on resource and policy type (#8065) 2024-01-26 15:07:42 +00:00
policy-2.yaml feat: configure webhook scope based on resource and policy type (#8065) 2024-01-26 15:07:42 +00:00
README.md feat: configure webhook scope based on resource and policy type (#8065) 2024-01-26 15:07:42 +00:00
webhooks.yaml feat: configure webhook scope based on resource and policy type (#8065) 2024-01-26 15:07:42 +00:00

Description

This test verifies the resource validation webhook is configured correctly when a Policy targets all * resources.

Steps

    • Create a policy targeting Deployment Create a policy targeting Configmap
    • Assert policies gets ready
    • Assert that the resource validation webhook is configured correctly and two rules are created with scope is set to "namespaced"