kyverno / kyverno-json

Kyverno for any JSON!
https://kyverno.github.io/kyverno-json/
Apache License 2.0
72 stars 17 forks source link

[Feature] Simplify if-else #82

Closed vishal-chdhry closed 6 months ago

vishal-chdhry commented 1 year ago

Problem Statement

Kyverno json supports if-else logic using boolean algebra right now and is completely able to express it. But it can be tricky to implement if-else in boolean expression in some cases. It would be great if there was direct support for it.

Solution Description

No response

Alternatives

No response

Additional Context

No response

Slack discussion

No response

Research

eddycharly commented 1 year ago

Right now the whole syntax is about assertions.

You can use expressions on the RHS, would it solve the problem ?

JimBugwadia commented 12 months ago

@vishal-chdhry @eddycharly - can we take a Kyverno policy with this logic and try that out?

eddycharly commented 12 months ago

@vishal-chdhry please provide a concrete example of what you are trying to do

kumarankit999 commented 9 months ago

I would like to go with this issue!

vishal-chdhry commented 6 months ago

jmespath can cover almost all of the scenarios