-
Notifications
You must be signed in to change notification settings - Fork 2
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
Prohibit usage of vni zero #105
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
requested review from
MaxRink,
Cellebyte,
chdxD1 and
schrej
as code owners
March 15, 2024 11:28
Cellebyte
reviewed
Mar 15, 2024
I mean the apiserver can also do that enforcement with a block directly
https://kubernetes.io/blog/2022/09/23/crd-validation-rules-beta/
Marcel Fest ***@***.***> schrieb am Fr., 15. März 2024, 21:12:
… ***@***.**** commented on this pull request.
------------------------------
In pkg/reconciler/layer3.go
<#105 (comment)>
:
> @@ -165,6 +165,12 @@ func (r *reconcile) createVrfConfigMap(l3vnis []networkv1alpha1.VRFRouteConfigur
continue
}
+ if vni == 0 {
Should we not do a boundary check here?
vni <= 0 and vni >= max_vni
—
Reply to this email directly, view it on GitHub
<#105 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFLAD22GOK7BSODM5QRWI3YYNIZBAVCNFSM6AAAAABEX2L2Y2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSNBQGQ2DOOJWGQ>
.
You are receiving this because your review was requested.Message ID:
***@***.***
com>
|
@MaxRink only for the CRD ^^ the ConfigMap needs validation as well :) |
Make the ConfigMap an CRD :P
Am Sa., 16. März 2024 um 11:25 Uhr schrieb Marcel Fest <
***@***.***>:
… @MaxRink <https://github.com/MaxRink> only for the CRD ^^ the ConfigMap
needs validation as well :)
—
Reply to this email directly, view it on GitHub
<#105 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFLADZ3X24XDPOLX3HV2GLYYQMXTAVCNFSM6AAAAABEX2L2Y2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBRHE2DCMJQGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Cellebyte
reviewed
Mar 19, 2024
config/crd/bases/network.schiff.telekom.de_layer2networkconfigurations.yaml
Show resolved
Hide resolved
Cellebyte
reviewed
Mar 19, 2024
@@ -165,6 +165,12 @@ func (r *reconcile) createVrfConfigMap(l3vnis []networkv1alpha1.VRFRouteConfigur | |||
continue | |||
} | |||
|
|||
if vni == 0 && vni > 16777215 { | |||
err := fmt.Errorf("VNI can not be set to 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.
please also add the upper boundary in the error message
Cellebyte
reviewed
Mar 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.