-
Notifications
You must be signed in to change notification settings - Fork 524
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
CORS-3842: Add API Updates for GCP Custom API Endpoints #2150
base: master
Are you sure you want to change the base?
Conversation
@barbacbd: This pull request references CORS-3842 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Hello @barbacbd! Some important instructions when contributing to openshift/api: |
/cc @patrickdillon |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: barbacbd The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cc @JoelSpeed |
/retest |
/retest-required |
** Add the Tech preview and No upgrade tags for the new feature GCP API Custom Endpoints. ** Add the ServiceEndpoint Structure that includes the api name and endpoint. ** Add the Service Endpoints to the GCP Spec and Status structs.
/retest |
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.
Spotted a few more things. It would also be beneficial to add tests where possible to ensure any validations you are putting in place are acting as expected. https://github.com/openshift/api?tab=readme-ov-file#defining-api-validation-tests should be helpful in getting you started on the right track for adding any necessary tests.
// +required | ||
// +kubebuilder:validation:Type=string | ||
// +kubebuilder:validation:Format=uri | ||
// +kubebuilder:validation:Pattern=`^https://` |
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.
It is recommended to use CEL expressions instead of this pattern tag so that we can return a more user friendly message on a validation error. An example of where I've used CEL in the past to evaluate a URL scheme: https://github.com/operator-framework/catalogd/blob/19d74c8d6019a898b1c4454626f5e53df3cc9bc3/api/v1/clustercatalog_types.go#L225
// +kubebuilder:validation:Type=string | ||
// +kubebuilder:validation:Format=uri |
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've only seen 2 examples where a URI was validated like this. I'm not really sure how this gets shown to a user on an invalid URI entry.
My gut feeling is that this should probably use CEL validation using the Kubernetes URL library here: https://kubernetes.io/docs/reference/using-api/cel/#kubernetes-url-library
@JoelSpeed may have more opinions here.
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.
Yes, prefer to use the CEL URL library now please. We can then leverage custom error messages and even inspect things like, is the scheme https, does the path have certain content
@barbacbd: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
** Add the Tech preview and No upgrade tags for the new feature GCP API Custom Endpoints.
** Add the ServiceEndpoint Structure that includes the api name and endpoint.
** Add the Service Endpoints to the GCP Spec and Status structs.