-
Notifications
You must be signed in to change notification settings - Fork 20
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: linodemachine: add validating admission webhook on create #291
Conversation
Scaffold a validating admission webhook for the LinodeMachine resource with Kubebuider via the command: kubebuilder create webhook --group infrastructure --version v1alpha1 --kind LinodeMachine --programmatic-validation
Use the latest 6th Generation Linode plans (announced in May 2018). The 5th Generation plans are publicly deprecated. See: https://www.linode.com/blog/linode/updated-linode-plans-new-larger-linodes/
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #291 +/- ##
==========================================
- Coverage 66.18% 65.74% -0.44%
==========================================
Files 30 32 +2
Lines 1872 1962 +90
==========================================
+ Hits 1239 1290 +51
- Misses 575 612 +37
- Partials 58 60 +2 ☔ View full report in Codecov by Sentry. |
Webhooks can be enabled or disabled by setting the `ENABLE_WEBHOOKS` environment variable during deployment.
2db5e61
to
db3f44e
Compare
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.
Overall, the PR looks good to me.
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/linodemachine
resources on creation.This initial validation webhook validates the following
LinodeMachine
resource fields on object creation:.spec.region
.spec.type
.spec.osDisk
.Size
<= instance size.spec.dataDisks
-
Length()
<= 7-
Sum(.Size)
<= instance sizeWhich 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:
Accompanied by #311 to isolate client refactoring changes: chore.clients...feat.webhook
TODOs:
Testing:
LinodeMachine
resource: