-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: scaffold KW policy from Kubernetes ValidatingAdmissionPolicy #834
Conversation
Depends on kubewarden/policy-evaluator#525 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #834 +/- ##
=========================================
+ Coverage 9.49% 10.35% +0.85%
=========================================
Files 20 20
Lines 1727 1806 +79
=========================================
+ Hits 164 187 +23
- Misses 1563 1619 +56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, a few nitpicks here and there.
However, we need to add a warning when no version is set, informing the user that we are defaulting to the latest tag.
I've done all the changes requested, except printing the warning message when the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flavio approved modulo the warning message
Arg::new("cel-policy") | ||
.long("cel-policy") | ||
.value_name("URI") | ||
.default_value("ghcr.io/kubewarden/policies/cel-policy:latest") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be ok with "ghcr.io/kubewarden/policies/cel-policy:<version>"
so by default the user is forced to edit and doesn't instantiate a possible broken policy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I've just pushed a commit that introduces the check about When the policy being referenced is |
BTW, I'll squash the commits together once you're done with the review |
I've bumped |
Add the new `scaffold vap` subcommand. This allows to create a Kubewarden ClusterAdmissionPolicy starting from a Kubernetes ValidatingAdmissionPolicy. Signed-off-by: Flavio Castelli <fcastelli@suse.com>
Add the new
scaffold vap
subcommand. This allows to create a Kubewarden ClusterAdmissionPolicy starting from a Kubernetes ValidatingAdmissionPolicy.