Skip to content

Conversation

danehans
Copy link
Contributor

Backport of PR #1679

  • Fix LabelSelector validation markers for map field

    Changed MinItems/MaxItems to MinProperties/MaxProperties for the MatchLabels field in LabelSelector, as it is a map type, not an array. This resolves controller-gen CRD generation errors.

  • Add CRD generation to make generate target

Add controller-gen crd to the generate target to validate kubebuilder markers during development and CI runs.

Previously, make generate only ran controller-gen object, which generates DeepCopy methods but does not validate CRD markers like MinItems, MaxItems, MinProperties, etc. This meant invalid markers could be merged without detection, only to cause failures in downstream projects that run full CRD generation.

By adding CRD generation to the generate target:

  • Invalid kubebuilder markers are caught immediately during development
  • CI will fail if markers are incorrect or CRDs are out of sync
  • Prevents downstream projects from encountering CRD generation errors
  • Aligns with the target's existing documentation which states it generates CustomResourceDefinition objects

This change would have caught the MinItems/MaxItems issue fixed in commit 40cecfd before it was merged.

  • Regenerate CRDs with updated validation markers

This regenerates the CRDs to include the MinProperties/MaxProperties validation for the MatchLabels map field.

The generated CRD now includes:

  • minProperties: 1
  • maxProperties: 64

These properties correctly validate the map field, replacing the incorrect MinItems/MaxItems markers that were causing controller-gen failures.


What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

 
) * Fix LabelSelector validation markers for map field Changed MinItems/MaxItems to MinProperties/MaxProperties for the MatchLabels field in LabelSelector, as it is a map type, not an array. This resolves controller-gen CRD generation errors. Signed-off-by: Killian Golds <kgolds@redhat.com> * Add CRD generation to make generate target Add controller-gen crd to the generate target to validate kubebuilder markers during development and CI runs. Previously, make generate only ran controller-gen object, which generates DeepCopy methods but does not validate CRD markers like MinItems, MaxItems, MinProperties, etc. This meant invalid markers could be merged without detection, only to cause failures in downstream projects that run full CRD generation. By adding CRD generation to the generate target: - Invalid kubebuilder markers are caught immediately during development - CI will fail if markers are incorrect or CRDs are out of sync - Prevents downstream projects from encountering CRD generation errors - Aligns with the target's existing documentation which states it generates CustomResourceDefinition objects This change would have caught the MinItems/MaxItems issue fixed in commit 40cecfd before it was merged. Signed-off-by: Killian Golds <kgolds@redhat.com> * Regenerate CRDs with updated validation markers This regenerates the CRDs to include the MinProperties/MaxProperties validation for the MatchLabels map field. The generated CRD now includes: - minProperties: 1 - maxProperties: 64 These properties correctly validate the map field, replacing the incorrect MinItems/MaxItems markers that were causing controller-gen failures. Signed-off-by: Killian Golds <kgolds@redhat.com> --------- Signed-off-by: Killian Golds <kgolds@redhat.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 14, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danehans

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 14, 2025
@k8s-ci-robot k8s-ci-robot requested a review from robscott October 14, 2025 18:37
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 14, 2025
@nirrozenbaum
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 14, 2025
@danehans
Copy link
Contributor Author

danehans commented Oct 14, 2025

--- FAIL: TestFlowRegistry_GarbageCollection_IdleFlows (0.03s) --- FAIL: TestFlowRegistry_GarbageCollection_IdleFlows/ShouldNotCollectFlow_WhenActivityRacesWithGC (0.00s) registry_test.go:605:	Error Trace:	/home/prow/go/src/sigs.k8s.io/gateway-api-inference-extension/pkg/epp/flowcontrol/registry/registry_test.go:185	/home/prow/go/src/sigs.k8s.io/gateway-api-inference-extension/pkg/epp/flowcontrol/registry/registry_test.go:605	Error:	Received unexpected error:	failed to get managed queue for flow "gc-flow:10": flow instance not found	Test:	TestFlowRegistry_GarbageCollection_IdleFlows/ShouldNotCollectFlow_WhenActivityRacesWithGC	Messages:	Flow should survive GC due to the 'Trust but Verify' live check FAIL coverage: 97.2% of statements FAIL	sigs.k8s.io/gateway-api-inference-extension/pkg/epp/flowcontrol/registry	0.502s

/retest

@k8s-ci-robot k8s-ci-robot merged commit 4d4437f into kubernetes-sigs:release-1.0 Oct 14, 2025
5 checks passed
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

4 participants