-
Notifications
You must be signed in to change notification settings - Fork 129
Fix long CRD change group validation #1124
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,8 @@ func TestNewChangeGroupFromAnnString(t *testing.T) { | |
| "valid-name.com/valid-name_CustomResourceDefinition--valid", | ||
| // Example from pinniped of a long name | ||
| "change-groups.kapp.k14s.io/crds-authentication.concierge.pinniped.dev-WebhookAuthenticator", | ||
| // Regression test for #1123: long CRD group + kind can exceed 63 bytes. | ||
| "change-groups.kapp.k14s.io/crds-fooooooooooooooooooooooooooooooooooooooooooooooooooooo.example.com-SomeLongCRDName", | ||
|
Comment on lines
+25
to
+26
|
||
| } | ||
| for _, name := range names { | ||
| cg, err := ctldgraph.NewChangeGroupFromAnnString(name) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The length-error filter is currently based on a hard-coded substring ("must be no more than 63 "), which is brittle and may accidentally suppress unrelated validation errors that happen to mention that length. Consider restricting the match to the specific "name part" max-len error and deriving the number from the Kubernetes constant (e.g., DNS1035LabelMaxLength) instead of embedding 63 in the string.