-
Notifications
You must be signed in to change notification settings - Fork 35
Pod name validation pgs #105
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
Pod name validation pgs #105
Conversation
renormalize
left a comment
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.
Thanks @Ronkahn21 for the PR!
Most things look good, I just have a few nits here and there.
Tests all look great as well!
operator/internal/webhook/admission/pgs/validation/podgangset_test.go
Outdated
Show resolved
Hide resolved
operator/internal/webhook/admission/pgs/validation/podgangset_test.go
Outdated
Show resolved
Hide resolved
operator/internal/webhook/admission/pgs/validation/podgangset.go
Outdated
Show resolved
Hide resolved
operator/internal/webhook/admission/pgs/validation/podgangset.go
Outdated
Show resolved
Hide resolved
operator/internal/webhook/admission/pgs/validation/podgangset.go
Outdated
Show resolved
Hide resolved
operator/internal/webhook/admission/pgs/validation/podgangset_test.go
Outdated
Show resolved
Hide resolved
operator/internal/webhook/admission/pgs/validation/podgangset_test.go
Outdated
Show resolved
Hide resolved
operator/internal/webhook/admission/pgs/validation/podgangset_test.go
Outdated
Show resolved
Hide resolved
operator/internal/webhook/admission/pgs/validation/podgangset_test.go
Outdated
Show resolved
Hide resolved
986de2e to
bc54e66
Compare
- Implement validation for pod name length constraints (45 chars max) - Add separate validation for PodClique templates not in scaling groups - Ensure total pod names stay under 64 characters for annotation support - Add comprehensive test coverage for validation scenarios - Handle nil pointer cases and improve error messages Signed-off-by: Ron Kahn <rkahn@nvidia.com>
bc54e66 to
58fb776
Compare
Signed-off-by: Ron Kahn <rkahn@nvidia.com>
Signed-off-by: Ron Kahn <rkahn@nvidia.com>
renormalize
left a comment
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.
Just one nit that I've added. Will merge the PR into main once it is addressed. Thanks!
| // Get all clique names that belong to scaling groups | ||
| scalingGroupCliqueNames := v.getScalingGroupCliqueNames() |
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.
Can this be moved into v.validatePodCliqueTemplateSpec or validatePodCliqueNameConstraints, since the latter is the only place that this information is used? It would also make the function signature of validatePodCliqueTemplateSpec cleaner if it is.
Summary
Changes
validatePodCliqueTemplatesfor PodCliques NOT in scaling groups (45-char limit: pgs-name + pclq-name)validateScalingGroupPodCliqueNamesfor PodCliques IN scaling groups (45-char limit: pgs-name + pcsg-name + pclq-name)Technical Details
Pod names follow different formats:
<pgs-name>-<pgs-index>-<pcsg-name>-<pcsg-index>-<pclq-name>-<random><pgs-name>-<pgs-index>-<pclq-name>-<random>The validation ensures: