-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Network topo admission validate hypernode #3897
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
Network topo admission validate hypernode #3897
Conversation
c54f1b8 to
8f8a935
Compare
| } | ||
|
|
||
| // validateHyperNodeName is to validate hypernode name. | ||
| func validateHyperNodeName(value string, fldPath *field.Path) field.ErrorList { |
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.
There is no need to add this func, kube-apiserver already has validation func to validate the crd resource 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.
fixed
b54065a to
cccc032
Compare
cccc032 to
decacbf
Compare
Signed-off-by: weipeng <[email protected]>
decacbf to
8a09bd6
Compare
|
Great! |
| } | ||
|
|
||
| // validateHyperNode is to validate hypernode. | ||
| func validateHyperNode(hypernode *hypernodev1alpha1.HyperNode) error { |
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.
Does hypernode will be nil?
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.
Where is this function used?
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.
it used by line 76 in AdmitHyperNode functions, and hypernode must not nil because schema.DecodeHyperNode will return error when res has error
| errs := field.ErrorList{} | ||
| resourcePath := field.NewPath("") | ||
|
|
||
| for _, member := range hypernode.Spec.Members { |
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.
Will len(hypernode.Spec.Members) will be 0?
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, i changed
86aad15 to
51bbe9d
Compare
|
/ok-to-test |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Monokaix The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
51bbe9d to
7c25611
Compare
Signed-off-by: weapons97 <[email protected]>
7c25611 to
296c650
Compare
hwdef
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.
/lgtm
Realted to: #3878
Add admission validate for hypernode