[Bug] Issue with remove elements on the existing target resource with a precondition #10224
Closed
2 tasks done
Labels
bug
Something isn't working
mutation-existing
Related to the mutate existing ability.
regression
Issues (bugs) which are regressions from an earlier release.
release-critical
Critical issues which MUST be addressed in the specified milestone. These cannot get bumped.
Milestone
Kyverno Version
1.12.0
Description
I have this policy that is triggered by the VirtualService (helloworld2) deletion and mutate another VirtualService (helloworld1).
./policy.yaml:
And 2 deployments per each VirtualService:
./deploy1.yaml
./deploy2.yaml
Steps to reproduce:
In a cluster with Istio/Kyverno (v1.12.0)
At this time, target VS (helloworld1) has this spec.http list.
They are ordered by destination.host: helloworld-one, helloworld-two and helloworld-three
Now I will trigger the policy by deleting the helloworld2 VirtualService. The policy is supposed to remove the last one, helloworld-three HTTP route rule.
The expected destination.host of the target resource is
However the output I got is incorrect:
Here is the log from the background controller:
There are 2 issues:
Other thing I noticed:
Removing elements in the standard mutation (i.e mutating the trigger resources) worked as expected. The correct one was removed and the un-mutated elements of the list remained in the same order.
Slack discussion
No response
Troubleshooting
The text was updated successfully, but these errors were encountered: