Skip to content

Conversation

@joshlreese
Copy link
Contributor

@joshlreese joshlreese commented Oct 8, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

There are a handful of invalid markers on CRDs today as a result of the CRD generator not handling errors encountered during generation. This leads to either unnecessary metadata in CRD manifests, or missing validation (in the case of MaxLength being used instead of MaxItems).

Prior to correcting the markers on the existing CRDs, the generator produced the following errors:

/dev/gateway-api/apis/v1/backendtlspolicy_types.go:193:2: must apply listType to an array, found 
/dev/gateway-api/apis/v1/gateway_types.go:808:2: must apply listType to an array, found 
/dev/gateway-api/apis/v1/httproute_types.go:1675:2: must apply maxlength to a textual value, found type "array"
/dev/gateway-api/apis/v1/httproute_types.go:1723:2: must apply maxlength to a textual value, found type "array"
/dev/gateway-api/apis/v1/httproute_types.go:1734:2: must apply maxlength to a textual value, found type "array"
2025/10/08 16:13:20 not all generators ran successfully
exit status 1

The use of loader.PrintErrors was taken from https://github.com/kubernetes-sigs/controller-tools/blob/5c2d62552c97a0139c1dfdc6276c69f2a5f6120d/pkg/genall/genall.go#L282.

Which issue(s) this PR fixes:

N/A

Does this PR introduce a user-facing change?:

The ExternalAuth HTTPRouteFilter now enforces a maximum of 64 items in the following fields:

- `grpc.allowedHeaders`
- `http.allowedHeaders`
- `http.allowedResponseHeaders`

In addition to the generator fix, adjustments have been made to existing CRDs to
correct errors which were not handled before, and `./hack/update-codegen.sh`
was executed.

The listType marker was added to two non-list fields in 78496d8

The MaxLength validation marker was used on an array field instead of MaxItems in 110bcaf
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 8, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @joshlreese!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 8, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @joshlreese. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@robscott
Copy link
Member

robscott commented Oct 8, 2025

Thanks @joshlreese! This is an important fix. Please update the release note to make it clear that this represents multiple breaking changes + highlight the new validation that is enforced (specifically the new max number of items).

/cc @rikatz @shaneutt

/ok-to-test
/approve

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 8, 2025
@joshlreese
Copy link
Contributor Author

@robscott - I've updated the release note to be a bit more clear - I tried to find other PRs with breaking changes as references but didn't have much luck other than seeing the PR titles mention a breaking change (seen in #3937).

The listType change appears to only have influenced the generated OpenAPI content - is that a breaking change as well?

@robscott
Copy link
Member

robscott commented Oct 9, 2025

@robscott - I've updated the release note to be a bit more clear - I tried to find other PRs with breaking changes as references but didn't have much luck other than seeing the PR titles mention a breaking change (seen in #3937).

This looks great, thanks!

The listType change appears to only have influenced the generated OpenAPI content - is that a breaking change as well?

Not in my opinion. I think we really only want to focus on changes to the k8s API, so in this case that means changes to the CRDs.

This change LGTM, but will wait for someone else to sign off since it is technically a breaking change.

@rikatz
Copy link
Member

rikatz commented Oct 9, 2025

Good catch, thanks! The atomic ones were introduced here: #3964 and I totally missed it! thanks!

For the CRD changes, those are made on experimental APIs (ext_auth), so while I agree we need to be sure that this is visible, I think we are fine breaking experimental APIs :)

@robscott a detail: our CI actions are not running for new contributors, so I need someone with write access here to approve the run (and change on the project config to always run!)

Copy link
Member

@rikatz rikatz left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold
Let's just trigger the pipeline actions first

@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 Oct 9, 2025
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 9, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joshlreese, rikatz, robscott

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

@rikatz
Copy link
Member

rikatz commented Oct 9, 2025

/hold cancel
Thank you!

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 9, 2025
@k8s-ci-robot k8s-ci-robot merged commit fefb203 into kubernetes-sigs:main Oct 9, 2025
32 checks passed
@joshlreese joshlreese deleted the fix-unhandled-generator-errors branch October 13, 2025 14:58
@rikatz
Copy link
Member

rikatz commented Oct 16, 2025

/cherry-pick release-1.4

@k8s-infra-cherrypick-robot
Copy link
Contributor

@rikatz: #4158 failed to apply on top of branch "release-1.4":

Applying: Update CRD generator to handle errors encountered during generation.
Using index info to reconstruct a base tree...
M	go.mod
Falling back to patching base and 3-way merge...
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Update CRD generator to handle errors encountered during generation.

In response to this:

/cherry-pick release-1.4

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.

rikatz pushed a commit to rikatz/gateway-api that referenced this pull request Oct 22, 2025
…ubernetes-sigs#4158)

In addition to the generator fix, adjustments have been made to existing CRDs to
correct errors which were not handled before, and `./hack/update-codegen.sh`
was executed.

The listType marker was added to two non-list fields in 78496d8

The MaxLength validation marker was used on an array field instead of MaxItems in 110bcaf
@mmmommm
Copy link

mmmommm commented Nov 13, 2025

@rikatz
It seems the cherry-pick is failing, so could you please take a look?
I’m encountering the same error locally, and I’d really like this fix to be included in the next release.
I’m sorry if I mentioned the wrong person.

tylerauerbeck pushed a commit to tylerauerbeck/gateway-api that referenced this pull request Nov 27, 2025
…ubernetes-sigs#4158)

In addition to the generator fix, adjustments have been made to existing CRDs to
correct errors which were not handled before, and `./hack/update-codegen.sh`
was executed.

The listType marker was added to two non-list fields in 78496d8

The MaxLength validation marker was used on an array field instead of MaxItems in 110bcaf
@weisdd
Copy link

weisdd commented Dec 7, 2025

As I see, the fix didn't make it into v1.4.1 due to the failed cherry-picking automation. Not sure whom to ping, could any of you take a look at this, please? :) @danwinship @robscott @shaneutt @rikatz

@rikatz
Copy link
Member

rikatz commented Dec 8, 2025

@weisdd do you mind cherry-picking it manually? I am not sure we will have a 1.4.2 release, but at least we can merge the cherry-pick in case we decide to cut this new release

/cc @kflynn

@k8s-ci-robot k8s-ci-robot requested a review from kflynn December 8, 2025 17:58
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. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants