-
Notifications
You must be signed in to change notification settings - Fork 40.3k
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
ValidatingAdmissionPolicy: expended type checking to messageExpression #119209
ValidatingAdmissionPolicy: expended type checking to messageExpression #119209
Conversation
/assign @cici37 @alexzielenski |
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.
Looks like a clean refactoring and adds support for messageExpression
errors as advertised. No critiques that I could find
lgtm
/lgtm |
LGTM label has been added. Git tree hash: ee270a26d5206d35e74af73c12a38611b707b7e6
|
Let's limit the size of PRs and speed up reviews. This PR will be limited to messageExpression and I will send follow-ups right after this one merges. |
/approve |
/hold in case you wanted to control merge order |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexzielenski, jiahuif The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
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.
A few nits then LGTM
func (r *TypeCheckingResult) GVK() schema.GroupVersionKind { | ||
return r.gvk | ||
} |
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.
Consider either exporting gvks
field (if callers can be trusted to not modify the slice), or copying the slice here (if callers cannot be trusted)?
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.
Let's export these. The struct is a result type. The caller has the ownership of it.
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.
Done. PTAL. Thank you.
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.
func (r *TypeCheckingResult) Issues() *cel.Issues { | ||
return r.issues | ||
} |
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.
Same here, either export field or make a safe copy?
// Err returns possible error that was encounter during type checking. | ||
func (r *TypeCheckingResult) Err() error { | ||
return r.err | ||
} |
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.
If other fields are exposed, expose this one too?
26c2574
to
ee2bb1b
Compare
d647122
to
e655931
Compare
/triage accepted |
/retest sig storage test flak |
/lgtm |
LGTM label has been added. Git tree hash: 3e35e18e7312a548a5227ba5b5ff33a8dd31dc17
|
Thank you all for reviewing! |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR:
validations[].messageExpression
variables[].expression
once it's merged.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: