-
Notifications
You must be signed in to change notification settings - Fork 630
Fix ai prompt guard enums #13177
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
Fix ai prompt guard enums #13177
Conversation
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.
Pull request overview
This PR fixes the AI prompt guard enum values to align with the project's naming conventions for enums. The constants MASK and REJECT are updated to use Pascal case (Mask and Reject), and corresponding enum validation is added to enforce these values in the Kubernetes API.
- Updated
Actionenum constants fromMASK/REJECTtoMask/Rejectin the Go API - Added kubebuilder validation annotation to enforce the new enum values
- Added explicit enum constraints to CRD templates for AgentgatewayPolicy and AgentgatewayBackend
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
api/v1alpha1/agentgateway/ai_policy.go |
Updated Action enum constant values from uppercase to Pascal case and added kubebuilder validation annotation |
install/helm/agentgateway-crds/templates/agentgateway.dev_agentgatewaypolicies.yaml |
Added enum validation constraints for Action field in request and response prompt guard configurations |
install/helm/agentgateway-crds/templates/agentgateway.dev_agentgatewaybackends.yaml |
Added enum validation constraints for Action field across multiple prompt guard configuration locations in the backend CRD |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: npolshakova <[email protected]> fix tests Signed-off-by: npolshakova <[email protected]>
8a55c23 to
dd45221
Compare
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.
this is the only test that uses the enum names?
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.
Yep!
Description
Fixes #13173
Change Type
Changelog