Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add live policy schema validation #131

Open
eddycharly opened this issue May 15, 2023 · 5 comments
Open

Add live policy schema validation #131

eddycharly opened this issue May 15, 2023 · 5 comments

Comments

@eddycharly
Copy link
Member

  • Users are often finding it difficult to write valid Kyverno policies, even sometimes as simple as the schema is wrong before getting to more complex issues like deep JMESPath or syntax validations.
  • This has to be prevented and clearly shown to users with like a large red outline around the policy pane. Users shouldn't be able to test policies that aren't schematically valid. See here.
@fjogeleit
Copy link
Member

fjogeleit commented May 15, 2023

Don't get it completely because the schema is already validated and for real issues the execution returns an related error.

Theres not much more I can do.

Bildschirmfoto 2023-05-15 um 11 47 39

@chipzoller

@chipzoller
Copy link

What I am suggesting is that if there are any validation errors found, don't let someone test it. Making the error more visible would be better as well, if possible.

@fjogeleit
Copy link
Member

Hm theres not much more I can do right now. I validate the schema based on the json schema and the warnings are shown as in the screen - thats what the editor supports by default. Popping up banners while tipping can be very annoying because it may show up while typing.

Can keep an eye on it but nothing I would focus on right now.

@chipzoller
Copy link

Ok

@chipzoller
Copy link

Coming back to this. What I'm suggesting isn't a pop-up or anything like that. But if the editor knows the schema is invalid, the Start button can change color to red and prohibit clicking (for example). Another option would be to check the errors when clicking Start and display a clear message then. Something like this should be possible if the framework can get inputs from the editor's schema validation routine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants