1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-07 00:17:13 +00:00
kyverno/test/conformance/kuttl/mutate/clusterpolicy/standard/mutate-node-status
Vyom Yadav 99d988e98c
feat: add support for subresources to validating and mutating policies (#4916)
* feat: add support for subresources to validating and mutating policies

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>

* Add CLI test cases with subresources for validating policies

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>

* Fix existing e2e tests for validating policies and remove tests migrated to kuttl

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>

* Add kuttl e2e tests for validating policies with subresources

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>

* Add kuttl e2e tests for mutating policies with subresources

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>

* Add kuttl e2e tests for validating policy by-pass by manipulating preconditions

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>
2022-12-10 00:45:23 +08:00
..
01-assert.yaml feat: add support for subresources to validating and mutating policies (#4916) 2022-12-10 00:45:23 +08:00
01-manifests.yaml feat: add support for subresources to validating and mutating policies (#4916) 2022-12-10 00:45:23 +08:00
02-assert.yaml feat: add support for subresources to validating and mutating policies (#4916) 2022-12-10 00:45:23 +08:00
02-script.yaml feat: add support for subresources to validating and mutating policies (#4916) 2022-12-10 00:45:23 +08:00
99-cleanup.yaml feat: add support for subresources to validating and mutating policies (#4916) 2022-12-10 00:45:23 +08:00
clear-modified-node-status.sh feat: add support for subresources to validating and mutating policies (#4916) 2022-12-10 00:45:23 +08:00
modify-resource-filters.sh feat: add support for subresources to validating and mutating policies (#4916) 2022-12-10 00:45:23 +08:00
README.md feat: add support for subresources to validating and mutating policies (#4916) 2022-12-10 00:45:23 +08:00
send-request-to-status-subresource.sh feat: add support for subresources to validating and mutating policies (#4916) 2022-12-10 00:45:23 +08:00

Description

This test validates that an incoming request to Node/status is mutated by the mutation policy matching on Node/status.

Expected Behavior

The request is mutated.

Steps

Test Steps

  1. Create a ClusterPolicy that matches on Node/status and mutates the request.
  2. Modify kyverno resourceFilters to allow mutating requests for Node resource.
  3. Send a update request to Node/status.
  4. Mutate the incoming request (done by kyverno).
  5. Verify that the request is mutated.

Reference Issue(s)

https://github.com/kyverno/kyverno/issues/2843