-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: linodevpc: add validating admission webhook on create #321
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #321 +/- ##
==========================================
+ Coverage 65.22% 66.30% +1.08%
==========================================
Files 33 34 +1
Lines 2010 2140 +130
==========================================
+ Hits 1311 1419 +108
- Misses 639 659 +20
- Partials 60 62 +2 ☔ View full report in Codecov by Sentry. |
eljohnson92
reviewed
May 16, 2024
eljohnson92
reviewed
May 16, 2024
eljohnson92
reviewed
May 21, 2024
eljohnson92
reviewed
May 21, 2024
eljohnson92
previously approved these changes
May 22, 2024
Scaffold a validating admission webhook for the LinodeVPC resource with Kubebuider via the command: kubebuilder create webhook --group infrastructure --version v1alpha1 --kind LinodeVPC --programmatic-validation
eljohnson92
approved these changes
May 22, 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.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds a validating admission webhook for
infrastructure.cluster.x-k8s.io/v1alpha1/linodevpc
resources on creation.This initial validation webhook validates the following LinodeVPC resource fields on object creation:
.spec.region
- VPC supported
.spec.Subnets[].Label
- Unique among the VPC’s Subnets
- Can only contain ASCII letters, numbers, and hyphens (
-
)- No two consecutive hyphens (
--
)..spec.Subnets[].IPv4
- Range belongs to a private address space as defined in RFC1918
- Prefix length: 1-29
- No overlap with Linode Instance Private IPv4 Address feature
- No overlap with other Subnets on the same VPC
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
gopkg.in/addrs.v1
da 🐐 no 🧢 frfr 🙏go4.org/netipx
da 🐐 no 🧢 frfr 🙏TODOs:
Testing:
LinodeVPC
resource: