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

CORS-3842: Add API Updates for GCP Custom API Endpoints #2150

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

barbacbd
Copy link
Contributor

** 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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 15, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 15, 2025

@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:

** 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.

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.

Copy link
Contributor

openshift-ci bot commented Jan 15, 2025

Hello @barbacbd! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@barbacbd
Copy link
Contributor Author

/cc @patrickdillon

@openshift-ci openshift-ci bot requested a review from patrickdillon January 15, 2025 20:04
@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 15, 2025
@openshift-ci openshift-ci bot requested review from bparees and sinnykumari January 15, 2025 20:04
Copy link
Contributor

openshift-ci bot commented Jan 15, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: barbacbd
Once this PR has been reviewed and has the lgtm label, please assign knobunc for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@barbacbd
Copy link
Contributor Author

/cc @JoelSpeed
/cc @zaneb

@barbacbd
Copy link
Contributor Author

/retest

@barbacbd
Copy link
Contributor Author

/retest-required

config/v1/types_infrastructure.go Outdated Show resolved Hide resolved
config/v1/types_infrastructure.go Outdated Show resolved Hide resolved
config/v1/types_infrastructure.go Outdated Show resolved Hide resolved
config/v1/types_infrastructure.go Outdated Show resolved Hide resolved
config/v1/types_infrastructure.go Show resolved Hide resolved
** 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.
@barbacbd
Copy link
Contributor Author

/retest

@barbacbd barbacbd requested a review from everettraven January 22, 2025 12:35
Copy link

@everettraven everettraven left a 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.

config/v1/types_infrastructure.go Show resolved Hide resolved
config/v1/types_infrastructure.go Show resolved Hide resolved
// +required
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Format=uri
// +kubebuilder:validation:Pattern=`^https://`

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

config/v1/types_infrastructure.go Show resolved Hide resolved
config/v1/types_infrastructure.go Show resolved Hide resolved
Comment on lines +641 to +642
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Format=uri

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.

Copy link
Contributor

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

config/v1/types_infrastructure.go Show resolved Hide resolved
config/v1/types_infrastructure.go Show resolved Hide resolved
Copy link
Contributor

openshift-ci bot commented Jan 22, 2025

@barbacbd: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp 2290748 link false /test e2e-gcp
ci/prow/okd-scos-e2e-aws-ovn 2290748 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-aws-serial-techpreview 2290748 link true /test e2e-aws-serial-techpreview
ci/prow/e2e-aws-ovn-techpreview 2290748 link true /test e2e-aws-ovn-techpreview
ci/prow/e2e-aws-ovn-hypershift 2290748 link true /test e2e-aws-ovn-hypershift
ci/prow/e2e-aws-serial 2290748 link true /test e2e-aws-serial

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants