Skip to content

⚠️ Add MaxLength & MinLength markers #11949

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

Merged
merged 7 commits into from
Mar 12, 2025

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Mar 10, 2025

Signed-off-by: Stefan Büringer [email protected]

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Part of #11834

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 10, 2025
@sbueringer sbueringer changed the title ⚠️ Add MaxItems markers ⚠️ Add MaxLength markers Mar 10, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/needs-area PR is missing an area label label Mar 10, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 10, 2025
@sbueringer
Copy link
Member Author

I'll look into this. Seems like a limitation in controller-gen

@sbueringer
Copy link
Member Author

/hold cancel

@sbueringer sbueringer added the area/api Issues or PRs related to the APIs label Mar 10, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Mar 10, 2025
@sbueringer sbueringer mentioned this pull request Mar 10, 2025
16 tasks
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member Author

/assign @JoelSpeed @fabriziopandini @chrischdi

Should be ready for review

Copy link
Contributor

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

ClusterName is included in several places, I wasn't sure if there's some restriction on this, but wouldn't a cluster name be limited by the CustomResource storage which limits names to DNS 1123 subdomain standards, and therefore 253 chars? Does CAPI have its own limit imposed somewhere?

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@sbueringer thanks for starting this work!
first pass

@sbueringer
Copy link
Member Author

sbueringer commented Mar 10, 2025

ClusterName is included in several places, I wasn't sure if there's some restriction on this, but wouldn't a cluster name be limited by the CustomResource storage which limits names to DNS 1123 subdomain standards, and therefore 253 chars? Does CAPI have its own limit imposed somewhere?

Yes it has. This already enforces max length 63 today:

if errs := validation.IsValidLabelValue(newCluster.Name); len(errs) != 0 {

(The cluster name is used in many places as label value)

@sbueringer sbueringer mentioned this pull request Mar 10, 2025
71 tasks
@sbueringer
Copy link
Member Author

@JoelSpeed @fabriziopandini Pushed first round of fixes & answered on some comments.

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

Overall lgtm from my side

Copy link
Contributor

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

Also LGTM pending the IP address/CIDR length conversation

@sbueringer
Copy link
Member Author

sbueringer commented Mar 11, 2025

Pushed a commit with fixes. I'll do another round for MinLength (after some experiments) + probably I'll review all markers myself one last time

(also responded above on the remaining conversations)

@sbueringer
Copy link
Member Author

Still looking into MinLength

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 12, 2025
@sbueringer sbueringer changed the title ⚠️ Add MaxLength markers ⚠️ Add MaxLength & MinLength markers Mar 12, 2025
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer sbueringer added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Mar 12, 2025
@sbueringer
Copy link
Member Author

sbueringer commented Mar 12, 2025

@fabriziopandini @JoelSpeed @chrischdi This is ready for a final review :)

I would probably merge after the first 1-2 lgtms/approves and address potential additional findings in a follow-up as I want to unblock #11943 so we have a chance to get that one in as well before the code freeze

Copy link
Contributor

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

/lgtm

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

LGTM label has been added.

Git tree hash: 5505ded1b8bf8aac9e475b124eb6f55e18f72a16

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

Two thoughts, but okay with all values :-)

@chrischdi
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 12, 2025
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member Author

/assign @fabriziopandini @chrischdi

@fabriziopandini
Copy link
Member

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: 0e5676e5f5b6a90983e189f5be6f5aca6a37b198

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 Mar 12, 2025
@k8s-ci-robot k8s-ci-robot merged commit afd68cd into kubernetes-sigs:main Mar 12, 2025
19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.10 milestone Mar 12, 2025
@sbueringer sbueringer deleted the pr-add-max-length branch March 13, 2025 03:44
cprivitere pushed a commit to cprivitere/cluster-api that referenced this pull request Mar 18, 2025
* Add MaxLength markers to API fields

Signed-off-by: Stefan Büringer [email protected]

* Fix review findings

* Fix review findings

* Fix review findings

* regen

* Fix review findings

* Fix review findings

---------

Signed-off-by: Stefan Büringer [email protected]
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. area/api Issues or PRs related to the APIs 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants