Skip to content

Conversation

@shaneutt
Copy link
Member

@shaneutt shaneutt commented Jul 1, 2025

What type of PR is this?
/kind feature
/kind bug

Which issue(s) this PR fixes:
Implements the fix discuseed in #3841, and fixes #3841.

Does this PR introduce a user-facing change?:

Users of the experimental CORS `AllowCredentials` field can now specify false. The underlying API specification type has changed from a enum of type boolean to just a boolean, so users deploying `HTTPRoutes` via libraries will need to adjust for the change in types.

@shaneutt shaneutt requested review from JoelSpeed and kflynn July 1, 2025 19:11
@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. kind/bug Categorizes issue or PR as related to a bug. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 1, 2025
@k8s-ci-robot k8s-ci-robot requested review from mlavacca and robscott July 1, 2025 19:11
@k8s-ci-robot k8s-ci-robot added kind/gep PRs related to Gateway Enhancement Proposal(GEP) approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 1, 2025
@shaneutt shaneutt added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/gep PRs related to Gateway Enhancement Proposal(GEP) labels Jul 1, 2025
@shaneutt shaneutt moved this to Review in Release v1.4.0 Jul 1, 2025
@shaneutt shaneutt added this to the v1.4.0 milestone Jul 1, 2025
@shaneutt shaneutt added the v1.4-release/subtask This indicates a subtask of a feature, bug, or smaller issue for the v1.4 release. label Jul 1, 2025
@shaneutt shaneutt requested a review from EyalPazz July 1, 2025 19:16
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 1, 2025
Comment on lines 1368 to 1369
// When set to false the gateway will omit the header
// `Access-Control-Allow-Credentials` entirely (this is the standard CORS
// behavior).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While in the previous versions of this feature we actually only provided true, here we can also provide false, so i'm thinking that maybe we'll need to add a test that makes sure that setting it to false actually omits it (in the gateway implementation itself), just out of thought that maybe existing implementations take the value (if exists), that in the past could have only been true

Copy link
Member Author

@shaneutt shaneutt Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sounds good. I am in no position at the moment to test an implementation with CORS support in order to develop this however, so we should throw up a follow-up issue to track additional testing needed for CORS and link that as a sub-task of #1767. Since you seem to be very clear on it, would you mind creating that issue and linking it here, and I can link it as a sub-task?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes will do :))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🖖

@k8s-triage-robot
Copy link

Unknown CLA label state. Rechecking for CLA labels.

Send feedback to sig-contributor-experience at kubernetes/community.

/check-cla
/easycla

@shaneutt shaneutt added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jul 8, 2025
Copy link

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to make the docs clear that omitted and false are the same

Comment on lines 1368 to 1369
// When set to false the gateway will omit the header
// `Access-Control-Allow-Credentials` entirely (this is the standard CORS
// behavior).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🖖

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 9, 2025
@shaneutt shaneutt requested a review from JoelSpeed July 9, 2025 16:58
@shaneutt shaneutt removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2025
@kubernetes-sigs kubernetes-sigs deleted a comment from k8s-ci-robot Jul 9, 2025
@kflynn
Copy link
Contributor

kflynn commented Jul 9, 2025

/lgtm

Thanks @shaneutt! I went ahead and left a suggestion about explicitly setting to false but I don't feel strongly about that given the other changes.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 9, 2025
//
// +optional
AllowCredentials TrueField `json:"allowCredentials,omitempty"`
AllowCredentials *bool `json:"allowCredentials,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the actual TrueField type get removed in this PR somewhere? I can't seem to find it.

Related question - I'd assume we only want a pointer here if we want to distinguish between the unspecified and zero value here, but I don't think we do here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the actual TrueField type get removed in this PR somewhere? I can't seem to find it.

👍 2f11de8

Related question - I'd assume we only want a pointer here if we want to distinguish between the unspecified and zero value here, but I don't think we do here.

I was deliberating about this, however note that the API Conventions were recently updated around this specifically:

For `bool` types, the zero value is `false`, which is always a valid user choice. `bool` types should always be pointers, and should always use the `omitempty` tag.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 10, 2025
@shaneutt shaneutt added the tide/merge-method-rebase Denotes a PR that should be rebased by tide when it merges. label Jul 10, 2025
@shaneutt shaneutt force-pushed the cors-allowed-bool branch from 02b7959 to 45a3424 Compare July 10, 2025 12:59
@shaneutt shaneutt removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 10, 2025
@kflynn
Copy link
Contributor

kflynn commented Jul 10, 2025

🚢 Ship it! 🙂

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 10, 2025
@k8s-ci-robot k8s-ci-robot merged commit fb6aa5c into kubernetes-sigs:main Jul 10, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from Review to Done in Release v1.4.0 Jul 10, 2025
@shaneutt shaneutt deleted the cors-allowed-bool branch July 10, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. kind/gep PRs related to Gateway Enhancement Proposal(GEP) lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-rebase Denotes a PR that should be rebased by tide when it merges. v1.4-release/subtask This indicates a subtask of a feature, bug, or smaller issue for the v1.4 release.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

The boolean "TrueField" introduced for CORS can cause generator issues

8 participants